Show standby lag time
We are currently using Oracle 9.2.0.7 on RedHat Linux 4. We have one priamry and 3 physical standby databases in our configuration
Does anyone have a query or script to monitor (from the primary server) how far behind is a partiular standby database. the best query that I can come up with is (this shows the lag in minutes for the standby database with dest_id 4)
with a as ( select max( completion_time) ct from v$archived_log
where dest_id = 4 and applied='YES'
),
b as ( select max(completion_time) ctt from v$archived_log
where dest_id = 1
)
select round((b.ctt - a.ct) * 24 * 60) from a,b