Today While playing with replication and instance and DR strategy. Found very interested thing.so though to blog that.
I have 6 instance on my box(yeah its true). and so many replication from one instance to other. and to test the DR plan I uninstall \INSTANCE6 (goto CONTROL PANEL->ADD AND REMOVE PROGRAM->select INSTANCE6 UNSTALL). and after that all my replication agents were failing with Error:
The replication agent is not registered properly. Rerun SQL Server setup. The step failed. [SQLSTATE 42000] (Error 14151). The step failed.
got surprise what went wrong... but as it was a development. I searched it on net and found:
PRB: You Receive Error Message: "The replication agent is not registered properly" When the SQL Server Replication Agent Fails
which indicates that when we uninstall any instance from our server the registry will change.
The Replication Agent that is running on the server may not restart when a named instance of SQL Server is removed from the server and replication is configured on the server
So to resolve it:
I used method 1:
created a batch file for the below commands:
places it at \com folder.
and run the batch file.
after that whichever agents failed. restart that server (instances) sql server agent... will solve the issue.
that's what today I learned.
Hope this help to someone..