What is a Backup Timeline for Restore Process? – Interview Question of the Week #092

Question: What is the backup timeline for restoring a database?

A base ledger, a later ledger and ordered sealed envelopes in an archive room

Answer: Backup and restore questions still trip up experienced DBAs. The differential backup is usually where the explanation goes astray, so I draw a timeline before naming any files.

In the full recovery model, a common sequence is a full backup, later differential backups, and transaction log backups between and after them. The timeline below makes the choice visible:

Restore sequence: Which backups do you restore?

Suppose I need to restore to the end of this timeline. I restore the full backup, then Differential 2 if it is based on that full backup. I don’t restore Differential 1 first. Next I restore the log backups taken after the second differential, in log-chain order, and recover the database at the end. The earlier log backups are not replayed separately, because the chosen differential has already brought the database forward.

That’s the interview answer, but a real restore needs two checks before touching production: confirm the differential’s base full backup, and confirm an unbroken log chain through the desired recovery point. If the goal is the point of failure, a tail-log backup may also be needed. Keep the database in NORECOVERY until the final restore step.

The short rule is matching full, latest usable differential, then the required logs in order.

A restore is not a replay of every backup, it is the shortest unbroken path from the full backup to the moment you need.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

SQL Backup and Restore, SQL Server
Previous Post
How to Introduce Time Delay Between Two T-SQL Commands? – Interview Question of the Week #091
Next Post
When was Domain Account Password Changed in SQL Server? – Interview Question of the Week #093

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.