Thursday, January 16, 2020

Archive lag and when archives are present in Backup of Primary system.

Archive lag and when archives are present in Backup of Primary system.

1) Standby showing below archive gap:
=================================

SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

    Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
         1                    132                   118         14
         1                    132                   119         13



2) Alert log of Standby reported below error:
=========================================
Fetching gap sequence in thread 1, gap sequence 120-129
Completed: alter database recover managed standby database disconnect from session
Wed Jan 15 21:40:07 2019
FAL[client]: Failed to request gap sequence
 GAP - thread 1 sequence 120-129
 DBID 4134858347 branch 1023738414
FAL[client]: All defined FAL servers have been attempted.

3) Using RMAN recovered mentioned archives ( 120-129 as mentioned step 2 ) , thankfully archives were there in backup
=====================================
rman target /
restore archivelog from logseq 120 until logseq 129;

4) We have to boune MRP and then it started picking archive logs.
=====================================
Stop MRP:

alter database recover managed standby database cancel;

Start MRP:

alter database recover managed standby database disconnect from session;


5) Archive logs are in sync after that:
=====================================

SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

    Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
         1                    148                   148          0


Thanks,
SM

1 comment:

  1. Casino Finder (NJ) - Mapyro
    Find 군산 출장마사지 Casinos Near Me near you on 거제 출장샵 Mapyro. 포항 출장마사지 Get directions, reviews and information for Casinos Near 용인 출장안마 Me in New 강릉 출장마사지 Jersey.

    ReplyDelete