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!

Quering Archive Log Gap from Primary Database

Deepak PushkarnaSep 1 2016 — edited Sep 2 2016

Hi Folks,

I am working on Oracle 12.0.2.1 Data Guard (Both Primary and Physical Standby are 2-Node RAC)

Can anyone please guide me how can I query the archive log gap from Primary Database.

I am trying following command, but Its not picking the correct information.

select thread#, applied,max(sequence#) from gv$archived_log group by thread#,applied;

Although, I have the query which shows the exact gap when I connect to standby server.

SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE#-APPL.SEQUENCE#) "Difference"

FROM

    (SELECT THREAD# ,SEQUENCE# FROM GV$ARCHIVED_LOG

        WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME)

                                            FROM GV$ARCHIVED_LOG

                                            GROUP BY THREAD#

                                        )

    ) ARCH,

    (SELECT THREAD# ,SEQUENCE#

        FROM GV$LOG_HISTORY

        WHERE (THREAD#,FIRST_TIME)

              IN (SELECT THREAD#,MAX(FIRST_TIME) FROM GV$LOG_HISTORY GROUP BY THREAD#)

    ) APPL

    WHERE ARCH.THREAD#=APPL.THREAD# ORDER BY 1;

Please guide me.

Thanks

Deep

This post has been answered by Igor Laguardia-Oracle on Sep 1 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2016
Added on Sep 1 2016
4 comments
7,060 views