Set up script to check standby database is in sync with production on cloud control 12C
Posted on 2016-09-26
Hi there all,
I am trying to set up a script to check if standby database is in sync with production by comparing time interval on cloud control 12C. i.e if there is a gap in the logs not applied for >= 1 hour it should issue an alert.
I have set up the below script as a Metric Extension in Cloud control on Production database. For 10 archive logs gap - threshold is set for warning. For 25 archive logs gap, it is critical.
However I wanted to convert it to "time" interval instead of # of archive logs. i.e for 1 hour gap it should show an alert.
Could you tell how below script to time interval..?
select sum(local.sequence#-target.sequence#) Total_gap
(select thread#,max(sequence#) sequence# from gv$archived_log where
dest_id=(select dest_id from v$archive_dest where TARGET='STANDBY'
and applied='YES' group by thread#) target,
(select thread#,max(sequence#) sequence# from gv$log group by thread#) local