0

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?

0

how would you restore to a point in time between T3 and T4?

You should restore this way:

  • T0 = full backup
  • T1 = log backup
  • T2 = log backup
  • T3 = log backup
  • T5 = log backup

I did not understand what you said here:

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.

But this one:

the log backup at T5 will only contain transaction information from the time after T4.

is INCORRECT.

Every log backup starts from LSN where previous log backup stops, so it doesn't matter if there was or was not any full backup between T3 and T5.

You could take a "shortcut" by restoring only T4 and T5 in case the time you are interested in was after T4, but it's not your case, so you should restore all the log backups until the last one that covers the time you are interested in, starting from full 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 in full recovery model is log 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.

  • Thank you - you clarified my misconception, which was that the full backup influences the log backup chain. I understand now that is independent. – youcantryreachingme Jan 3 at 1:28

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.