1

Question When RESTORE VERIFY ONLY on a transaction log backup fails, what do you do?

Background After FULL and DIFFERENTIAL backups, I run RESTORE VERIFY ONLY on the backup file(s). This rarely ever fails. But when it does, I simply re-run the backup, and re-run RESTORE VERIFY ONLY. Currently, I don't verify transaction log backups. It's an oversight on my part that I'm looking to correct. When I get to that point, I have to be prepared for all outcomes.

Possible Scenario Let's say I have a full backup with trx log backups performed periodically afterwards. If there are 10 trx log backups, but #7 failed a RESTORE VERIFY ONLY, the best I could do in a DR situation is to restore the FULL backup and six subsequent trx log backups. (I write this based on my understanding that when RESTORE VERIFY ONLY fails, RESTORE DATABASE...FROM <7th Trx Log Backup> will fail too.)

So, even though the trx log chain is not technically broken, it's "effectively" broken since I can't restore the 7th trx log backup (or any subsequent trx log backup).

If I had taken a DIFFERENTIAL backup immediately after #7 failed, in a DR situation I could:

  1. Restore the FULL backup
  2. Restore the DIFFERENTIAL backup
  3. Restore transaction log backups 8, 9, and 10
  • Yes, I'd definitely take a differential backup because right now your potential for data loss is expanding with every second passing until you create a full or diff backup. You are probably out of SLA. – usr Jul 24 '14 at 17:54
  • Yes you are right. And also you may want to consider to temporary disable trn backups if you make them too often, since diff will take some time to finish. Depends on your backup schedule. – yahor Oct 8 '14 at 23:08
1

But this brings up a question about how to proceed when RESTORE VERIFY ONLY fails.Let's say a trx log backup completes successfully, but RESTORE VERIFY ONLY fails

Restore verifyonly(as per BOL)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. So even if backup set comes as verified clean by Verifyonly its not 100% guaranteed that backup set is consistent only a successful restore of a backup can guarantee that backup set is valid.

I have not see an scenario where verifyonly fails but restores succeeds(unless you succeed with using continue_after_error) it can only happen when verifyonly failed saying there is not enough space to check backup consistency because verifyonly also checks that enough space is there to restore the database

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.

Please show me the message which you got when verifyonly failed

After Verifyonly fails

I would run a checkdb on my database to check for any inconsistency but point here to note is checkdb does not do consistency check for log file only when recovery on snapshot is run during checkdb log file is used so we 'can' say that it checks for log file as well but not complete like it does for data file. If checkdb comes out clean I would say my database is consistent.

The backup spans LSNs X to Y. I can't simply take another trx log backup to "fix" the situation: the subsequent trx log backup would span a different range of LSNs (Y+1 to Z). At this point, the log chain is effectively broken, right?

Yes you are correct taking multiple backup does not fixes corruption in log backup but taking multiple log backups does not break log chain. Log files are inked internally with LSN number and taking multiple log backup does not breaks chain if log backups are restored in sequential manner

My first thought is to immediately take a DIFFERENTIAL backup. What would you do?

It wont solve corruption issue in any way. Differential backups are means to lower the RTO and perform speedy recovery of database thats it.

EDIT AFTER USER UPDATED HIS QUESTION:

the best I could do in a DR situation is to restore the FULL backup and six subsequent trx log backups

Yes you are correct.

If I had taken a DIFFERENTIAL backup soon after #7 failed, in a DR situation I could:

Restore the FULL backup
Restore the DIFFERENTIAL backup
Restore transaction log backups 8, 9, and 10

Yes you can restore differential backup, after you cleared question with details I have updated the answer. You can restore differential backup and then restore log backups 8,9,10 as they are taken after diff backup

  • My experience has been different that what you explained above. I created a demo script, but it didn't work as I expected on SqlFiddle. Perhaps this will do – Dave Mason Jul 24 '14 at 22:38
  • Well You took transaction log backup 8,9,10 after taking differential backup so of course it will work. If you would have taken log backups 1-10 all, before taking differential back and then restored full backup and differential then you cannot use log backups. Thanks for clearing now I understood what you were asking but if log 7 can fail with verifyonly its chance that further logs might alos fails(8,9,10) and so might be case with diff backup – Shanky Jul 24 '14 at 23:02
  • Like I mentioned in my answer I though u said log backup 8,9,10 were taken before diff backup – Shanky Jul 24 '14 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.