Thursday, October 23, 2014

Transactional Replication - Source: MSSQLServer, Error number: 18805


Error messages:
The process could not execute 'sp_replcmds' on 'D0XXXXxxx\SQL01'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011)
Get help: http://help/MSSQL_REPL20011
The Log Reader Agent failed to construct a replicated command from log sequence number (LSN) {000c5636:000035af:0008}. Back up the publication database and contact Customer Support Services. (Source: MSSQLServer, Error number: 18805)
Get help: http://help/18805
The process could not execute 'sp_replcmds' on 'D0XXXXxxx\SQL01'. (Source: MSSQL_REPL, Error number: MSSQL_REPL22037)
Get help: http://help/MSSQL_REPL22037


Generally, the SQL Server Database Engine prevents gaps in the sequence of log backups, keeping the log chain intact but due to various reasons log to be broken
More often, there are various human actions, which can lead to broken log or taking backups using Truncate only(does not work in SQL versions 2008 and above) or no_log options(does not work in SQL versions 2008 and above).

To fix this re-constrution of the chain, you need to take a full or differential backup and then continue taking log backups.


2.used sp_repldone to mark every transaction in the log to be marked as replicated to the distribution database.

exec sp_repldone @xactid = NULL, @xact_seqno = NULL, @numtrans = 0, @time = 0, @reset = 1


3.By using sp_replflush flushed Transaction Log article cache

4.Executed the sp_replrestart system stored procedure in the publication database without any parameters. This procedure forces replication to continue
even if the distributor and some subscribers have data that the publisher no longer has.

Note Make sure that there is no incoming traffic to the publisher before you perform this step.

Thus above error can be fixed.Even drop and re-create publisher\subscriber also fixes issue.

No comments:

Post a Comment