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 5: Log <strong>Backup</strong>s<br />

CREATE DATABASE [ForceFailure]<br />

ALTER DATABASE [ForceFailure] SET RECOVERY FULL WITH NO_WAIT<br />

GO<br />

DBCC Loginfo;<br />

GO<br />

Listing 5-10: Running DBCC Loginfo on the ForceFailure database.<br />

The results are shown in Figure 5-13. The DBCC LogInfo comm<strong>and</strong> returns one row<br />

per VLF <strong>and</strong>, among other things, indicates the Status of that VLF. A Status value<br />

of 2 indicates a VLF is active <strong>and</strong> cannot be truncated; a Status value of 0 indicates<br />

an inactive VLF.<br />

Figure 5-13: Five VLFs for our empty ForceFailure database.<br />

Five rows are returned, indicating five VLFs (two of which are currently active). We<br />

are not going to delve any deeper here into the meaning of any of the other columns<br />

returned.<br />

Now let's insert a large number of rows (one million) into a VLFTest table, in the<br />

ForceFailure database, using a script reproduced by kind permission of Jeff Moden<br />

(www.sqlservercentral.com/Authors/Articles/Jeff_Moden/80567/), <strong>and</strong> then rerun<br />

the DBCC LogInfo comm<strong>and</strong>, as shown in Listing 5-11.<br />

178

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

Saved successfully!

Ooh no, something went wrong!