หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Applies to:
SQL Server
Azure SQL Managed Instance
Microsoft SQL Server Replication Monitor displays status information for publications and subscriptions. By default, Replication Monitor displays warnings only for uninitialized subscriptions, but you can enable warnings for other conditions. It is recommended that you enable warnings for your topology, so that you are informed about status and performance in a timely manner.
When you enable a warning, you specify a threshold. When that threshold is met or exceeded, a warning is displayed (unless an issue with a higher priority needs to be displayed). In addition to displaying a warning in Replication Monitor, reaching a threshold can also trigger an alert. You can enable warnings for the following conditions:
Imminent subscription expiration
This applies to all types of replication. If the specified threshold is met or exceeded, the subscription status is displayed as Expiring soon/Expired.
Exceeding the specified latency (the amount of time that elapses between a transaction being committed at the Publisher and the corresponding transaction being committed at the Subscriber).
This applies to transactional replication. If the specified threshold is met or exceeded, the subscription status is displayed as Performance critical.
Exceeding the specified synchronization time.
This applies to merge replication. If the specified threshold is met or exceeded, the status is displayed as Long-running merge. You can specify different thresholds for dialup and Local Area Network (LAN) connections.
Falling short of processing the specified number of rows in a given amount of time.
This applies to merge replication. If the specified threshold is met or exceeded, the status is displayed as Performance critical. You can specify different thresholds for dialup and LAN connections.
For more information on the warnings Performance critical and Long-running merge, see Monitor Performance with Replication Monitor.
In This Topic
To set thresholds and warnings for a transactional publication
Expand a Publisher group in the left pane, expand a Publisher, and then select a publication.
Select the Warnings tab. To view more information about the options on this tab select Help on the menu bar.
Enable a warning by selecting the appropriate check box: Warn if a subscription will expire within the threshold or Warn if latency exceeds the threshold.
Set a threshold for the warnings in the Threshold column. For example, if you selected Warn if latency exceeds the threshold in step 3, you could select a latency of 60 seconds in the Threshold column.
Select Save Changes.
To configure an alert for a threshold
Select Configure Alerts.
In the Configure Replication Alerts dialog box, select an alert, and then select Configure.
This dialog box displays alerts for all publication types, including alerts that are not related to monitoring thresholds. For more information, see Use Alerts for Replication Agent Events.
Set options in the <AlertName> alert properties dialog box:
On the General page, select Enable; specify which database the alert should apply to.
On the Response page, specify whether an e-mail should be sent and/or a job should be executed.
On the Options page, customize the text of the response.
Select OK.
Select Close.
Set thresholds and warnings for a merge publication
Expand a Publisher group in the left pane, expand a Publisher, and then select a publication.
Select the Warnings tab. To view more information about the options on this tab, select Help on the menu bar.
Enable a warning by selecting the appropriate check box:
Warn if a subscription will expire within the threshold
Warn if a merge length for dialup connections exceeds the threshold
Warn if a merge length for LAN connections exceeds the threshold
Warn if rows merged per second for LAN connections is less than the threshold
Warn if rows merged per second for dialup connections is less than the threshold
Set thresholds for the warnings in the Threshold column. For example, if you selected Warn if a merge length for dialup connections exceeds the threshold in step 3, you could select a time of 10 minutes in the Threshold column.
Select Save Changes.
To configure an alert for a threshold
Select Configure Alerts.
In the Configure Replication Alerts dialog box, select an alert, and then select Configure.
This dialog box displays alerts for all publication types, including alerts that are not related to monitoring thresholds.
Set options in the <AlertName> alert properties dialog box:
On the General page, select Enable; specify which database the alert should apply to.
On the Response page, specify whether an e-mail should be sent and/or a job should be executed.
On the Options page, customize the text of the response.
Select OK.
Select Close.
Set thresholds and warnings for a snapshot publication
Expand a Publisher group in the left pane, expand a Publisher, and then select a publication.
Select the Warnings tab. To view more information about the options on this tab select Help on the top menu.
Enable a warning by selecting the check box Warn if a subscription will expire within the threshold.
Set a threshold for the warning in the Threshold column. For example, you could select a value of 70% in the Threshold column.
Select Save Changes.
To configure an alert for a threshold
Select Configure Alerts.
In the Configure Replication Alerts dialog box, select an alert, and then select Configure.
This dialog box displays alerts for all publication types, including alerts that are not related to monitoring thresholds. For more information, see Use Alerts for Replication Agent Events.
Set options in the <AlertName> alert properties dialog box:
On the General page, select Enable; specify which database the alert should apply to.
On the Response page, specify whether an e-mail should be sent and/or a job should be executed.
On the Options page, customize the text of the response.
Select OK.
Select Close.
With Transact-SQL
You can also set thresholds, alerts, and warnings by using the built-in replication stored procedures:
- MSreplmonthresholdmetrics defines the metrics to monitor replication.
- sp_replmonitorchangepublicationthreshold changes the monitoring threshold for a publication.
- MSpublicationthresholds to track replication performance metrics for a publication.
- sp_add_alert to create an alert.
- sp_add_notification sets up a notification for an alert.
- sp_add_operator creates a notification recipient for an alert.