How to find the gap of log sequence applied in Primary and Standby instance?

1.2k views Asked by At

How to find log apply gap from the primary database which has more than one standby instance on a RAC environment? Right now I am using the below query but it gives me incorrect results.

select sequenceInPrimary, sequenceSynchedInStandBy, sequenceInPrimary-sequenceSynchedInStandBy as logApplyGap from (select max(sequence#) sequenceInPrimary from v$archived_log) ,(select max(sequence#) sequenceSynchedInStandBy from v$archived_log where applied='YES')

2

There are 2 answers

3
scott yu On

I run this query to my dataguard(19c), the results correct. select sequenceInPrimary, sequenceSynchedInStandBy, sequenceInPrimary-sequenceSynchedInStandBy as logApplyGap from (select max(sequence#) sequenceInPrimary from v$archived_log) ,(select max(sequence#) sequenceSynchedInStandBy from v$archived_log where applied='YES')

399 398 1

1
Chikajah On

Try this query:

select STATUS, GAP_STATUS,dest_id from V$ARCHIVE_DEST_STATUS order by dest_id;