Hi All
we are having one physical standby database(DSNA) which we are using it for reporting for a primary(DBGC) . We have a business requirement that we don't open the standby for sync during the business hours. It will be synced during the night, during this window heavy batch activity is happening on primary , at one point when we finish the batch we need to open the standby in read only , before the next batch starts on the primary .
Currently we are having issue mismatch on the record count on the physical standby and primary . when I sync it second time or third time , the record count matches
I want to make sure all the archives are successfully applied before the opening the standby in read only mode. I'm using the following script to verify the gap (running this on primary) . If the count is less than or equal to zero , my script will open the standby in read only mode . Kindly correct me if I'm wrong.
Db version is 12.1.0.2
Platform :RHEL 7
cluster RAC
select
inst_applied.sequence#, inst_applied.applied
from
(SELECT * FROM gv$archived_log a where a.dest_id=1) inst_created,
(SELECT * FROM gv$archived_log a where a.dest_id=2) inst_applied
where inst_created.inst_id=inst_applied.inst_id and
inst_created.thread#=inst_applied.thread# and
inst_created.sequence#=inst_applied.sequence#
and inst_applied.applied='NO'
group by inst_applied.sequence#, inst_applied.applied
order by 1,2
Thanks in advance.
Sri