ORA-00265: instance recovery required, cannot set ARCHIVELOG mode, restorearchivelog
Symptom:
I reported an error ORA-00265 after executing the open archive command
SQL> alter database archivelog; alter database archivelog * ERROR at line 1: ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
Problem Analysis:
From the above error, we can see that archive cannot be enabled because the SCN numbers in datafile, controlfile, and redolog are inconsistent, the cause of this problem is that I used startup force mount when I restarted the database to mount; because this command actually performed two steps:
1. shutdown abort --- force shut down the database
2. startup mount
Since we implicitly perform the shutdown abort operation, it means that the SCN numbers in datafile, controlfile, and redolog are definitely inconsistent. We need to perform recover during the open Database process, because their SCN numbers are inconsistent, archivelog cannot be enabled in the mount state, as shown below:
SQL> startup mount force; ORACLE instance started. Total System Global Area 2505338880 bytes Fixed Size 2255832 bytes Variable Size 620758056 bytes Database Buffers 1862270976 bytes Redo Buffers 20054016 bytes Database mounted. SQL> alter database archivelog; alter database archivelog * ERROR at line 1: ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
Solution:
To solve this problem, the simplest solution is to open the database and perform the recover operation. After the operation is completed, perform shutdown immediate and start statup mount to enable archiving, for details, see:
SQL> alter database open; Database altered. #### recover log information: alter database open Beginning crash recovery of 1 threads parallel recovery started with 3 processes Started redo scan Completed redo scan read 1522 KB redo, 175 data blocks need recovery Started redo application at Thread 1: logseq 7, block 10941 Recovery of Online Redo Log: Thread 1 Group 1 Seq 7 Reading mem 0 Mem #0: /DBData/woo2/redo01.log Completed redo application of 0.44 MB Completed crash recovery at Thread 1: logseq 7, block 13985, scn 991198 175 data blocks read, 175 data blocks written, 1522 redo k-bytes read Wed Sep 03 22:39:35 2014 Thread 1 advanced to log sequence 8 (thread open) Thread 1 opened at log sequence 8 Current log #2 seq #8 mem #0: /DBData/woo2/redo02.log Successful open of redo thread 1 MTTR advisory is disabled because provided is not set Wed Sep 03 22:39:35 2014 SMON: enabling cache recovery [13499] deleonlined Undo Tablespace 2. undo initialization finished serial: 0 start: 3565124 end: 3565194 diff: 70 (0 seconds) Verifying file header compatibility for 11g tablespace encryption .. verifying 11g file header compatibility for tablespace encryption completed SMON: enabling tx recovery Database Characterset is AL32UTF8 No Resource Manager plan active replication_dependency_tracking turned off (no async multimaster replication found) starting background process QMNC Wed Sep 03 22:39:36 2014 QMNC started with pid = 23, OS id = 16119 Completed: alter database open Wed Sep 03 22:39:37 2014 db_recovery_file_dest_size of 4182 MB is 0.00% used. this is a user-specified limit on the amount of space that will be used by this database for recovery-related files, and does not reflect the amount of space available in the underlying filesystem or ASM diskgroup. wed Sep 03 22:39:37 2014 Starting background process CJQ0 Wed Sep 03 22:39:37 2014 CJQ0 started with pid = 24, OS id = 16134 Starting background process SMCO Wed Sep 03 22:39:43 2014 SMCO started with pid = 30, OS id = 16149
##### Immediate: Close the database and restart archiving.
SQL> shutdown immediate Database closed. database dismounted. ORACLE instance shut down. SQL> startup mount; ORACLE instance started. total System Global Area 2505338880 bytes Fixed Size 2255832 bytes Variable Size 620758056 bytes Database Buffers 1862270976 bytes Redo Buffers 20054016 bytes Database mounted. SQL> alter database archivelog; Database altered. SQL> alter database open; Database altered. SQL >### open the archive alert Log information as follows: ALTER DATABASE MOUNT Successful mount of redo thread 1, with mount id 3606990310 Database mounted in Exclusive Mode Lost write protection disabled Completed: alter database mount Wed Sep 03 22:45:06 2014 alter database archivelog Completed: alter database archivelog alter database open Wed Sep 03 22:45:12 2014 LGWR: starting arch processes Wed Sep 03 22:45:12 2014 ARC0 started with pid = 20, OS id = 16867 ARC0: Archival started LGWR: STARTING ARCH PROCESSES COMPLETE ARC0: starting arch processes Wed Sep 03 22:45:13 2014 ARC1 started with pid = 21, OS id = 16871 Wed Sep 03 22:45:13 2014 ARC2 started with pid = 22, OS id = 16873 Wed Sep 03 22:45:13 2014 ARC3 started with pid = 23, OS id = 16875 ARC1: Archival started ARC2: Archival started ARC1: Becoming \