Imagine the following timeline:
- T0 = full backup
- T1 = log backup
- T2 = log backup
- T3 = log backup
- T4 = full backup
- T5 = log backup
After all the above have transpired, if you still have all the backup files, how would you restore to a point in time between T3 and T4?
My understanding is that the full backup at T4 should lead the log file to mark transactions between T0 and T4 as inactive, so in theory, the transaction log may no longer contain transactions from the time before T4. In particular, the log backup at T5 will only contain transaction information from the time after T4. Is this correct?
Best Answer
You should restore this way:
I did not understand what you said here:
But this one:
is INCORRECT.
Every
log backup
starts fromLSN
where previouslog backup
stops, so it doesn't matter if there was or was not anyfull backup
betweenT3
andT5
.You could take a "shortcut" by restoring only
T4
andT5
in case the time you are interested in was afterT4
, but it's not your case, so you should restore all thelog backups
until the last one that covers the time you are interested in, starting fromfull backup
that precedes the time you are interested.P.S. May be it can be useful to you to know that the only thing that can "truncate" the
log
infull recovery model
islog backup
.Full backup
has nothing to do with "marking transactions inactive".This article A SQL Server DBA myth a day: (30/30) backup myths may also help.