SQL Server Enterprise Manager and SQL Server Agent provide a way to monitor events, such as replication agent errors, using alerts. SQL Server Agent monitors the Microsoft® Windows NT® 4.0 or Microsoft Windows® 2000 application log, watching for an event that qualifies as one of the defined alerts. If such an event occurs, SQL Server Agent can respond automatically, either by executing a task that you have defined or by sending e-mail or a pager message to a specified operator.
You can select a Distributor and use Replication Monitor to display a list of all of the replication-related alerts on the server.
Microsoft SQL Server™ 2000 includes a set of predefined alerts for replication. You can configure these alerts to notify operators about the state of replication. Operators can then intervene in the replication process manually or configure an automated response job. Alerts that support an automated response job enter additional information into the msdb..sysreplicationalerts system table. The information in sysreplicationalerts can be used by a custom Transact-SQL job when responding to the alert.
The following alerts are installed when a computer is configured as a Distributor.
Condition Causing the Alert to Fire
|Enters Additional Information in sysreplicationalerts|
|14150||Replication: Agent success||Agent shuts down successfully.||Yes|
|14151||Replication: Agent failure||Agent shuts down with an error.||Yes|
|14152||Replication: Agent retry||Agent shuts down after unsuccessfully retrying an operation (agent encounters an error such as server not available, deadlock, connection failure, or time-out failure).||Yes|
|14157||Replication: Subscription cleaned up.||Inactive subscription was deleted.||No|
|20574||Replication: Subscriber has failed data validation||Distribution or Merge Agent fails data validation.||Yes|
|20575||Replication: Subscriber has passed data validation||Distribution or Merge Agent passes data validation.||Yes|
|20572||Replication: Subscription reinitialized after validation failure||Response job 'Reinitialize subscriptions on data validation failure' reinitializes a subscription successfully.||No|
Viewing the Application Log
To view the Microsoft® Windows NT® 4.0 or Windows® 2000 application log, use the Windows NT 4.0 or Windows 2000 Event Viewer. If you are part of the Windows NT Administrators group, you can also view remote application logs. The application log contains SQL Server error messages as well as messages for all activities on the computer.
When you use the Windows NT application log, each SQL Server session writes new events to an existing application log; you can filter the log for specific events. Unlike the SQL Server error log, a new application log is not created each time you start SQL Server; however, you can specify how long logged events will be retained.