ORACLE数据库ORA-00392 log 4 of thread 1 is being cleared, operation not allowed错误
May052016
昨天在使用RMAN备份恢复测试数据库的时候,不小心在rename logfile的时候把名字搞错了路径,导致在resetlogs打开数据库的时候遇到以下错误。
SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-00344: unable to re-create online log '/data2/u04/app/oracle/oradata/ivldb/redo04.log' ORA-27040: file create error, unable to create file Linux-x86_64 Error: 2: No such file or directory Additional information: 1
查询发现,不止一个redo文件的路径搞错了。
SQL> select member from v$logfile; MEMBER ---------------------------------------------- /data2/u01/app/oracle/oradata/ivldb/redo03.log /data2/u01/app/oracle/oradata/ivldb/redo02.log /data2/u01/app/oracle/oradata/ivldb/redo01.log /data2/u04/app/oracle/oradata/ivldb/redo04.log /data2/u05/app/oracle/oradata/ivldb/redo05.log /data2/u06/app/oracle/oradata/ivldb/redo05.log
重新修改redo文件的路径,再次resetlogs打开数据库遇到ORA-00392错误。
SQL> alter database rename file '/data2/u04/app/oracle/oradata/ivldb/redo04.log' to '/data2/u01/app/oracle/oradata/ivldb/redo04.log'; Database altered. SQL> alter database rename file '/data2/u05/app/oracle/oradata/ivldb/redo05.log' to '/data2/u01/app/oracle/oradata/ivldb/redo05.log'; Database altered. SQL> alter database rename file '/data2/u06/app/oracle/oradata/ivldb/redo05.log' to '/data2/u01/app/oracle/oradata/ivldb/redo06.log'; Database altered. SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-00392: log 4 of thread 1 is being cleared, operation not allowed ORA-00312: online log 4 thread 1: '/data2/u01/app/oracle/oradata/ivldb/redo04.log'
这个错误需要手动重置redo文件才可以解决,无法直接resetlogs的方式重置。
SQL> alter database clear logfile group 4; Database altered. SQL> alter database open resetlogs; Database altered.