AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / dba / 问题 / 183500
Accepted
Mike
Mike
Asked: 2017-08-15 21:10:06 +0800 CST2017-08-15 21:10:06 +0800 CST 2017-08-15 21:10:06 +0800 CST

使用 TSQL 在 MSSQL 复制监视器中设置警告(警报和阈值)

  • 772

如何使用 TSQL 在 Replication Monitor 的这个屏幕上配置设置? 复制监视器 - 警告页面 作为参考,我们使用的是 SQL 2014。

sql-server replication
  • 1 1 个回答
  • 814 Views

1 个回答

  • Voted
  1. Best Answer
    John K. N.
    2017-08-15T22:46:50+08:002017-08-15T22:46:50+08:00

    有关以编程方式监视复制的详细信息,请访问官方 Microsoft Docs 站点:

    参考:以编程方式监视复制

    查询监控详情所需的所有存储过程都有详细信息:

    从分发服务器监视发布者、出版物和订阅

    • sp_replmonitorhelppublisher
    • sp_replmonitorhelppublication
    • sp_replmonitorhelpsubscription

    监视等待在订阅服务器上应用的事务命令

    • sp_replmonitorsubscriptionpendingcmd

    监视等待上传或下载的合并更改

    • 在发布者处:sp_showpendingchanges

      返回一个结果集,显示有关等待复制到订阅者的更改的信息

    • 在订阅服务器上:sp_showpendingchanges

      返回一个结果集,显示有关等待复制到发布者的更改的信息

    监视合并代理程序会话

    • sp_replmonitorhelpmergesession(在订户或分发服务器上)
    • sp_replmonitorhelpmergesessiondetail(在订户或分发服务器上)

    回答你的问题

    读取或更改监控阈值所需的存储过程是sp_replmontirohelppublicationthresholds和sp_replmonitorchangepublicationthreshold过程。

    查看发布的监控阈值指标

    • sp_replmonitorhelppublicationthresholds
    sp_replmonitorhelppublicationthresholds 
              [ @publisher = ] 'publisher'  
            , [ @publisher_db = ] 'publisher_db'  
            , [ @publication = ] 'publication'   
        [ , [ @publication_type = ] publication_type ]   
        [ , [ @thresholdmetricname = ] 'thresholdmetricname'  
    

    参数是:

    @publisher : the name of the publisher
    @publisher_db : the name of the published database
    @pbulication : the name of the publication
    @publication_type : 0 = transactional publication
    ................ 1 = snapshot publication
    ................ 2 = merge publication

    修改发布的监控阈值指标

    • sp_replmonitorchangepublicationthreshold
    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 : the name of the publisher
    @publisher_db : the name of the published database
    @pbulication : the name of the publication
    @publication_type : 0 = transactional publication
    ................ 1 = snapshot publication
    ................ 2 = merge publication
    @metric_id : 1 = expiration
    ................ 2 = latency
    ................ 4 = mergeexpiration
    ................ 5 = mergeslowrunduration
    ................ 6 = mergefastrunduration
    ................ 7 = mergefastrunspeed
    ................ 8 = mergeslowrunspeed
    @thresholdmetricname: the name of the publication threshold
    ................ (either this parameter or @metric_id is required)
    @value : the new metric value
    @shouldalert : generate alert (1=yes;0=no)
    @mode : monitoring mode (1=on;2=off)

    • 2

相关问题

  • 运行时间偏移延迟复制的最佳实践

  • 什么时候应该使用唯一约束而不是唯一索引?

  • 死锁的主要原因是什么,可以预防吗?

  • 如何确定是否需要或需要索引

  • PostgreSQL 9.0 Replication 和 Slony-I 有什么区别?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve