Friday, November 27, 2015

Fix ORA-16072

Today after restore and recovery prod database on test environment I faced with strange error:

ORA-16072: a minimum of one standby database destination is required.

My database environment :

 OS: OEL 6.5  
 DB: 11.2.0.4  

After recovery database stays on MOUNT mode and could not open it.

RMAN-00571: ===========================================================  
 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============  
 RMAN-00571: ===========================================================  
 RMAN-03002: failure of recover command at 11/27/2015 12:55:01  
 RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 9573 and starting SCN of 556583605 

RMAN> alter database open resetlogs;  
 RMAN-00571: ===========================================================  
 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============  
 RMAN-00571: ===========================================================  
 RMAN-03002: failure of alter db command at 11/27/2015 12:56:08  
 ORA-03113: end-of-file on communication channel  
 Process ID: 12064  
 Session ID: 958 Serial number: 11  
 RMAN-00571: ===========================================================  
 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============  
 RMAN-00571: ===========================================================  
 ORA-03114: not connected to ORACLE  
 RMAN-00571: ===========================================================  
 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============  
 RMAN-00571: ===========================================================  
 RMAN-03002: failure of alter db command at 11/27/2015 12:56:08  
 ORA-03113: end-of-file on communication channel  
 Process ID: 12064  
 Session ID: 958 Serial number: 11  
 [oracle@TESTDB dbs]$  


Checking alertlog:
LGWR: STARTING ARCH PROCESSES  
 Fri Nov 27 14:44:35 2015  
 ARC0 started with pid=22, OS id=23775   
 ARC0: Archival started  
 LGWR: STARTING ARCH PROCESSES COMPLETE  
 ARC0: STARTING ARCH PROCESSES  
 LGWR: Primary database is in MAXIMUM AVAILABILITY mode  
 LGWR: Destination LOG_ARCHIVE_DEST_1 is not serviced by LGWR  
 LGWR: Minimum of 1 LGWR standby database required  
 Errors in file /u01/oracle/diag/rdbms/prod/XXXX/trace/XXXX_lgwr_23742.trc:  
 ORA-16072: a minimum of one standby database destination is required 


I turned off archivelog mode on my test database and tried to open. It opened successfully. But I need my test database have to be on archivelog mode.

To handle it I checked and corrected some parameters:

SQL> select open_mode, log_mode from v$database;  
 OPEN_MODE   LOG_MODE  
 -------------------- ------------  
 READ WRITE   NOARCHIVELOG  



SQL> set linesize 100  
 SQL> show parameter fal_  
 NAME     TYPE     VALUE  
 ------------------------------------ -------------------------------- ------------------------------  
 fal_client    string     XXXX  
 fal_server    string     XXXX_SB  
 SQL> alter system set fal_client='' scope=spfile;  
 System altered.  
 SQL> alter system set fal_server='' scope=spfile;  
 System altered.  
 SQL> alter system set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST';  
 System altered  
 SQL> select open_mode, DATABASE_ROLE, guard_status, SWITCHOVER_STATUS from v$database;  
 OPEN_MODE   DATABASE_ROLE  GUARD_S SWITCHOVER_STATUS  
 -------------------- ---------------- ------- --------------------  
 MOUNTED    PRIMARY    NONE  NOT ALLOWED  
 Database altered.  


Restart database

 SQL> shut immediate  
 ORA-01109: database not open  
 Database dismounted.  
 ORACLE instance shut down.  
 SQL> startup mount  
 ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance  
 ORACLE instance started.  
 Total System Global Area 8584982528 bytes  
 Fixed Size   2260128 bytes  
 Variable Size  6341788512 bytes  
 Database Buffers 2214592512 bytes  
 Redo Buffers   26341376 bytes  
 Database mounted.  
 SQL> alter database open;  
 Database altered.  

Perfect

SQL> select name, open_mode from v$database;  
 NAME OPEN_MODE  
 ---------  ------------------------  
 XXXX  READ WRITE  
 SQL>  



But in alertlog still error

 Errors in file /u01/oracle/diag/rdbms/prod/XXXX/trace/XXXX_arct_24125.trc:  
 ORA-00313: open failed for members of log group 7 of thread 0  
 ORA-00312: online log 7 thread 0: '/u01/oracle/fast_recovery_area/XXXX/onlinelog/o1_mf_7_c4vcl2pw_.log' 


There standby redo logs. Let`s drop it

 SQL> select group#, bytes from v$standby_log;  
   GROUP# BYTES  
 ---------- ----------  
  4 314572800  
  5 314572800  
  6 314572800  
  7 314572800  
 SQL> set linesize 150  
 SQL> col member for a80  
 SQL> select group#, member from v$logfile;  
   GROUP# MEMBER  
 ---------- --------------------------------------------------------------------------------  
  1 /u01/oracle/oradata/XXX/redo01.log  
  2 /u01/oracle/oradata/XXX/redo02.log  
  3 /u01/oracle/oradata/XXX/redo03.log  
  4 /u01/oracle/fast_recovery_area/XXX/onlinelog/o1_mf_4_c5jf59f8_.log  
  5 /u01/oracle/fast_recovery_area/XXX/onlinelog/o1_mf_5_c5jf5df9_.log  
  6 /u01/oracle/fast_recovery_area/XXX/onlinelog/o1_mf_6_c5jf5hfv_.log  
  7 /u01/oracle/fast_recovery_area/XXX/onlinelog/o1_mf_7_c5jf5lw1_.log  
 7 rows selected.  


[oracle@TESTDB onlinelog]$ pwd
/u01/oracle/fast_recovery_area/XXXX/onlinelog

[oracle@TESTDB onlinelog]$ ls -lrt  
 total 1228820  
 -rw-r-----. 1 oracle oinstall 314573312 Nov 27 14:47 o1_mf_4_c5jf59f8_.log  
 -rw-r-----. 1 oracle oinstall 314573312 Nov 27 14:47 o1_mf_5_c5jf5df9_.log  
 -rw-r-----. 1 oracle oinstall 314573312 Nov 27 14:47 o1_mf_6_c5jf5hfv_.log  
 -rw-r-----. 1 oracle oinstall 314573312 Nov 27 14:47 o1_mf_7_c5jf5lw1_.log



 SQL> select status, group#, bytes from v$standby_log;  
 STATUS    GROUP#  BYTES  
 ---------- ---------- ----------  
 UNASSIGNED   4 314572800  
 UNASSIGNED   5 314572800  
 UNASSIGNED   6 314572800  
 UNASSIGNED   7 314572800  
 SQL> alter database drop standby logfile group 4;  
 Database altered.  
 SQL> alter database drop standby logfile group 5;  
 Database altered.  
 SQL> alter database drop standby logfile group 6;  
 Database altered.  
 SQL> alter database drop standby logfile group 7;  
 Database altered.  

After restart db check alertlog

SQL> shut immediate  
 Database closed.  
 Database dismounted.  
 ORACLE instance shut down.  
 SQL> startup  
 ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance  
 ORACLE instance started.  
 Total System Global Area 8584982528 bytes  
 Fixed Size   2260128 bytes  
 Variable Size  6341788512 bytes  
 Database Buffers 2214592512 bytes  
 Redo Buffers   26341376 bytes  
 Database mounted.  
 Database opened.  
 SQL>   

Alertlog is clear
Fri Nov 27 15:15:42 2015  
 ALTER DATABASE OPEN  
 LGWR: STARTING ARCH PROCESSES  
 Fri Nov 27 15:15:42 2015  

No comments:

Post a Comment