Home Forums SQL Server 2005 SS2K5 Replication Transaction Log Growing due to Pending Transaction (Replication) RE: Transaction Log Growing due to Pending Transaction (Replication)

  • The following select statement will scan fn_dblog and construct the sp_repldone statement for each individual command in the log that is marked for replication. It converts PreviousLSN and CurrentLSN into the format used by sp_repldone parameters @xactid and @xact_segno. It may be helpful in your situation:

    select 'EXEC sp_repldone

    @xactid = 0x'+ left(cast([Previous LSN] as varchar(22)),8)+substring(cast([Previous LSN] as varchar(22)),10,8)+right(cast([Previous LSN] as varchar(22)),4)+

    ', @xact_segno = 0x'+left(cast([Current LSN] as varchar(22)),8)+substring(cast([Current LSN] as varchar(22)),10,8)+right(cast([Current LSN] as varchar(22)),4)+

    ', @numtrans = 0, @time = 0' as 'Commands'

    from fn_dblog(null,null) where Operation ='LOP_COMMIT_XACT' and [Description] = 'REPLICATE'