30.06.2013 Views

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1: Basics of <strong>Backup</strong> <strong>and</strong> <strong>Restore</strong><br />

For databases in BULK_LOGGED model, we have similar restore options, except that none<br />

of the point-in-time restore options listed previously can be applied to a log file that<br />

contains minimally logged transactions.<br />

For SIMPLE recovery model databases, our restore options are more limited. In the main,<br />

we'll be performing straightforward restores of the full <strong>and</strong> differential database backup<br />

files. In many cases, certainly for a development database, for example, <strong>and</strong> possibly for<br />

other "non-frontline" systems, this will be perfectly adequate, <strong>and</strong> will greatly simplify,<br />

<strong>and</strong> reduce the time required for, the backup <strong>and</strong> restore strategies for these databases.<br />

Finally, there are a couple of important "special restore" scenarios that we may run into<br />

from time to time. Firstly, we may need to restore one of the system databases. Secondly,<br />

if only a single data page is damaged, it may be possible to perform a page restore, rather<br />

than restoring the whole database.<br />

Restoring system databases<br />

The majority of the discussion of backing up <strong>and</strong> restoring databases takes place in<br />

the context of protecting an organization's business data. However, on any <strong>SQL</strong> <strong>Server</strong><br />

instance there will also be a set of system databases, which <strong>SQL</strong> <strong>Server</strong> maintains <strong>and</strong> that<br />

are critical to its operation, <strong>and</strong> which also need to be backed up on a regular schedule.<br />

The full list of these databases can be found in Books Online (http://msdn.microsoft.<br />

com/en-us/library/ms190190.aspx), but there are three in particular that must be<br />

included in your backup <strong>and</strong> recovery strategy.<br />

The master database holds information on all of your other databases, logins <strong>and</strong> much<br />

more. If you lose your master database you are in a bad spot unless you are taking<br />

backups <strong>and</strong> so can restore it. A full backup of this database, which operates in SIMPLE<br />

recovery model, should be part of your normal backup procedures for each <strong>SQL</strong> <strong>Server</strong><br />

instance, along with all the user databases on that instance. You should also back up<br />

47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!