• vogelz (3/16/2010)


    I'm not sure I understand the explanation though:

    Whenever a full backup is initiated it will place a pointer in the transaction log in order to understand from where the backup started. So any transaction happening,after the pointer, will be included in the backup.

    Is this saying that a full backup backs up everything fully before the pointer, and then pulls the data after the pointer? Otherwise, what is the point of the pointer?

    If it doesn't mean that, what does it mean? Why would a pointer be placed in the transaction log on the initiation of a full backup if it is going to backup the data before AND after the pointer?

    I'm not sure if the explanation is 100% technically accurate. My understanding (which might be wrong as well) is that the backup first copies all the data pages, then adds all the log pages starting from the start of the oldest uncommitted transaction right up until the time the backup ends.

    On a restore, first all data pages are restored; then the log entries included in the backup are used to

    a) roll forward any transactions that were committed while the backup was running, and

    b) roll back any changes from transactions that were not yet commited when the backup finished.

    The latter is required because the backed up data pages may already have been modified by those transactions.

    As I said, the exact implementation might be slightly different. But the main point to remember is that the backup/restore process ensures that the restored database includes the changes from all the transactions that were finished when the backup ended, and no changes at all from any transactions that were still running at that time.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/