The archive log after oracle11gw.uardfailover reconstruction is not NO longer applied.
1. the archive records of the master database are inconsistent, as shown below:
After failover, the bad old master database becomes a new slave database, but the archive log records of the new slave database are inconsistent, that is, the archive log list; and v $ archived_log cannot match the number, as shown below:
1.1 master database:
SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 8Next log sequence to archive 10Current log sequence 10SQL>
SQL> select sequence#,applied from v$archived_log order by sequence# asc;......---------- --------- 7527 YES 7527 YES 7528 YES 7528 YES 7529 YES 7530 YES 7531 YES 7532 YES 7533 YES14529 rows selected.
You can see that archive of archive log list and v $ archived_log in the master database is inconsistent.
1.2 slave database:SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 10Next log sequence to archive 0Current log sequence 10SQL>
SQL> select sequence#,applied from v$archived_log order by sequence# asc; SEQUENCE# APPLIED---------- --------- 9 IN-MEMORYSQL>
The archive of the slave database has never been applied, and the difference between the two is also checked. One is 10 and the other is 9.
PS: the archive numbers of the master database and slave database are not consistent.
2. Clear the archive records of the new master databaseThe cause is whether the archive log records of the old master database are retained on the new master database. You need to manually clear the logs and execute the cleanup record on the new master database:
SQL> execute sys.dbms_backup_restore.resetCfileSection(11);PL/SQL procedure successfully completed.SQL> SQL> SQL> select sequence#,applied from v$archived_log order by sequence# asc;no rows selectedSQL>
To archive the log directory and manually delete the old archive log
[oracle@oracle_standby1 archivelog]$ rm -rf 2015_12_13/ 2015_12_19 2015_12_20 2015_12_21 2015_12_22 2015_12_23 2015_12_24 2015_12_25[oracle@oracle_standby1 archivelog]$
Then run rman.
RMAN> catalog db_recovery_file_dest;RMAN> catalog db_recovery_file_dest;using target database control file instead of recovery catalogsearching for all files in the recovery areaList of Files Unknown to the Database=====================================File Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_9_c7c1v5qw_.logFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_7_c7c1ttf1_.logFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_8_c7dst287_.logFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_7_c7dssvfd_.logFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_9_c7dst8wr_.logFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_8_c7c1v0ff_.logFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/archivelog/2015_12_26/o1_mf_1_9_c7wqvrp9_.arcDo you really want to catalog the above files (enter YES or NO)? YEScataloging files...cataloging doneList of Cataloged Files=======================File Name: /oracle/app/oracle/flash_recovery_area/STANDBY/archivelog/2015_12_26/o1_mf_1_9_c7wqvrp9_.arcList of Files Which Where Not Cataloged=======================================File Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_9_c7c1v5qw_.log RMAN-07529: Reason: catalog is not supported for this file typeFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_7_c7c1ttf1_.log RMAN-07529: Reason: catalog is not supported for this file typeFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_8_c7dst287_.log RMAN-07529: Reason: catalog is not supported for this file typeFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_7_c7dssvfd_.log RMAN-07529: Reason: catalog is not supported for this file typeFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_9_c7dst8wr_.log RMAN-07529: Reason: catalog is not supported for this file typeFile Name: /oracle/app/oracle/flash_recovery_area/STANDBY/onlinelog/o1_mf_8_c7c1v0ff_.log RMAN-07529: Reason: catalog is not supported for this file typeRMAN> exit
Then go to the SQL command to view:
SQL> select sequence#,applied from v$archived_log order by sequence# asc; SEQUENCE# APPLIED---------- --------- 9 NOSQL>
3. switch to test the log.Master database:
SQL> alter system switch logfile;System altered.SQL> select sequence#,applied from v$archived_log order by sequence# asc; SEQUENCE# APPLIED---------- --------- 9 NO 10 NO 10 NOSQL>
Slave database:
SQL> select sequence#,applied from v$archived_log order by sequence# asc; SEQUENCE# APPLIED---------- --------- 9 YES 10 YESSQL>
The archived logs and applications on both sides are consistent.