For what ever reason, if error ORA-16724 raised while you try to have oracle standby database to catch up the redo log received from primary database, you might need to use incremental backup to achieve your goal. It’s for sure you could simply drop standby database or and create a new one. But, that’s not always a feasible way.
Over the past weekend, I experienced such error while I was working on moving database to different Unix system. It’s very good to me to come across the good posting regarding to this topic. That’s “Resolving Gaps in Data Guard Apply Using Incremental RMAN Backup” by author Arup Nanda.
One thing I realized is that it’s better to pick earlier SCN number from which to create incremental backup. For example, if current SCN on standby is 1301571, it’s no harm to do incremental backup starting from SCN 1300000. The reason I’m doing this is because the log file for SCN 1301571 on standby site is probably corrupted and starting from earlier SCN could re-generate redo log file for SCN 1301571.
This posting provided step-by-step approach to solve this issue. The only step I added is
SQL Stby> alter database recover managed standby database cancel;
The reason I’m doing for is because I experienced error message below when I tried to recover database via RMAN by using incremental backup files generated from primary database.
RMAN> recover database; Starting recover at 26-JAN-15 using channel ORA_DISK_1 using channel ORA_DISK_2 channel ORA_DISK_1: starting incremental datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set destination for restore of datafile 00003: /dbfiles/STBY/undotbs.dbf destination for restore of datafile 00008: /dbfiles/STBY/development1.dbf destination for restore of datafile 00009: /dbfiles/STBY/indexes.dbf channel ORA_DISK_1: reading from backup piece /dbbackup/incre_back/5tptmjaj_1_1.rmb channel ORA_DISK_2: starting incremental datafile backup set restore channel ORA_DISK_2: specifying datafile(s) to restore from backup set destination for restore of datafile 00001: /dbfiles/STBY/system.dbf channel ORA_DISK_2: reading from backup piece /dbbackup/incre_back/5uptmji8_1_1.rmb RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 01/26/2015 13:43:05 ORA-19870: error while restoring backup piece /dbbackup/incre_back/5tptmjaj_1_1.rmb ORA-19573: cannot obtain exclusive enqueue for datafile 8
As standby database is going to apply redo log files received from primary database once it’s mounted, the datafiles are consequently locked. Issuing command above will stop the redo log apply and release lock on the the datafile.
Once I followed the steps in Arup’s posting, the ORA-16724 was solved and the standby database could be able to apply the redo log.
Furthermore, I got one warning message from data guard manager, saying “ORA-16826: apply service state is inconsistent with the DelayMins property”. To solve this, I just simply follow the posting authored by Navneet Upneja. The workaround is quite straightforward.
SQL Stby> alter database recover managed standby database cancel; Database altered. SQL Stby> alter database recover managed standby database using current logfile disconnect; Database altered.
The logic is to stop redo log apply first and then start redo log apply in real time mode.