rman异机恢复的异常处理

因客户需要测试,使用生产环境的rman备份在虚拟机恢复中,忘记调整redo位置,打开时报错及处理过程。

SQL>   alter database open resetlogs;
  alter database open resetlogs
*
ERROR at line 1:
ORA-00344: unable to re-create online log
'/oradata/ORCL/ONLINELOG/group_1.log'
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 1

 

SQL>  select group#,bytes/1024/1024||'M',status from v$log;

    GROUP# BYTES/1024/1024||'M'              STATUS
---------- ----------------------------------------- ----------------
     1 500M                      CLEARING
     2 500M                      CLEARING_CURRENT
     3 500M                      CLEARING
     4 500M                      CLEARING_CURRENT

SQL>  alter database clear logfile group 1;

Database altered.

SQL>  alter database clear logfile group 2;

Database altered.

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00392: log 4 of thread 2 is being cleared, operation not allowed
ORA-00312: online log 4 thread 2: '/oradata/ORCL/ONLINELOG/group_4.log'


SQL> alter database clear logfile group 3;

Database altered.

SQL>  alter database clear logfile group 4;

Database altered.

SQL> select group#,bytes/1024/1024||'M',status from v$log;

    GROUP# BYTES/1024/1024||'M'              STATUS
---------- ----------------------------------------- ----------------
     1 500M                      UNUSED
     2 500M                      CURRENT
     3 500M                      UNUSED
     4 500M                      CURRENT
 
 SQL> alter database open resetlogs;

Database altered.
 
得到的教训:必须按照步骤流程做事

你可能感兴趣的:(OracleDB,数据库)