Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3672574
  • 博文数量: 715
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(715)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

分类: Oracle

2021-07-20 11:03:42


看看延时超过几秒钟(更精细)

  1. --如果超过120秒则告警
  2. select *
  3.   from (select sysdate,
  4.                sum(apply_finish) apply_finish,
  5.                sum(apply_lag) apply_lag,
  6.                sum(transport_lag) transport_lag,
  7.                sum(startup_time) startup_time,
  8.                min(TIME_COMPUTED) TIME_COMPUTED
  9.           from (select decode(name,
  10.                               'apply finish time',
  11.                               to_number(substr(value, 2, 2)) * 86400 +
  12.                               to_number(substr(value, 5, 2)) * 3600 +
  13.                               to_number(substr(value, 8, 2)) * 60 +
  14.                               to_number(substr(value, 11, 2)),
  15.                               0) apply_finish,
  16.                        decode(name,
  17.                               'apply lag',
  18.                               to_number(substr(value, 2, 2)) * 86400 +
  19.                               to_number(substr(value, 5, 2)) * 3600 +
  20.                               to_number(substr(value, 8, 2)) * 60 +
  21.                               to_number(substr(value, 11, 2)),
  22.                               0) apply_lag,
  23.                        decode(name,
  24.                               'transport lag',
  25.                               to_number(substr(value, 2, 2)) * 86400 +
  26.                               to_number(substr(value, 5, 2)) * 3600 +
  27.                               to_number(substr(value, 8, 2)) * 60 +
  28.                               to_number(substr(value, 11, 2)),
  29.                               0) transport_lag,
  30.                        decode(name, 'estimated startup time', value, 0) startup_time,
  31.                        TIME_COMPUTED
  32.                   from v$dataguard_stats
  33.                  where name in ('apply finish time',
  34.                                 'apply lag',
  35.                                 'estimated startup time',
  36.                                 'transport lag')))
  37.  where apply_lag > 120;

阅读(1741) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~