Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Verify a database backup using T-SQL

By Nakul Vachhrajani, 2011/07/11

The RESTORE command provides the facility to very easily validate a backup (taken via SQL Server, not via 3rd party utilities like SQLLite). This T-SQL code can help in ensuring that the backup file is structurally consistent, and therefore helps rule out I/O issues.

The checks performed by RESTORE VERIFYONLY include (per Books On Line):

  • That the backup set is complete and all volumes are readable
  • Some header fields of database pages, such as the page ID (as if it were about to write the data)
  • Checksum (if present on the media)
  • Checking for sufficient space on destination devices

This script has also been published on my blog at: http://beyondrelational.com/blogs/nakul/archive/2011/04/18/a-script-to-verify-a-database-backup.aspx

 

Before running the script, please substitute the backup location and the code for the database files to suit your database configuration.

 

Thank-you,

Nakul Vachhrajani,

Be courteous. Drive responsibly.

http://beyondrelational.com/blogs/nakul/default.aspx

Total article views: 1513 | Views in the last 30 days: 10
 
Related Articles
ARTICLE

Powershell Database Backup Script

Learn how to write a script for regular database backups using Powershell and SMO.

FORUM

xmla script for automate ssas database backup

xmla script for automate ssas database backup

SCRIPT

Backup & Restoration Script

This script provides very useful information about database backup and restoration.

BLOG

Script: Backup All your Databases

We all know the importance of taking regular backups of our SQL Server databases. This is a useful l...

FORUM

Auto Backup Script

Auto Backup Script

Tags
administration    
backup/restore    
diagnostic    
script    
t-sql    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones