Agent Properties
As in previous versions, SQL Server 2005 implements each replication agent as a three-step job. The first step logs the agent startup message, the second step runs the agent with a set of parameters, and the final step records the history of agent’s execution by executing the system procedure sp_MSdetect_nonlogged_shutdown. If you right-click the log reader or snapshot agent of any publication within Replication Monitor and choose Agent Properties, you will see the properties of the job that runs the agent. You can specify the agent parameters on the second step of each agent’s job. For example, the following statement will run the log reader agent and log the output to a local text file:
Interestingly, right-clicking the distribution agent and choosing properties brings up subscription properties instead of showing the agent’s job steps. I don’t know the reason for having an inconsistent user interface within Replication Monitor. Fortunately, you can still examine the distribution agent’s properties by navigating to the SQL Server Agent, jobs, right-clicking the distribution job, and choosing Properties.
You can specify all parameters supported by each replication agent within its job step. If any parameter isn’t explicitly referenced within a job step, the agent assumes default value for this parameter.
You can also run the replication agents from the command line. To do so, you need to navigate to your SQL Server installation directory and execute snapshot.exe, logread.exe, or distrib.exe file found in 90\COM folder. The following screenshot shows a sample execution of the log reader agent from the command line.