Database user and programming tips
As a DBA your #1 responsibility is to make sure that each of your SQL Server databases are backed up. This tip provides a couple of TSQL scripts that will identify the last backup of each database.
When you install a SQL Server instance you have the opportunity to identify the default location for your instance database backups. Overtime you might decide you want to change the default location for database backups. This tip shows you two different ways to change the default location for your database backups.
Not having instant file initialization turned on slows down the process of adding pages to your database, because prior to allocating the data pages to your database, SQL Server needs to zero out the newly allocated pages. Read on to learn more...
There may be times when you need to perform maintenance against a database that requires you to keep normal database users from connecting to your database while the maintenance is being performed. You want to stop users from connecting right away, but you want the database to be in a state that you can perform maintenance. Read on to learn how.
Have you ever wanted to know how many pages in your database have changed since the last full backup? If so, then you will be glad to hear that the SQL Server 2017 version of the DMV, sys.dm_db_file_spavce_usage, has a new column named modified_extent_page_count, which shows the number of pages that have changed since the last full backup.
Learn how to fix the “cache is out of date” error message when SQL Server Management Studio starts up.
Are you purging the old database mail items stored in msdb? In this tip, Greg Larsen shows you how to purge database mail.
Have you ever wondered how much database mail you have sent in the past day or week? What about those database mail items that were not successfully sent. In this tip, Greg Larsen shows you how to review the database mail items that have been processed by SQL Server.
Greg Larsen shows you how to use the Transaction ID value to identify the object_id for a deleted table.
The transaction log backup is stored in SQL Server proprietary format, just like the transaction log itself. Even though the transaction log backup is in a special format, Microsoft has provided us with the fn_dump_dblog() function to read transaction log backups. This function is undocumented, so you should use care when using this function in a production environment.
There are multiple ways to accomplish a database restore. But if you wanted to restore a database from a script how might you accomplish that task quickly and accurately?
Have you ever wanted to be able to see the actual transactions that are contained in the transaction log file? Greg Larsen shows you how to browse the transaction log using an undocumented function.
In this tip, Greg Larsen shows you how to set variables in your calling T-SQL code when using sp_execute sql.
If you are running Windows 8 and above, you might have found out that you can’t find SQL Server Configuration Manager in the list of installed applications. Read on to learn how to locate it.
Have you ever started a database backup or a restore process that runs a long time then wanted to know when it will complete? Knowing when a database backup or restore operation will complete provides you valuable information, especially when you need to perform follow-on tasks that are waiting for the backup or restore process to complete.
Database User and Programming Tips Archives