Changes the monitoring threshold metric for a publication. This stored procedure, which is used to monitor replication, is executed at the Distributor on the distribution database.
sp_replmonitorchangepublicationthreshold [ @publisher = ] 'publisher' , [ @publisher_db = ] 'publisher_db' , [ @publication = ] 'publication' [ , [ @publication_type = ] publication_type ] [ , [ @metric_id = ] metric_id ] [ , [ @thresholdmetricname = ] 'thresholdmetricname' [ , [ @value = ] value ] [ , [ @shouldalert = ] shouldalert ] [ , [ @mode = ] mode ]
[ @publisher = ] 'publisher'
Is the name of the Publisher. publisher is sysname, with no default.
[ @publisher_db = ] 'publisher_db'
Is the name of the published database. publisher_db is sysname, with no default.
[ @publication = ] 'publication'
Is the name of the publication for which the monitoring threshold attributes are being changed. publication is sysname, with no default.
[ @publication_type = ] publication_type
If the type of publication. publication_type is int, and can be one of these values.
|NULL (default)||Replication attempts to determine the publication type.|
[ @metric_id = ] metric_id
Is the ID of the publication threshold metric being changed. metric_id is int, with a default value of NULL and can be one of these values.
|1||expiration - monitors for imminent expiration of subscriptions to transactional publications.|
|2||latency - monitors for the performance of subscriptions to transactional publications.|
|4||mergeexpiration - monitors for imminent expiration of subscriptions to merge publications.|
|5||mergeslowrunduration - monitors the duration of merge synchronizations over low-bandwidth (dial-up) connections.|
|6||mergefastrunduration - monitors the duration of merge synchronizations over high-bandwidth local area network (LAN) connections.|
|7||mergefastrunspeed - monitors the synchronization rate of merge synchronizations over high-bandwidth (LAN) connections.|
|8||mergeslowrunspeed - monitors the synchronization rate of merge synchronizations over low-bandwidth (dial-up) connections.|
You must specify either metric_id or thresholdmetricname. If thresholdmetricname is specified, then metric_id should be NULL.
[ @thresholdmetricname = ] 'thresholdmetricname'
Is the name of the publication threshold metric being changed. thresholdmetricname is sysname, with a default value of NULL. You must specify either thresholdmetricname or metric_id. If metric_id is specified, then thresholdmetricname should be NULL.
[ @value = ] value
Is the new value of the publication threshold metric. value is int, with a default value of NULL. If null, then the metric value is not updated.
[ @shouldalert = ] shouldalert
Is if an alert is generated when a publication threshold metric is reached. shouldalert is bit, with a default of NULL. A value of 1 means that an alert is generated, and a value of 0 means that an alert is not generated.
[ @mode = ] mode
Is if the publication threshold metric is enabled. mode is tinyint, with a default of 1. A value of 1 means that monitoring of this metric is enabled, and a value of 2 means that monitoring of this metric is disabled.
Return Code Values
0 (success) or 1 (failure)
sp_replmonitorchangepublicationthreshold is used with all types of replication.
Only members of the db_owner or replmonitor fixed database role in the distribution database can execute sp_replmonitorchangepublicationthreshold.