Check large backup sets before a full restore

It's important to know whether or not you're working with a damaged backup set before trying to perform a restore. Contributor Serdar Yegulalp explains how to determine if a backup set is readable.

This Content Component encountered an error

The larger the SQL Server backup set, the more likely you are to have some kind of error. This isn't to say that errors are inevitable, but they are more likely to occur during a large backup (1 GB or more). Since restore operations for big backup sets are not trivial (and take a long time), it helps to know if you're dealing with a damaged backup set before investing hours of your time trying to perform the restore. This goes double...

when trying to restore a database that's already in place and operational.

One way to determine if the backup set is readable without attempting to restore data into a working form -- and without expending a great deal of time -- is to use the RESTORE FILELISTONLY command. When issued through Query Analyzer or a similar tool, it can be used to scan the backup set and return a list of database and log files contained in the backup. SQL Server also has to perform basic integrity checks on the file when it does this, so if there's an error retrieving the file list in the backup set, then the set itself may be damaged. It's best to find out about that sooner rather than later.

The command syntax for this would be something like: RESTORE FILELISTONLY FROM DISK='C:\BACKUPS\DATABASE.BAK'

The name of the file and its location will vary, of course. Note: You may have multiple backup sets in one file. While some may not be recoverable, others may still work. To specify a certain backup set, use the WITH FILE=x parameter at the end of the above command, where x is the number of the backup set in question.

About the author: Serdar Yegulalp is editor of the Windows Power Users Newsletter. Check it out for the latest advice and musings on the world of Windows network administrators -- and please share your thoughts as well!


More information from SearchSQLServer.com

  • Tip: Troubleshooting SQL Server backup and restore dilemmas
  • Tip: Managing backups for a large number of SQL Servers
  • Ask the Experts: Restoring a database without a backup


  • This was first published in December 2005

    Dig deeper on SQL Server Backup and Recovery

    Pro+

    Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    0 comments

    Oldest 

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to:

    -ADS BY GOOGLE

    SearchBusinessAnalytics

    SearchDataCenter

    SearchDataManagement

    SearchAWS

    SearchOracle

    SearchContentManagement

    SearchWindowsServer

    Close