Log File Expansion Automation

SQL Server Database Log file expansion can be fairly tedious if you need to make the log bigger in many reasonably-sized growth increments. It can be tedious because you may need to write and execute…

Detect Databases with High VLF Count

Introduction Broadly speaking, the recovery process for SQL Server consists of reading the transaction log, rolling forward committed transactions, and rolling back uncommitted transactions, since the last checkpoint. The SQL Server Transaction Log is segmented…

How to Fix Databases with High VLF Count

In our earlier posts on recovery, we’ve covered the importance of properly managing SQL Server Transaction Log file growth. This includes how to detect databases with a high VLF count. It can be time-consuming to…

Generate Restore Database Commands

Restoring a database backup from one server to another, or from one database to another on the same machine, often requires MOVE … TO … commands. For databases with a lot of files, this can…

Adding a New Transaction Log File when the Existing Log is Full

SQL Server Transaction Log files store details about every change made to a SQL Server Data File. This includes when you need to add a 2nd log file. The act of adding a 2nd log…

Piecemeal Restore: Backup Set Holds a Backup of a Database Other than the Existing Database (Error)

When attempting to do a piecemeal restore of a database, using the ‘REPLACE’ option to replace the existing database, you may see the following error message: Msg 3154, Level 16, State 4, Line 63 The…