执行alter database open resetlogs提示ORA-00392和ORA-00312错误

问题现象:打开数据库,提示错误

RMAN> alter database open resetlogs;
 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 12/17/2018 11:22:26
ORA-00392: log 2 of thread 1 is being cleared, operation not allowed
ORA-00312: online log 2 thread 1: '/u02/app/oracle/oradata/cams/redo02.log'

问题描述

[oracle@SIT130093 ~]$ oerr ORA 00392
00392, 00000, "log %s of thread %s is being cleared, operation not allowed"
// *Cause:  An operation encountered this online log in the middle of being
//          cleared.  The command that began the clearing may have terminated
//          without completing the clearing.
// *Action: If the clear command is still executing then wait for its
//          completion. If it terminated then reissue the clear command, or
//          drop the log.

解决方案

SYS@cams>select GROUP#,STATUS from v$log;
 
    GROUP# STATUS
---------- ----------------
 1 CLEARING
 3 CLEARING
 2 CLEARING_CURRENT
 
SYS@cams>alter database clear logfile group 1;
 
Database altered.
 
SYS@cams>alter database clear logfile group 2;
 
Database altered.
 
SYS@cams>alter database clear logfile group 3;
 
Database altered.
 
SYS@cams>select GROUP#,STATUS from v$log;
 
    GROUP# STATUS
---------- ----------------
 1 UNUSED
 3 UNUSED
 2 CURRENT
RMAN> alter database open resetlogs;
 
database opened

如果使用clear logfile的方案不好使,可采用如下方案:

Recreate the controflile with the RESETLOGS option.
1) Get the controlfile trace from below command :
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/control.sql' resetlogs ;
2) Modify the CREATE CONTROLFILE  script /tmp/control.sql and ensure that all directories for the online redo logs exist and Oracle has permission to write to it
3) Create the controlfile in NOMOUNT state :
SQL> STARTUP FORCE NOMOUNT
SQL> @/tmp/control.sql
controlfile created
4) Run a fake recovery :
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL ;
Type <CANCEL> when prompted
5) Open with RESETLOGS option:
SQL> ALTER DATABASE OPEN RESETLOGS;


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31394774/viewspace-2285953/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31394774/viewspace-2285953/

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值