Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to confirm if all the archives logs are applied on standby database

2842971Sep 14 2017 — edited Sep 19 2017

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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2017
Added on Sep 14 2017
6 comments
20,361 views