Database Settings, Restores

Restoring a Database With CDC Enabled

When you need to restore a database to a different SQL Server instance, or perhaps to the same instance with a different database name, it's a pretty standard affair. Just backup the database, then restore it in the location you want. Easy as that, you've got the same database restored with all the data it… Continue reading Restoring a Database With CDC Enabled

Backups, Maintenance

Partial Database Backups and Restores with Read-Only Filegroups

Supporting and maintaining a very large database can come with it's challenges. One of them being the backup and restore strategy. The backup sizes are huge and the duration of the full backup is very long, often too long. A common approach to improving that is to split the database into multiple files and filegroups… Continue reading Partial Database Backups and Restores with Read-Only Filegroups

Maintenance

Quick Way to Check Which is the Active Node in a Failover Clustered Instance

If you have a SQL Server failover clustered instance, often you'll want to know which server is acting as the active node. This is easy since you can just check in Windows Cluster Failover Manager which node is the current owner. But what if you have multiple clusters and you want to check them all?… Continue reading Quick Way to Check Which is the Active Node in a Failover Clustered Instance

Maintenance

Recovering a Database in Restoring State Leaves Broker Disabled

Earlier this week I came across an interesting situation where a tail log backup of some databases were taken before a migration - meaning a final transaction log backup was taken and the database was set into RESTORING state. The interesting part came where we recovered the same database on the same server (not restored… Continue reading Recovering a Database in Restoring State Leaves Broker Disabled

Maintenance

How to Move TempDB to a different Drive or Folder

Sometimes you'll need to move the TempDB files to a different drive or folder. It's a pretty simple operation and I'll provide a script for you to use. Typically to move the TempDB files, you would do it in 3 stages: Set the new location in SQL Server, by running a command in SSMSRestart SQL… Continue reading How to Move TempDB to a different Drive or Folder

Maintenance

Detaching then Attaching a Database Loses the Database Settings

In my last post about moving database files, I touched on the point when you detach and then attach a database, you lose some of the database settings. This is a real gotcha that many people don't realise...until they've done it and wonder why things become broken. The database settings that get changed when you… Continue reading Detaching then Attaching a Database Loses the Database Settings

Maintenance

Moving Database Files, It Ain’t That Hard

From time to time, the database data files (like *.mdf and *.ndf), or transaction log files (like *.ldf) need to be moved or renamed, in some way or another. Sometimes, to a different drive or volume. Sometimes, to a different folder on the same drive. Sometimes, the files need to be renamed too. For some… Continue reading Moving Database Files, It Ain’t That Hard