Tuesday, June 05, 2012

Fun little replication error: Error: 14151, Severity: 18, State: 1. Replication-Replication Distribution Subsystem: agent InsertNameHere-SubscriberHEre-97 failed. The row was not found at the Subscriber when applying the replicated command. Here's how I tracked it down... if you look at the Replication Monitor there is an error, go to the details and you can see what the Seq no is, then you can use that to see what table is the problem. For this error I saw this Command attempted: if @@trancount > 0 rollback tran (Transaction sequence number: 0x0014CA140001FCD1001A00000000, Command ID: 363281) Error messages: The row was not found at the Subscriber when applying the replicated command. (Source: MSSQLServer, Error number: 20598) Get help: http://help/20598 The row was not found at the Subscriber when applying the replicated command. (Source: MSSQLServer, Error number: 20598) Get help: http://help/20598 to run the next command you need to know the DB id, so from the distributor in the distribution DB I ran the following select * from dbo.MSpublisher_databases that showed me what the proper database_id was exec sp_browsereplcmds @xact_seqno_start = '0x0014CA140001FCD1001A00000000' ,@xact_seqno_end = '0x0014CA140001FCD1001A00000000' ,@publisher_database_id = 2 --,@article_id = xxx --,@command_id= 4 looking at the command I was able to get the primary key for the record. In this case, it was only one record, and I was able to get it off of my production server with no problems... Replication will take some time to catch up but I've done this twice before. Yes, I know, nobody should be deleting from the subscriber. I'm working on that.

Labels: , , , ,