I’m helping with a rather ad-hoc disaster recovery, and we’ve restored a database backup from a few weeks ago and then restored transactions from a transaction log backup.
We did this using SQL Server Management Studio – right click on database, restore full backup but leave in recovery mode, right click again, restore transaction log, etc.
I’m now trying to verify that we had no gaps in our logs. Is it safe to assume that if the SQL Server Management Studio allowed me to restore the logs without errors, then there were no gaps in the logs (e.g. the log chain is complete)?
In other words – would SQL let me restore logs if there were gaps? I assume it would warn me or stop me in that case.
Thanks for any help you can offer ….
We’re on SQL 2005 but I think the rules about log chains are similar through all versions.
According to the document Working with Transaction Log Backups from Microsoft:
and Creating Transaction Log Backups states:
My free reading of this is:
Considering a lost file a kind of file damage, if Management Studio or any other tool allows you to restore the logs without errors, you can be sure the log chain is complete until the last transaction log backup you’re applying. You must be sure it is the last transaction log backup available for that database, but that is other thing to think about.
If you don’t trust my reading (and the documentation is not too clear on this point), you can make a simple test to be sure: Say you have 10 transaction logs to apply… deliberately delete the 7th (or a random, but not the first nor the last) transaction log, and try your disaster recovery method.
If you get a error saying something like “a transaction log file backup is missing”, you can be sure and trust me.