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 6: Log <strong>Restore</strong>s<br />

You'll notice that in Listing 6-3 I added one minute to this time, the reason being that<br />

the time output does not include seconds, <strong>and</strong> the transactions we want to include could<br />

have committed at, for example, 2:33:45. By adding a minute to the output <strong>and</strong> rounding<br />

up to 2:34:00, we will capture all the rows we want, but not the larger set of rows that<br />

inserted next, after the delay. Note, of course, that the exact format of the timestamp, <strong>and</strong><br />

its actual value, will be different for you!<br />

This time, we specify the RECOVERY parameter, so that when we execute the comm<strong>and</strong><br />

the database will enter recovery mode, <strong>and</strong> the database will be restored to the point of<br />

the last committed transaction at the specified timestamp. When you run Listing 6-3 as a<br />

whole, you should see output similar to that shown in Figure 6-8.<br />

54 percent processed.<br />

100 percent processed.<br />

Processed 232 pages for database 'DatabaseForLog<strong>Backup</strong>s_<strong>Restore</strong>Copy', file<br />

'DatabaseForLog<strong>Backup</strong>s' on file 1.<br />

Processed 5 pages for database 'DatabaseForLog<strong>Backup</strong>s_<strong>Restore</strong>Copy', file<br />

'DatabaseForLog<strong>Backup</strong>s_log' on file 1.<br />

RESTORE DATABASE successfully processed 237 pages in 0.549 seconds (3.369 MB/sec).<br />

100 percent processed.<br />

Processed 0 pages for database 'DatabaseForLog<strong>Backup</strong>s_<strong>Restore</strong>Copy', file<br />

'DatabaseForLog<strong>Backup</strong>s' on file 1.<br />

Processed 9 pages for database 'DatabaseForLog<strong>Backup</strong>s_<strong>Restore</strong>Copy', file<br />

'DatabaseForLog<strong>Backup</strong>s_log' on file 1.<br />

RESTORE LOG successfully processed 9 pages in 0.007 seconds (9.556 MB/sec).<br />

10 percent processed.<br />

20 percent processed.<br />

31 percent processed.<br />

40 percent processed.<br />

50 percent processed.<br />

61 percent processed.<br />

71 percent processed.<br />

80 percent processed.<br />

90 percent processed.<br />

100 percent processed.<br />

197

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

Saved successfully!

Ooh no, something went wrong!