Sunday, April 16, 2017

Manually registering archivelog on standby to resolve gaps


Messages in Enterprise Manager














---------------------------------------------------------------
Alter Log Messages

RFS[3261]: Assigned to RFS process 42312
RFS[3261]: Opened log for thread 3 sequence 32780 dbid 627728126 branch 937139200
Archived Log entry 11721 added for thread 3 sequence 32780 rlc 937139200 ID 0x8b96d1c dest 2:
RFS[3261]: Selected log 19 for thread 4 sequence 33159 dbid 627728126 branch 937139200
CORRUPTION DETECTED: In redo blocks starting at block 116738count 2048 for thread 4 sequence 33159
RFS[3261]: Possible network disconnect with primary database
Sun Apr 16 08:08:09 2017
Archived Log entry 11722 added for thread 1 sequence 42129 ID 0x8b96d1c dest 1:
Sun Apr 16 08:08:10 2017
Archived Log entry 11723 added for thread 3 sequence 32781 ID 0x8b96d1c dest 1:
Sun Apr 16 08:09:17 2017
RFS[3262]: Assigned to RFS process 42504
RFS[3262]: Selected log 19 for thread 4 sequence 33159 dbid 627728126 branch 937139200
CORRUPTION DETECTED: In redo blocks starting at block 116738count 2048 for thread 4 sequence 33159
RFS[3262]: Possible network disconnect with primary database
Sun Apr 16 08:09:27 2017

-----------------------------------------------------------------
To determine if there is an archive gap on your physical standby database

SQL> SELECT * FROM V$ARCHIVE_GAP; 
THREAD# LOW_SEQUENCE# HIGH_SEQUENCE# 
———– ————- ————– 
1 33122 33158


In this case, Standby database is waiting for archive log 33159

SQL> select process,sequence#,status from v$managed_standby;

PROCESS SEQUENCE# STATUS
——— ———- ————
ARCH    33157 CLOSING
ARCH    33158 CLOSING
MRP0    33159 WAIT_FOR_GAP
RFS     33162 IDLE


SQL> column dest format a20

DEST,ARCHIVED_THREAD#,ARCHIVED_SEQ#,APPLIED_THREAD#,APPLIED_SEQ#

------------------------------------------------------------
Connect to Any primary node as grid owner and copy gap archivelog from asm to file system

[oracle@srv005 ~]$ grid_env

[oracle@srv005 ~]$ asmcmd -p


ASMCMD [+DG_2/noorstby/archivelog/2017_04_15] > cp thread_4_seq_33159.5812.941356813 /tmp

copying +DG_2/noorstby/archivelog/2017_04_15/thread_4_seq_33159.5812.941356813 -> /tmp/thread_4_seq_33159.5812.941356813

-----------------------------------------------------------------------------------------------
Copy or move log file thread_4_seq_33159.5812.941356813 from primary to Standby

scp -r /tmp/thread_4_seq_33159.5812.941356813@myserver5:/tmp/ 

---------------------------------------------------------------
Register archivelog with database

SQL > ALTER DATABASE REGISTER LOGFILE '/home/oracle/thread_4_seq_33159.5812.941356813';

database altered

----------------------------------------------------------
Now check alert log on standby (Media Recovery Process(MRP) has been automatically started)


ALTER DATABASE REGISTER LOGFILE '/home/oracle/thread_4_seq_33159.5812.941356813'
There are 1 logfiles specified.
ALTER DATABASE REGISTER [PHYSICAL] LOGFILE
Completed: ALTER DATABASE REGISTER LOGFILE '/home/oracle/thread_4_seq_33159.5812.941356813'
Sun Apr 16 08:09:36 2017
Media Recovery Log /home/oracle/thread_4_seq_33159.5812.941356813
Media Recovery Log +DG_FC2/mydb/archivelog/2017_04_15/thread_1_seq_41736.6722.941356495
Media Recovery Log +DG_FC2/mydb/archivelog/2017_04_15/thread_2_seq_23800.6566.941356965
Media Recovery Log +DG_FC2/mydb/archivelog/2017_04_15/thread_3_seq_32392.6648.941356965
Media Recovery Log +DG_FC2/mydb/archivelog/2017_04_15/thread_1_seq_41737.6487.941357231
Media Recovery Log +DG_FC2/mydb/archivelog/2017_04_15/thread_4_seq_33160.6420.941357585
Media Recovery Log +DG_FC2/mydb/archivelog/2017_04_15/thread_4_seq_33161.6424.941357585
Media Recovery Log +DG_FC2/mydb/archivelog/2017_04_15/thread_3_seq_32393.6450.941357385
Media Recovery Log +DG_FC2/mydb/archivelog/2017_04_15/thread_2_seq_23801.6448.941357445


If file is already use below query to replace it.

alter database register or replace logfile '/home/oracle/thread_1_seq_49042.40571.943090555';




No comments:

Post a Comment