0

Suppose a long transaction is running, which also means as usual it is writing entries into the log.

Suppose tlog backup runs at this point, then how does sql server handle this scenario?

  1. Does the log backup contain the ongoing transaction entries?

  2. Does the log get truncated post backup? Assuming the transaction is still running.

1

1 Answer 1

1

I don't have the precise internals, but basically, when any backup starts it has to allow for the fact of data in motion. So a marker is held that shows which transactions are open at the start of the backup process. Anything that is still open at the end of the backup is marked that way in the backup itself. During the restore process, at the recovery step, incomplete transactions are dealt with to ensure data integrity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.