Tuesday, March 13, 2018

Re-Create Controlfile


 
 

The restored RAMN open the database with resetlogs encountered ORA-00392 error:

ORA-00392: log 7 of thread 1 is being cleared, operation not allowed

RMAN> alter database open resetlogs; 
RMAN-00571: ============================================== ============= 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== 
RMAN-00571: ============================================== ============= 
RMAN-03002: failure of alter db command at 05/25/2012 09:41:46 
ORA-00392: log 7 of thread 1 is being cleared, operation not allowed 
ORA-00312: online log 7 thread 1: '/ opt/ora11g/oradata/acscnprd/redo/redo07.rdo'

Get the script to create the control file 
SQL>

ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/control.sql' resetlogs;

(2) modify / tmp / control.sql the location of the control file is created on the RESETLOGS option. 
CREATE CONTROLFILE REUSE DATABASE "ACSCNPRD" FORCE LOGGING ARCHIVELOG 
.... 
LOGFILE 
...... 
RESETLOGS 
DATAFILE

3 Close the database 
SQL> SHUTDOWN IMMEDIATE

Database state started to mount 
SQL> STARTUP FORCE NOMOUNT

Execute the generated control.sql 
SQL> @/tmp/control.sql
 
ORA-01081: cannot start already-running ORACLE - shut it down first 
Control file created. 
PL / SQL procedure successfully completed. 
PL / SQL procedure successfully completed. 
PL / SQL procedure successfully completed. 
PL / SQL procedure successfully completed. 
ORA-00279: change 733410844 generated at 05/24/2012 05:15:53 ??needed for thread1 
ORA-00289: suggestion: 
/ Opt/ora11g/fast_recovery_area/ACSCNPRD/archivelog/2012_05_25/o1_mf_1_7293_% u_.arc 
ORA-00280: change 733410844 for thread 1 is in sequence # 7293

ORA-00308: cannot open archived log 
'/ Opt/ora11g/fast_recovery_area/ACSCNPRD/archivelog/2012_05_25/o1_mf_1_7293_% u_.arc' 
ORA-27037: unable to obtain file status 
Linux-x86_64 Error: 2: No such file or directory 
Additional information: 3 
ALTER DATABASE OPEN RESETLOGS 
* 
ERROR at line 1: 
ORA-01113: file 1 needs media recovery 
ORA-01110: data file 1: '/ opt/ora11g/oradata/acscnprd/system01.dbf'

ALTER TABLESPACE TEMP ADD TEMPFILE '/ opt/ora11g/oradata/acscnprd/temp01.dbf' REUSE 
* 
ERROR at line 1: 
ORA-01109: database not open

Database altered.

6 Recovery 
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
 
ORA-00279: change 733410844 generated at 05/24/2012 05:15:53 ??needed for thread1 
ORA-00289: suggestion: 
/ Opt/ora11g/fast_recovery_area/ACSCNPRD/archivelog/2012_05_25/o1_mf_1_7293_% u_.arc 
ORA-00280: change 733410844 for thread 1 is in sequence # 7293

Specify log: {<RET> = suggested | filename | AUTO | CANCEL} 
CANCEL 
Media recovery canceled.

7 RESETLOGS open the database. 
SQL> ALTER DATABASE OPEN RESETLOGS;
 
Database altered.

View the database state 
SQL> select open_mode from v $ database;

OPEN_MODE 
-------------------- 
READ WRITE 

 

No comments:

Post a Comment