Sql-server – How to remove orphaned Log Reader Agents from Replication Monitor

replicationsql-server-2008

How do I remove the two Log Reader Agents with errors from the Replication Monitor?

As you can see, the job does not exist (Error message produced by right click > Properties on errored Log Agent Reader) – it has previously been deleted, but these two Log Reader Agents refuse to go!

Log Reader Agent errors

Best Answer

I was having this same issue. Below is how I found the orphaned Log Reader Agents, Once they were identified I removed the rows from MSlogreader_agents and it corrected the issue of errors in the replication monitor

SELECT TOP 500 [id]
  ,[name]
  ,[publisher_id]
  ,[publisher_db]
  ,[publication]
  ,[local_job]
  ,[job_id]
  ,[profile_id]
  ,[publisher_security_mode]
  ,[publisher_login]
  ,[publisher_password]
  ,[job_step_uid]
FROM [distribution].[dbo].[MSlogreader_agents]