Redo is inconsistent with data block ORA-00600: internal error code, arguments: [3020]
Redo is inconsistent with data block {ORA-00600: internal error code, arguments: [3020]}
Is it a bug or a feture? That's the question!
In this article, we will show how to copy and restore datafiles from Primary to Standby Database on ASM using RMAN.
"Same,same, but different!" It is the same day as yesterday, but not exactly.
Today, when I logged in and start working, I got an alert for my standby database that Standby Database is not in sync with the Primary Database.
I logged and checked the configuration:
DGMGRL> show configuration; Configuration - orcldgconf Protection Mode: MaxPerformance Fast-Start Failover: DISABLED Configuration Status: DGMGRL> show database verbose 'orclsby'; Database - orclsby Role: PHYSICAL STANDBY Database Error(s): |
First thing that come to my mind was to start the apply.
Of course it didn't work and the below error showed again:
..... Mon Jan 08 10:13:35 2018 ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE Attempt to start background Managed Standby Recovery process (ORCLSBY_1) Mon Jan 08 10:13:35 2018 MRP0 started with pid=76, OS id=3131 MRP0: Background Managed Standby Recovery process started (ORCLSBY_1) Mon Jan 08 10:13:35 2018 RFS[20]: Selected log 6 for thread 1 sequence 124608 dbid -775285828 branch 947517497 Mon Jan 08 10:13:35 2018 Archived Log entry 221642 added for thread 1 sequence 124607 ID 0xd23a0099 dest 1: started logmerger process Mon Jan 08 10:13:40 2018 Managed Standby Recovery starting Real Time Apply Parallel Media Recovery started with 16 slaves Waiting for all non-current ORLs to be archived... All non-current ORLs have been archived. Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE Mon Jan 08 10:13:41 2018 Media Recovery Log +FRA1/orclsby/archivelog/2018_01_07/thread_2_seq_96516.13646.964814675 Media Recovery Log +FRA1/orclsby/archivelog/2018_01_07/thread_1_seq_124126.10737.964814603 Mon Jan 08 10:13:45 2018 RFS[2]: Selected log 8 for thread 2 sequence 96837 dbid -775285828 branch 947517497 Mon Jan 08 10:13:46 2018 Archived Log entry 221643 added for thread 2 sequence 96836 ID 0xd23a0099 dest 1: Mon Jan 08 10:13:53 2018 Errors in file /u01/app/oracle/diag/rdbms/orclsby/ORCLSBY_1/trace/ORCLSBY_1_pr0e_3200.trc: ORA-00339: archived log does not contain any redo ORA-00334: archived log: '+REDO1/orclsby/onlinelog/group_1.404.947512911' ORA-10567: Redo is inconsistent with data block (file# 28, block# 226858, file offset is 1858420736 bytes) ORA-10564: tablespace TEST ORA-01110: data file 28: '+DATA1/orclsby/datafile/test.817.947510801' ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 269069 ... Recovery is interrupted! |
In order to avoid recreating the standby database you can accomplish the following steps:
1. On primary database backup the datafile that is shown as inconsistent in the aler log of the standby database:
rman target / RMAN> run{ using target database control file instead of recovery catalog Starting backup at 08-JAN-18 released channel: d1 RMAN> |
2. Next step is to copy the backuped datafile to the standby database. I am copying it from ASM to another ASM with scp.
Btw, you must check that both ASM instances(source and destination) that are registered in the local listener.
In case of error, you should setup debug mode in order to find out the exact error.
You should trigger following export command { export DBI_TRACE=1 } in order to activate debug mode and then repeat the below steps again:
In most cases it is related to the sys password.
asmcmd cp --port 1542 sys/password@xxx.xx.xxx.xx.+ASM1:+FRA1/orclprd/datafile/test.7961.964865921 +FRA1/test copying xxx.xx.xxx.xx:+FRA1/orclprd/datafile/test.7961.964865921 -> +FRA1/test |
It is creating alias "test" in +FRA1 which is poinging to +FAR1/ASM/DATAFILE - location of the copied datafile
3. After it is copied, we have to catalog it:
RMAN> catalog start with '+FRA1/ASM/DATAFILE'; using target database control file instead of recovery catalog List of Files Unknown to the Database Do you really want to catalog the above files (enter YES or NO)? YES List of Cataloged Files RMAN> |
4. Restore the datafile on the standby database.
* Have in mind that if your standby database is opne read only, furst you have to shut it down, startup in mount state and then restore.
Keep in mind that in case of RAC Standby Database, you should modify database service from read only to mount in order to avoid automatic startup and avoid issues with the restore.
RMAN> restore datafile 149; Starting restore at 08-JAN-18 channel ORA_DISK_1: restoring datafile 00028 RMAN> |
5. Now start the apply:
DGMGRL> edit database 'orclsby' set state='apply-on'; |
In the alter log we can check that after restoring the datafile - all archivelogs applied and database is in sync.
Restore of datafile copy +FRA1/asm/datafile/test.20517.964865991 complete to datafile 28 +DATA1/orclsby/datafile/test.817.947510801 checkpoint is 12165580499351 Mon Jan 08 10:24:52 2018 ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE Attempt to start background Managed Standby Recovery process (ORCLSBY_1) Mon Jan 08 10:24:52 2018 MRP0 started with pid=81, OS id=14438 MRP0: Background Managed Standby Recovery process started (ORCLSBY_1)started logmerger process Mon Jan 08 10:24:57 2018 Managed Standby Recovery starting Real Time Apply Parallel Media Recovery started with 16 slaves Waiting for all non-current ORLs to be archived... All non-current ORLs have been archived. Mon Jan 08 10:24:58 2018 Media Recovery Log +FRA1/orclsby/archivelog/2018_01_07/thread_2_seq_96516.13646.964814675 Media Recovery Log +FRA1/orclsby/archivelog/2018_01_07/thread_1_seq_124126.10737.964814603 Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE Media Recovery Log +FRA1/orclsby/archivelog/2018_01_07/thread_1_seq_124127.18888.964814907 Media Recovery Log +FRA1/orclsby/archivelog/2018_01_07/thread_2_seq_96517.20417.964814851 Media Recovery Log +FRA1/orclsby/archivelog/2018_01_07/thread_2_seq_96518.4045.964815043 |
Check with the below SQL that all the archivelogs are applied:
SQL> select al.thread#, THREAD# Last Recd Last Applied SQL> / THREAD# Last Recd Last Applied |
Now ... checking againg the configuration:
DGMGRL> show configuration Configuration - orcldgconf Protection Mode: MaxPerformance Fast-Start Failover: DISABLED Configuration Status: DGMGRL> show database verbose 'orclsby'; Database - orclsby Role: PHYSICAL STANDBY |
One more thing that you should not forget is to modify again Oracle RAC database service from mount to read only startup, if you performed this change before restoring the datafiles.
#enjoy :)
1 comment
Comment from: kkovachki Member

Hello Polya,
Thanks a lot for your post, its very useful!!!!