Replication 自动创建来一个 Job:Replication monitoring refresher for distribution,这个Agent执行一个sp: dbo.sp_replmonitorrefreshjob ,在该SP中存在一个Loop,如下

  1. create procedure sys.sp_replmonitorrefreshjob
  2. (
  3. @iterations tinyint = 0 -- 0 - run continuously, non 0 - run for specified iterations
  4. ,@profile bit = 0 -- for internal use - DO NOT DOCUMENT (remove this before release)
  5. )
  6. .....
  7. while (1=1)
  8. begin
  9. --other commands--
  10. --
  11. -- wait for given delay
  12. --
  13. if (@profile = 1)
  14. raiserror('Waitfor delay %s', 10, 1, @strdelaytime)
  15. waitfor delay @strdelaytime
  16. end -- while (1=1)

为了有效监控Replication的运行,SQL Server Replication将性能数据缓存起来,周期性的刷新缓存。数据缓存能够减少查询,并且能够供多个User同时查询Replication的性能数据。dbo.sp_replmonitorrefreshjob  用于刷新缓存数据,刷新的周期(@strdelaytime)为4s 或 30s。

Microsoft SQL Server Replication Monitor is designed to efficiently monitor a large number of computers in a production system.The queries that Replication Monitor uses to perform calculations and gather data are cached and refreshed on a periodic basis. Caching reduces the number of queries and calculations required as you view different pages in Replication Monitor and allows monitoring to scale well for multiple users.

Cache refresh is handled by a SQL Server Agent job, the Replication monitoring refresher for distribution. The job runs continuously, but the cache refresh schedule is based on waiting a certain amount time after the previous refresh:

  • If there were agent history changes since the cache was last created, the wait time is the minimum of: 4 seconds; or the amount of time taken to create the previous cache.
  • If there were no agent history changes since the cache was last created (there could have been other changes), the wait time is the maximum of: 30 seconds; or the amount of time taken to create the previous cache.

参考doc:

Caching, Refresh, and Replication Monitor Performance

Replication:distribution 中一直在运行 waitfor delay @strdelaytime 语句的更多相关文章

  1. distribution 中一直在运行 waitfor delay @strdelaytime 语句

    Replication 自动创建来一个 Job:Replication monitoring refresher for distribution,这个Agent执行一个sp: dbo.sp_repl ...

  2. jmeter中一次运行多条sql语句

    操作比较简单,主要就分两步: 第一步:在JDBC Connection Configuration中设置,主要见下图标注部分增加:?allowMultiQueries=true 第二步:在JDBC R ...

  3. 执行Sqlserver中waitfor delay延时操作或waitfor time定时操作

    private static string connectionString = RBAC.Dal.DataRootBase.ConnectionString; private SqlConnecti ...

  4. SQL两个事务update同一张表出现的死锁问题(waitfor delay)

    抄录网址:https://blog.csdn.net/qiumuxia0921/article/details/50574879 下面是我们的建表语句: SET ANSI_NULLS ON GO SE ...

  5. SQL Server的WAITFOR DELAY注入

    SQL Server的WAITFOR DELAY注入   WAITFOR是SQL Server中Transact-SQL提供的一个流程控制语句.它的作用就是等待特定时间,然后继续执行后续的语句.它包含 ...

  6. Chrome扩展开发之二——Chrome扩展中脚本的运行机制和通信方式

    目录: 0.Chrome扩展开发(Gmail附件管理助手)系列之〇——概述 1.Chrome扩展开发之一——Chrome扩展的文件结构 2.Chrome扩展开发之二——Chrome扩展中脚本的运行机制 ...

  7. Windows 8 IIS中配置PHP运行环境的方法

    在Windows 8 的IIS(8.0)中搭建PHP运行环境: 一:安装IIS服务器 1.进入控制面板>>程序和功能>>打开或关闭Windows 功能,找到Internet信息 ...

  8. INNO setup安装卸载钱判断进程中是否在运行总结

    1.安装前判断进程中是否有程序在运行. [files] ; 安装前判断进程,dll文件放在inno的安装目录中Source: compiler:psvince.dll; Flags: dontcopy ...

  9. 工作的思考十七:工作中容易犯的错误 - Delay

    其实IT是一个很严谨的行业,不管是从代码角度还是从日常的工作分配都是按计划来的. 从今年年初到现在,在我的工作中出现了两次“Delay”,第一次不以为然,虽然上司也找过我谈话,但没意识到问题的严重性. ...

随机推荐

  1. sql的日期格式化转化

    1. DATE_FORMAT() 函数用于以不同的格式显示日期/时间数据. DATE_FORMAT(date,format) 可以使用的格式有: 格式 描述 %a 缩写星期名 %b 缩写月名 %c 月 ...

  2. 分布式session的解决方案

    1.Nginx的ip_hash,对应tomcat的session,由tomcat保存 缺点:一旦tomcat单点挂机,session消失 2.session在tomcat之间复制, 缺点:保存全局se ...

  3. Python之路(第四十七篇) 协程:greenlet模块\gevent模块\asyncio模块

    一.协程介绍 协程:是单线程下的并发,又称微线程,纤程.英文名Coroutine.一句话说明什么是线程:协程是一种用户态的轻量级线程,即协程是由用户程序自己控制调度的. 协程相比于线程,最大的区别在于 ...

  4. Oracle 11.2.0.4单实例打补丁

    Oracle 11.2.0.4单实例打PSU,OJVM PSU补丁快速参考 写在前面: ·         1.Oracel打每个补丁的操作有时存在差异,所以不管多熟悉,都应该在打任何补丁之前阅读新补 ...

  5. 关于ORACLE图形化安装过程中出现的竖线的处理办法

    这种情况上传个jre 并指定下就好了 ~/database/runInstaller -jreLoc /usr/local/jre1.8.0_191/

  6. 【学习笔记】大数据技术原理与应用(MOOC视频、厦门大学林子雨)

    1 大数据概述 大数据特性:4v volume velocity variety value 即大量化.快速化.多样化.价值密度低 数据量大:大数据摩尔定律 快速化:从数据的生成到消耗,时间窗口小,可 ...

  7. springboot工程启动即执行一段代码

    最近在做一个项目, 需要Tomcat启动后就执行一段代码 在这里需要用到CommandLineRunner这个接口, Spring boot的CommandLineRunner接口主要用于实现在应用初 ...

  8. guava布隆过滤器

    pom引入依赖 <dependency> <groupId>com.google.guava</groupId> <artifactId>guava&l ...

  9. IDEA+SpringBoot项目启动参数设置

    SpringBoot属性加载顺序 顺序 形式 1 在命令行中传入的参数 2 SPRING_APPLICATION_JSON中的属性.SPRING_APPLICATION_JSON是以JSON的格式配置 ...

  10. 【reactNative 大杂烩 好文章汇总 】

    1. React Native之打包 https://blog.csdn.net/xiangzhihong8/article/details/70162784