The Transaction Log goes full during initial Snaphot

  • Transactional Replication - The initial Snapshot ran for 5 hours during which time the Transaction Log went full although hourly Log backups ran successfully.

    My understanding is that committed transactions are written to the Distribution Log and I would expect there to be no influence on the DB's Transaction Log. In reality it looks like, when starting replication it puts a "lock" on the transaction log until the next Log Reader completes. Can anyone help with an explanation of the internal workings?

  • Once you start replication, any new transactions are marked as 'to be replicated' and need to be picked up and copied by the log reader before the log can be truncated.

    If the snapshot takes too long, consider init from backup.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thank you, I think I have it now; While the Snapshot is taking place all newly committed transactions are marked "to be replicated". On completion of the Snapshot, the Log Reader will a) copy "to be replicated" transactions to the Distribution Log, and b) remove "to be replicated" and the log can then be cleared after the next backup

  • The log reader doesn't copy transactions to the distributor's log. It copies them to the distributor database.

    Other than that, pretty much. That's how transactional replication works. Changes are marked as to-be replicated, log reader picks them up from the publisher's transaction log and copies them to the distributor.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply