We know that data in a database is important and also aware that database backups are required in case of a disaster in order to restore the database to a previous state (before the disaster). As a Database Admin it is crucial to perform regular database backups. One of the important tasks many people might not pay attention with respect to database backups is to verify whether or not the database backup is reliable. What I mean is “whether that particular database backup is good to be restored?“. It would be a real disaster to have a backup which is not good to be used, in case of recovery. In order to be on a safer side, we need to verify the backups that we have taken. There are 2 ways you can verify whether or not a backup is reliable; one way would be to try restoring from the backup and the other way is to try a restore verifyonly. When a restore the database from a backup (procedure 1), you actually need to have sufficient disk space to hold the database being restored, where as using restore verifyonly option, you do not need to have the free disk space for the database. It verifies whether or not the particular database backup is reliable or not (indicating that it is possible to restore the database from that particular database).
Let’s say you stored your database backup on C: Drive as dbbackup.bak, use the following command to verify if that backup is valid.
RESTORE VERIFYONLY FROM DISK = 'C:\dbbackup.bak'
The image below shows screen shot of the scripts used in this example.
It would be a good practice to verify the backup files using this option on a regular basis.
Do you like this site? Like our FB page @ Facebook.com\LearnSQLWithBru so that, you know when there is a new blog post.