sp_replmonitorchangepublicationthreshold (Transact-SQL)

适用于:SQL ServerAzure SQL 托管实例

更改发布的监视阈值标准。 在分发服务器的分发数据库上执行此存储过程,用于监视复制。

Transact-SQL 语法约定

语法

  
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' 发布服务器的名称。 publishersysname,没有默认值。

[ @publisher_db = ] 'publisher_db' 已发布数据库的名称。 publisher_db为 sysname,无默认值。

[ @publication = ] 'publication' 正在更改监视阈值属性的发布的名称。 publicationsysname,无默认值。

[ @publication_type = ] publication_type 如果发布类型。 publication_type为 int,可以是这些值之一。

说明
0 事务发布。
1 快照发布。
2 合并发布。
NULL(默认值) 复制尝试确定发布类型。

[ @metric_id = ] metric_id 正在更改的发布阈值指标的 ID。 metric_id为 int,默认值为 NULL,可以是其中一个值。

标准名称
1 expiration - 监视对事务发布的订阅是否即将过期。
2 latency - 监视对事务发布的订阅的性能。
4 mergeexpiration - 监视对合并发布的订阅是否即将过期。
5 mergeslowrunduration - 通过低带宽(拨号)连接监视合并同步的持续时间。
6 mergefastrunduration - 通过高带宽局域网 (LAN) 连接监视合并同步的持续时间。
7 mergefastrunspeed - 监视通过高带宽 (LAN) 连接进行的合并同步的同步速率。
8 mergeslowrunspeed - 通过低带宽(拨号)连接监视合并同步的同步速率。

必须指定 metric_idthresholdmetricname。 如果 指定了 thresholdmetricname ,则 metric_id 应为 NULL。

[ @thresholdmetricname = ] 'thresholdmetricname' 正在更改的发布阈值指标的名称。 thresholdmetricname 为 sysname,默认值为 NULL。 必须指定 thresholdmetricnamemetric_id。 如果 指定了metric_id ,则 thresholdmetricname 应为 NULL。

[ @value = ] value 发布阈值指标的新值。 值为 int,默认值为 NULL。 如果 为 null,则不会更新指标值。

[ @shouldalert = ] shouldalert 是否在达到发布阈值指标时生成警报。 shouldalert,默认值为 NULL。 值为 1 表示生成警报,值为 0 表示未生成警报。

[ @mode = ] mode 是否已启用发布阈值指标。 模式tinyint,默认值为 1。 值为 1 表示启用对此指标的监视,值为 2 表示禁用此指标的监视。

返回代码值

0 (成功) 或 1 (失败)

备注

sp_replmonitorchangepublicationthreshold用于所有类型的副本 (replica)。

权限

只有分发数据库中db_ownerreplmonitor 固定数据库角色的成员才能执行sp_replmonitorchangepublicationthreshold

另请参阅

以编程方式监视复制