监控dg延时多少秒

100阅读 0评论2021-07-20 brjl
分类:Oracle


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

  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;

上一篇:不老认识的dbtimezone
下一篇:效率工具,rhel7 生成emcpower udev定义