In my last post about backup and recovery, I discussed the various methods for backing up a SQL Server database. In this post, I'll discuss the other half of the equation: restoring the database. After all, backups are only as good as the last restoration! I will cover the following topics:
Before you begin a restore operation, ensure that you have at least one good full backup of the database. This establishes the backup chain. For a detailed overview of the restore and recovery process, see the "Restore and Recovery Overview" topic in SQL Server Books Online on MSDN.
To restore a database, follow these steps:
As I mentioned earlier, by default, SQL Server Management Studio selects the most recent backup as the point of restoration. But, there are times when you want to restore to a specific point in time. The only way to perform point-in-time restorations is for the database to be in the Full recovery mode.
To restore to a point in time, follow these steps:
Knowing how to restore your database is just as, if not more, important than backing up your databases. An advantage of restoring databases on a regular basis is that it allows you to verify that your backups are valid and can be restored from. Another advantage is that it gives you an idea of how long it takes to restore a database during a disaster recovery scenario.
Jorge Segarra is a database administrator, author, presenter, and blogger who lives and works in Florida. You can find his technical blog at http://sqlchicken.com, where he also runs the community blogging project known as SQL University.