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 9: File <strong>and</strong> Filegroup <strong>Backup</strong> <strong>and</strong> <strong>Restore</strong><br />

Performing a complete restore (native T-<strong>SQL</strong>)<br />

We're going to take a look at an example of performing a complete restore of our<br />

DatabaseForFile<strong>Backup</strong>s database. Before we start, let's insert a third data load, as<br />

shown in Listing 9-17, just so we have one row in each of the tables in the database that<br />

isn't yet captured in any of our backup files.<br />

USE [DatabaseForFile<strong>Backup</strong>s]<br />

GO<br />

INSERT INTO Table_DF1<br />

VALUES ( 'This is the third data load for the table' )<br />

INSERT INTO Table_DF2<br />

VALUES ( 'This is the third data load for the table' )<br />

GO<br />

Listing 9-17: Third data load for DatabaseForFile<strong>Backup</strong>s.<br />

Figure 9-5 depicts the current backups we have in place. We have the first data load<br />

captured in full file backups, the second data load captured in the differential file backups,<br />

<strong>and</strong> a third data load that is not in any current backup file, but we'll need to capture it in<br />

a tail log backup in order to restore the database to its current state. In a case where we<br />

were unable to take a final tail log backup we'd only be able to roll forward to the end of<br />

the TLOG2 backup. In this example, we are going to take one last backup, just to get our<br />

complete database back intact.<br />

321

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

Saved successfully!

Ooh no, something went wrong!