Replication-Distribution Agent is already running


Very rarely should you acquire the following error, which can be viewed when looking at the job activity monitor failure history:

“Agent message code 21036. Another distribution agent for the subscription(s) is running or the server is working on a previous request by the same agent. “

In order to identify this error message maybe occurring is by trying to start agents that are offline and they fail right away.  At this point you will need to look at the Job Activity Monitor and review the error history for one of the failed agents.   This is where the error message will be displayed.  The error message is indicating that the agent executable, dist.exe, is currently running on the server even though SQL Server is displaying the job is stopped.

To verify if the agent is running run the following select statement on distributor

SELECT    spid

, program_name

, loginame

FROM   Master..sysprocesses

Within the results of the query you will be able to see the name of the distribution agent under the column ‘program_name’.   If you agent is listed than that means it is still running on the server and the process will need to be killed.  At this point you can issue a ‘Kill Spid’ statement on the distributor for that agent.  Once the process has been killed go back to the Job Activity Monitor and try starting the agent again.

Advertisements
This entry was posted in Replication. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s