Verifying Database Backups

The RESTORE VERIFY and RESTORE... VERIFY COMPATIBLE options validate the archived backups against the database and write the results to the server log. The backup verification process can run on a host other than the database host.

RESTORE... VERIFY

RESTORE... VERIFY checks all stripes and logs the number of verified blocks to the server log:
I. 08/26 11:50:16. RESTORE VERIFY Started
I. 08/26 11:50:16. Total number of IQ blocks to be verified: 5944
I. 08/26 11:50:16. Total number of IQ blocks verified: 25/5944 ( 0% )
I. 08/26 11:50:16. Total number of IQ blocks verified: 5030/5944 ( 84% )
I. 08/26 11:50:16. Total number of IQ blocks verified: 5944/5944 ( 100% )
I. 08/26 11:50:16. RESTORE VERIFY Successfully Complete

If you specify RESTORE... VERIFY for an incremental restore, SAP Sybase IQ does not look for any dbspaces or perform compatibility checks. No warning is reported, even if the files do not exist. Compatibility checks are performed only with RESTORE… VERIFY COMPATIBLE.

RESTORE… VERIFY COMPATIBLE

RESTORE… VERIFY COMPATIBLE checks the compatibility of an incremental archive with the current database. If the database files do not exist, RESTORE…VERIFY COMPATIBLE logs an exception. RESTORE…VERIFY COMPATIBLE opens the dbspaces in read-only mode to perform consistency checking. No dbspaces are modified. If the catalog store or any dbspaces are missing, RESTORE…VERIFY COMPATIBLE throws an error and the operation fails.

If you specify RESTORE…VERIFY COMPATIBLE for a full backup, the COMPATIBLE keyword is ignored; no compatibility checks are necessary to restore a full backup.

In incremental restores, if the database has been modified or the particular incremental archive is not the correct archive for the database, RESTORE VERIFY COMPATIBLE reports the error Database has changed since last restore or This restore cannot immediately follow the previous restore.

Verification Error Reporting

In most cases, an exception terminates the verification process. If verification encounters these errors, the process continues to check the archive and logs information for the errors detected.

The errors for which verification can continue are:

If any of these errors are found and the verification process can continue to the end of the archive, SAP Sybase IQ reports this error: The verification of the provided archive has failed. Please check the server log for details of the errors thrown during verify.

If any error pertaining to RESTORE is found other than the errors above, the error that occurred is reported, and the verification process stops.

Note: The verification of a backup archive is different than the database consistency checker (DBCC) verify mode (sp_iqcheckdb 'verify...'). RESTORE VERIFY validates the consistency of the backup archive to be sure it can be restored, whereas DBCC validates the consistency of the database data.

Run sp_iqcheckdb 'verify...' before taking a backup. If an inconsistent database is backed up, then restored from the same backup archive, the data continues to be in an inconsistent state, even if RESTORE VERIFY reports a successful validation.

Related concepts
Database Restore
Displaying Header Information
Restoring to Raw Devices
Restoring Cache Dbspaces
Moving Database Files
Restoring Multiplex Stores
Error Recovery
Related reference
RESTORE DATABASE Statement