I have a question that related to SQL Server Checkpoint Log Sequence Number.
I've read some articles and they say that the CheckpointLSN of the differential backup maps to the CheckpointLSN of the first transaction log backup created after this differential backup, but I can't find the confirmation on the https://technet.microsoft.com page.
I have a doubt about it because I read that the only possible way to anchor LOG backup to DIFF is: DIFF.DatabaseBackupLSN =< LOG.DatabaseBackupLSN, DIFF.LastLSN < LOG.LastLSN
Also, I have made the following test and it seems that the CheckpointLSN of the differential backup maps to the CheckpointLSN of the first transaction log backup created after this differential backup.
So is it correct?
Best Answer
No it does not map all the time. It depends on the interval of checkpoint happening. You can test this with the code below.
To explain what I said in my comment you can test with this code.
Use the code from here to load 300 rows.
Create a new table.
You will see different CheckpointLSN between diff and log1 backup if you perform below action.
You will see same checkpointLSN in you diff and log1 backup if you perform this actions. Notice I commented out manual checkpoint.
Now if you set TARGET_RECOVERY_TIME to 1 second and perform below steps without manual checkpoint you will see different checkpointLSN between diff and log backup.