Tip

Check large backup sets before a full restore

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=

    Requires Free Membership to View

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

    There are Comments. Add yours.

     
    TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

    REGISTER or login:

    Forgot Password?
    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
    Sort by: OldestNewest

    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:

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.