SQL Server – Enable / Configure Replication Alerts
Replication offers the following predefined alerts, which can be configured to respond to replication events:
- Replication: agent success
- Replication: agent failure
- Replication: agent retry
- Replication: expired subscription dropped
- Replication: Subscription reinitialized after validation failure
- Replication: Subscriber has failed data validation
- Replication: Subscriber has passed data validation
- Replication: agent custom shutdown
Configure these alerts from the Alerts folder in Microsoft SQL Server Management Studio or the Warnings tab in Replication Monitor
Let us take a look how can we enable/Configure Replication Alerts; we will enable one alert for demo.
Example:
We will enable Replication: agent failure alert in such a way, once the agent fail we will get am email and it write the windows event log
Execute the attached Stored Procedure named sp_SQLNotify
So first we will create a Job under Management that sends an email
Now enable the alert Replication: agent failure
Click on “Enable” check Box then click Highlighted Button as above
Click on Edit Button
Click on check Box “Always write to Windows event log.
Go to Second Tab Named “Response”
Click on the check Box “Execute Job:” and select the JOB Named that we created for email.
You are done; with this configuration u will get an email once Replication agent fail and u will get an error detail in windows Event log.
Similarly you can Enable/Configure the other Replication alert according to your requirement.