RESETLOGS ORA-00392

RAMN 恢复后,用resetlogs打开数据库时遇到了ORA-00392错误:

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'

1.获取创建控制文件的脚本
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/control.sql' resetlogs ;

2.修改/tmp/control.sql,在创建控制文件的位置加入RESETLOGS选项。
CREATE CONTROLFILE  REUSE DATABASE "ACSCNPRD"  FORCE LOGGING ARCHIVELOG
....
LOGFILE
......
RESETLOGS
DATAFILE

3.关闭数据库
SQL>SHUTDOWN IMMEDIATE

4.把数据库启动到mount状态
SQL>STARTUP FORCE NOMOUNT

5.执行生成的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.进行恢复
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 cancelled.

7.以RESETLOGS方式打开数据库.
SQL> ALTER DATABASE OPEN RESETLOGS ;
Database altered.

8.查看数据库状态
SQL> select open_mode from v$database;

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

你可能感兴趣的:(RESETLOGS ORA-00392)