Replication Agents (Troubleshooting)
Replication provides a number of features that can be used if you need to troubleshoot replication agent processing:
- A set of agent parameters that can aid troubleshooting. These parameters are described in this topic.
- Access to agent history and output in Replication Monitor. For more information, see Replication Monitor (Troubleshooting).
- A set of predefined alerts that can be used to notify administrators about a number of conditions, including agent failures and performance issues. For more information, see Setting Thresholds and Warnings in Replication Monitor and Using Alerts for Replication Agent Events.
All replication agents support the following parameters. We recommend using these parameters during troubleshooting, and then setting them to appropriate values after troubleshooting is completed. For example, the -Output parameter should only be used during troubleshooting because it can affect performance.
Parameter | Description |
---|---|
-HistoryVerboseLevel |
The amount of history logged during an agent operation. Specifying a higher value for this parameter can be useful when troubleshooting. |
-OutputVerboseLevel |
The amount and type of information output during agent processing. The agent output can be written to a file, which is specified using the -Output parameter. |
-Output |
The path of the agent output file. If the file name is not provided, the output is sent to the console. When troubleshooting, we recommend that you use a higher value for -OutputVerboseLevel and have the output written to a file. |
-QueryTimeOut |
The number of seconds before an agent query times out. Specifying a higher value for this parameter can be useful, especially when troubleshooting performance issues in which queries are running slowly. |
-LoginTimeOut |
The number of seconds before an agent login attempt times out. Specifying a higher value for this parameter can be useful, especially when troubleshooting connectivity issues. |
The Distribution Agent supports two additional parameters.
Parameter | Description |
---|---|
-SkipErrors |
A list of errors that should be skipped during the application of changes at the Subscriber. For more information, see Skipping Errors in Transactional Replication. |
-ErrorFile |
The path and file name of the error file generated by the Distribution Agent. This file is generated at any point where failure occurred while applying replication transactions at the Subscriber; errors that occur at the Publisher or Distributor are not logged in this file. This file contains the failed replication transactions and associated error messages. When not specified, the error file is generated in the current directory of the Distribution Agent. The error file name is distrib.err. |
Agent parameters can be specified in the following ways:
- In a replication agent profile. For more information, see How to: Work with Replication Agent Profiles (SQL Server Management Studio) and How to: Work with Replication Agent Profiles (Replication Transact-SQL Programming).
- In the SQL Server Agent job step that runs the replication agent. For more information, see How to: View and Modify Replication Agent Command Prompt Parameters (SQL Server Management Studio).
- Directly on the command line or in a batch file. For more information, see Programming Replication Agent Executables.
For a complete list of parameters for each agent, see the following topics:
- Replication Snapshot Agent
- Replication Log Reader Agent
- Replication Distribution Agent
- Replication Merge Agent
- Replication Queue Reader Agent
See Also
Concepts
Replication Troubleshooting Tools
Troubleshooting Replication