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')
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