


The validation methods mentioned above guard you against corruption occurring during backups, not against corrupted data within the backup. Keep in mind that if your data is corrupt prior to a backup, SQL Server can BACKUP that CORRUPTED DATA. With VerifyOnly Data Validation Prior to Taking Backups

More Details on CHECKSUM and BACKUP CHECKSUMįrom Disk='G:DBABackupsTestDBFull_MMDDYYYY.bak' Additionally, if available, the page checksum can be verified as well. This will check data pages contained in the backup file and compare it against the CHECKSUM used during the backup. CHECKSUM on Restore – Databases where BACKUP WITH CHECKSUM have been performed can then be additionally verified as part of the restore process.VERIFY too can be automated to perform each time your backups utilizing CHECKSUM run. Despite the name “RESTORE VERIFONLY”, it does not actually restore the data. Note that much like CHECKSUM, this will check to see if there are errors during the read/write process of the backup however, it will not verify that the data itself is valid or not corrupt. This will verify the backup header, and also that the backup file is readable. VERIFY – It is not wise to rely solely on CHECKSUM, a good addition is to use RESTORE VERIFYONLY.To Disk='G:DBABackupsTestDBFull_MMDDYYYY.bak' BEWARE though, this does not ensure that the database is corruption free, CHECKSUM only verifies that we are not backing up an already-corrupt database. ( Later in this post we discuss checking data for corruption.) If it seems like too much trouble to write a CHECKSUM script every time you want to perform a backup, keep in mind that these can be automated as SQL Agent Jobs! A sample T-SQL script for using CHECKSUM is as follows:.If the backup completes successfully, there are no broken page checksums. If a bad checksum is found, the backup will fail. CHECKSUM is part of a backup operation which will instruct SQL Server to test each page being backed up with its corresponding checksum, making sure that no corruption has occurred during the read/write process. Backup with CHECKSUM – It may not be realistic to run regular test restores on every single database, this is where CHECKSUM is your friend.Make sure to run a test restore on your Full, Differential, Point in Time, and Transaction Logs! “Bonus points” if you automate refreshing non-production. If your Restore is successful, you have a solid backup. RESTORE – The most effective way to validate that your backups are good is to run a test Restore.There are several methods for validating your Backups. Corrupt backups are recoverable, but worthless. How do you know if your Backups are good? TEST! Validating SQL Server Backups will ensure that you are in a good place when it is time to bring your database back from the dead!ĭon’t assume that your Backups are solid and let them sit on a shelf. You have your SQL Server Backup Plan and your Database Recovery Model set.
