
添加了用于使用SQL代理作业填充表的表定义和查询。
create table latency_log(
[log_date] [datetime2](0) NOT NULL,
[replica_id] [uniqueidentifier] NULL,
[log_send_queue_size] [bigint] NULL,
[log_send_rate] [bigint] NULL,
[redo_queue_size] [bigint] NULL,
[redo_rate] [bigint] NULL
)
insert into latency_log
select
GETUTCDATE() as log_date,
ar.replica_id,
hdrs.log_send_queue_size,
hdrs.log_send_rate,
hdrs.redo_queue_size,
hdrs.redo_rate
from sys.dm_hadr_database_replica_states hdrs
join sys.availability_replicas ar on hdrs.replica_id = ar.replica_id监视日志记录的条件:
declare @since datetime2 = dateadd(MINUTE,-15,getutcdate())
if exists (
select top 1 1
from latency_log
where log_date > @since
)
select 'No alert'
else
select 'Alert'我没有发现SQL作业历史中缺少任何运行。
发布于 2021-11-09 19:00:45
我相信保罗·兰德尔的这篇文章解释了你所看到的问题:
在DST结束时,当时钟返回一个小时(在美国总是在02:00 )时,SQL Agent基本上会暂停一个小时(至少在Server 2000之后),这不是常识。
它表明,如果你检查工作记录,你将看到一个小时的差距,当时钟倒转。
https://dba.stackexchange.com/questions/302334
复制相似问题