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 3: Full Database <strong>Backup</strong>s<br />

These results represent a considerable saving, in both storage space <strong>and</strong> processing time,<br />

over non-compressed backups.<br />

If you're wondering whether or not the compression rates should be roughly consistent<br />

across all your databases, then the short answer is no. Character data, such as that stored<br />

in our DatabaseForFull<strong>Backup</strong>s database compresses very well. However, some<br />

databases may contain data that doesn't compress as readily such as FILESTREAM <strong>and</strong><br />

image data, <strong>and</strong> so space savings will be less.<br />

Verifying <strong>Backup</strong>s<br />

Having discussed the basic concepts of backup verification in Chapter 2,<br />

Listing 3-11 shows a simple script to perform a checksum during a backup of our<br />

DatabaseForFull<strong>Backup</strong>s database, followed by a RESTORE VERIFYONLY,<br />

recalculating the checksum.<br />

BACKUP DATABASE [DatabaseForFull<strong>Backup</strong>s]<br />

TO DISK = N'C:\<strong>SQL</strong><strong>Backup</strong>s\Chapter3\DatabaseForFull<strong>Backup</strong>s_Full_Native_Checksum.bak'<br />

WITH CHECKSUM<br />

GO<br />

RESTORE VERIFYONLY<br />

FROM DISK = N'C:\<strong>SQL</strong><strong>Backup</strong>s\Chapter3\DatabaseForFull<strong>Backup</strong>s_Full_Native_Checksum.bak'<br />

WITH CHECKSUM<br />

Listing 3-11: <strong>Backup</strong> verification examples.<br />

Hopefully you'll get output to the effect that the backup is valid!<br />

113

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

Saved successfully!

Ooh no, something went wrong!