RESTORE VERIFYONLY vs. Full Restore with DBCC CHECKDB for Data Integrity
0 reputation · 01 Jun 2020, 06:34 UTC
0 reputation · 01 Jun 2020, 06:34 UTC
Ensuring the recoverability of a Microsoft SQL Server database requires balancing verification depth against available resources. Two documented methods provide different levels of assurance: RESTORE VERIFYONLY and a full RESTORE followed by DBCC CHECKDB.
RESTORE VERIFYONLY confirms that the backup set is complete and readable, validating the header and checksums without writing data to disk. However, it cannot detect logical corruption within the data pages that only surfaces during a full restoration and subsequent consistency check.
Conversely, restoring the backup to a separate instance and running DBCC CHECKDB provides the highest level of confidence that the data is consistent and queryable. The constraint is the significant overhead in I/O, storage, and time, which may exceed maintenance windows for multi-terabyte databases.
Given these trade-offs, there is an unresolved decision regarding the execution environment for the full restore verification process.
35275 reputation · 01 Jun 2020, 13:33 UTC
Run the full RESTORE + DBCC CHECKDB verification on a dedicated non-production instance, and keep RESTORE VERIFYONLY as the cheap per-backup check on (or near) production. Restoring a multi-terabyte backup and running CHECKDB on the production instance competes for I/O, CPU, and tempdb with live workloads — and it proves nothing about production itself, only about the backup. That verification belongs elsewhere.
RESTORE VERIFYONLY confirms the backup set is complete and readable: it validates the header and, if the backup was taken WITH CHECKSUM, page checksums. It never writes data files, so it cannot detect logical corruption (broken page linkage, allocation errors) or even storage-path problems that only appear during a real restore. Passing VERIFYONLY is not proof of restorability.
A full restore followed by DBCC CHECKDB is the strongest assurance: it proves the backup restores end-to-end and that the resulting database is structurally and logically consistent. The cost is real — roughly the database's size in scratch storage plus hours of I/O for large databases.
WITH CHECKSUM — without it, VERIFYONLY has far less to validate.RESTORE VERIFYONLY after every backup as the baseline gate.DBCC CHECKDB WITH NO_INFOMSGS at a cadence your storage and time budget allows — weekly or per backup-chain is common. Use PHYSICAL_ONLY for faster structural checks more often, with full logical checks less frequently.RESTORE VERIFYONLY FROM DISK = 'D:\Backups\MyDB_full.bak' WITH CHECKSUM;
-- On the standby instance:
RESTORE DATABASE MyDB_Verify FROM DISK = '\\share\MyDB_full.bak' WITH MOVE ..., NORECOVERY;
DBCC CHECKDB (MyDB_Verify) WITH NO_INFOMSGS;Measure elapsed time and disk consumption of one restore+CHECKDB cycle on your largest database; that number sets your realistic cadence.
The standby instance is not automatically free. Passive/DR verification instances may be covered under Software Assurance disaster-recovery rights, but terms vary by edition and agreement and change over time — confirm with your Microsoft licensing documentation before assuming. If a second instance is genuinely not affordable, the fallback is off-hours restore verification on production with resource governance, accepting the contention risk — but treat that as a compromise, not a plan.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.