3 queries need to be run regularly to monitor the standby setup. They can be registered to Oracle Enterprise Manger or other DBA monitoring software to do automatic monitoring.

 

1 primary agent:

 

select (sysdate-to_date(value,'yyyy/mm/dd hh24:mi:ss'))*24*60

from meien_<standbyname>

where key='primary_last_heartbeat'

 

This query returns minutes since primary agent updated heartbeat last time. Since primary agent updates heartbeat every second, 5 minutes should be long enough to indicate primary agent is down.

 

2 standby agent

 

select (sysdate-to_date(value,'yyyy/mm/dd hh24:mi:ss'))*24*60

from meien_<standbyname>

where key='standby_last_heartbeat'

 

This query returns minutes since standby agent updated heartbeat last time. When applying archive, standby agent will not update heartbeat, so a typical time standby agent need to apply archive need to be find out on real system, and threshold value need to be set accordingly.

 

3 primary/standby log gap

 

select (to_number(p.value)-to_number(s.value))

from meien_<standbyname> p, meien_<standbyname> s

where p.key='primary_last_seq' and s.key='standby_last_seq'

 

Depends on delay on standby agent, and logswitch frequency on primary database, a proper gap threshold need to be determined from real system. Large gap indicate a possible problem applying archive at standby site.