My understanding of a full backup is (based on https://technet.microsoft.com/en-us/library/2009.07.sqlbackup.aspx - most of the below is copied, from this link):
- Force a database checkpoint and make a note of the log sequence number at this point. This flushes all updated-in-memory pages to disk before anything is read by the backup to help minimize the amount of work the recovery part of restore has to do.
- Start reading from the data files in the database.
- Stop reading from the data files and make a note of the log sequence number of the start of the oldest active transaction at that point
- Read as much transaction log as is necessary.
Backing up enough of the transaction log is required so that recovery can successfully run during the restore and so that all pages in the database are at the same point in time—the time at which the data reading portion of the backup operation completed. The transaction log from the beginning of the oldest active (or uncommitted) transaction to the end of the backup, is required to allow recovery to run. The transaction log back from the backup checkpoint to the end of the backup is required to allow all pages to be brought to the same point in time and for transactional consistency.
The minimum log sequence number (LSN) of the transaction log that is included in the full backup is MIN (LSN of backup checkpoint, LSN of oldest active transaction) and it could be for a transaction that began even before the backup began. This ensures that the restored copy of the database (or whatever you restored—page, file, filegroup, database) is completely consistent.
Questions when I read This book from Microsoft:
The book from Microsoft suggests that MIN LSN - "Determines the minimum LSN required for the log backup by taking the earliest in time between the backup end LSN and the oldest active transaction’s LSN." Is this incorrect and should it have been "start" instead of end?
Same page, the para above that on the book says that the back-up end LSN is - "LSN of the start of the oldest active transaction" - but should'nt it be end of the backup?
Same page, notice also that the image is incorrect - see Transactions A and B start twice - I think the 2nd one should be transaction end instead of start?
Bit confused.
backup start LSN
forcheckpoint LSN
andbackup end LSN
forLSN of oldest active transaction
. I would prefer the nomenclature used by Paul Randal