Export (0) Print
Expand All

RESTORE VERIFYONLY (Transact-SQL)

Verifies the backup but does not restore it, and checks to see that the backup set is complete and the entire backup is readable. However, RESTORE VERIFYONLY does not attempt to verify the structure of the data contained in the backup volumes. In Microsoft SQL Server 2005, RESTORE VERIFYONLY has been enhanced to do additional checking on the data to increase the probability of detecting errors. The goal is to be as close to an actual restore operation as practical. For more information, see the Remarks.

If the backup is valid, the Database Engine returns a success message.

ms188902.note(en-US,SQL.90).gifNote:
For the descriptions of the arguments, see RESTORE Arguments (Transact-SQL).

Topic link icon Transact-SQL Syntax Conventions


RESTORE VERIFYONLY 
FROM <backup_device> [ ,...n ] 
[ WITH 
   [ { CHECKSUM | NO_CHECKSUM } ]
   [ [ , ] { CONTINUE_AFTER_ERROR | STOP_ON_ERROR } ]
   [ [ , ] FILE =backup_set_file_number ] 
   [ [ , ] LOADHISTORY ] 
   [ [ , ] MEDIANAME = { media_name | @media_name_variable } ] 
   [ [ , ] MEDIAPASSWORD = { mediapassword |
                    @mediapassword_variable } ] 
   [ [ , ] MOVE 'logical_file_name' TO 'operating_system_file_name' ] 
           [ ,...n ] 
   [ [ , ] PASSWORD = { password | @password_variable } ]
   [ [ , ] { REWIND | NOREWIND } ] 
   [ [ , ] STATS [ = percentage ] ] 
   [ [ , ] { UNLOAD | NOUNLOAD } ] 
] 
[;]

<backup_device> ::=
{ 
   { logical_backup_device_name |
            @logical_backup_device_name_var }
   | { DISK | TAPE } = { 'physical_backup_device_name' |
              @physical_backup_device_name_var } 
} 

For descriptions of the RESTORE VERIFYONLY arguments, see RESTORE Arguments (Transact-SQL).

The media set or the backup set must contain minimal correct information to enable it to be interpreted as Microsoft Tape Format. If not, RESTORE VERIFYONLY stops and indicates that the format of the backup is invalid.

Checks performed by RESTORE VERIFYONLY include:

  • 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.
ms188902.note(en-US,SQL.90).gifNote:
RESTORE VERIFYONLY does not work on a database snapshot. To verify a database snapshot before a revert operation, you can run DBCC CHECKDB.

Any user may use RESTORE VERIFYONLY.

A backup operation may optionally specify passwords for a media set, a backup set, or both. When a password has been defined on a media set or backup set, you must specify the correct password or passwords in the RESTORE statement. These passwords prevent unauthorized restore operations and unauthorized appends of backup sets to media using SQL Server 2005 tools. However, a password does not prevent overwrite of media using the BACKUP statement's FORMAT option.

ms188902.security(en-US,SQL.90).gifSecurity Note:
The protection provided by this password is weak. It is intended to prevent an incorrect restore using SQL Server 2005 tools by authorized or unauthorized users. It does not prevent the reading of the backup data by other means or the replacement of the password. The best practice for protecting backups is to store backup tapes in a secure location or back up to disk files that are protected by adequate access control lists (ACLs). The ACLs should be set on the directory root under which backups are created.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft