The process could not execute 'sp_repldone/sp_replcounters' on 'RAMESH\DEV'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011)


I am trying to reproduce the above error with the below scenarios. PLEASE  DON’T DO THIS IN PRODUCTION ENVIRONMENT

1)        1) Stop log reader agent in SQL Server













Insert a couple of rows in a Transnational publication table. Choose one table


INSERT INTO Students

VALUES (10,'D'),(11,'E'),(12,'F')

1)       Run the below command one by one


EXEC sp_replcmds


GO

EXEC sp_replshowcmds

GO
--Now this can run at distribution database in distribution server. No need to run this here,though you run this one throw error.
EXEC sp_browsereplcmds 


1Now try to run the log reader agent job manually, go to replication monitor and start Log reader agent job manually. Right click on the monitor and start the job
 

 Workaround: This error occured becuase i have opened my session where i ran sp_replshowcmds and sp_replcmds.  Still the session is open and internally log reader agent is running SO WE NEED TO CLOSE OR KILL THIS SESSION.  See below my opened session.
 Now KILL THIS SESSION OR CLOSE SESSION. Automatically log reader agent job will start successfully. Before that let me see the monitor log reader agent status, and it has been failing.


Now i am KILLING or CLOSING SESSION here i am closing the session .Wait for few minutes( two or three minutes), Now you can see log reader agent job has been running successfully.




Some times the same error occurs due to owner of the database, so change the owner of the database to 'sa' in publisher database. I changed my owner of the database in publisher and the above error went off . I run the below command.

USE PublishedDatabase
GO
EXEC sp_changedbowner 'sa'












Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server