1

I use SQL Express and my database has the following backup schedule:

  1. Full backup - 24 hours
  2. Differential backups - 6 hours
  3. Transaction log backups - 30 minutes

My question is:

I have checked LSNs of transaction log backups that were made last night and discovered that one of them has the same First LSN and the Last LSN.

Why? Was it an error?

1

This isn't an error. It means that there weren't any changes in the database.

1

From a recovery standpoint, the log backup chain links the Last LSN of one backup to the First LSN of the next. If the first & last LSN in a log backup are the same, then it means that this log backup is effectively empty of transactions.

Take this simplified example:

Log Backup Time | First LSN | Last LSN
---------------------------------------
 1:00 AM        |  0001     |  0010
 1:30 AM        |  0010     |  0020
 2:00 AM        |  0020     |  0020
 2:30 AM        |  0020     |  0030

In this example, you can restore all four log backups in the order they were taken, however, the 2:00 AM backup is not strictly needed. Because the LSNs link the 1:30 AM backup directly to the 2:30 am backup, it would be possible to achieve proper recovery without restoring the (empty) 2:00 AM backup.

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.