运维联盟俱乐部

 找回密码
 立即注册
查看: 2226|回复: 0

[故障处理] startup with ora-00392,ora-312

[复制链接]
  • TA的每日心情
    开心
    2023-8-9 11:05
  • 发表于 2020-6-9 19:07:04 | 显示全部楼层 |阅读模式
    用rman得备份在异机做恢复,打开数据库得时候报错如下:
    1. SQL> alter database open resetlogs;
    2. alter database open resetlogs
    3. *
    4. ERROR at line 1:
    5. ORA-00392: log 1 of thread 1 is being cleared, operation not allowed
    6. ORA-00312: online log 1 thread 1: '/<PATH>/group_1.log'
    7. ORA-00312: online log 1 thread 1: '/<PATH>/group_12.log'
    复制代码
    原因:
    1. The first command "alter database open resetlogs" is abnormally abrupted leaving the redo log status as
    2. CLEARING/CLEARING_CURRENT in controlfile :
    3. SQL> select GROUP#,THREAD#,SEQUENCE#,MEMBERS,ARCHIVED,STATUS,FIRST_CHANGE# from v$log order
    4. by first_change# ;
    5. GROUP# THREAD# SEQUENCE# MEMBERS ARCHIVED STATUS FIRST_CHANGE#
    6. ------------- ----------- ----------- -------------- ---------- ---------------- -------------------
    7. 2 1 0 2 YES CLEARING 12142264718335
    8. 3 1 0 2 YES CLEARING 12142306351551
    9. 1 1 0 2 NO CLEARING_CURRENT 12142306351562
    复制代码
    处理:
    1. At first, see if below command helps :
    2. alter database clear unarchived logfile group 1 ;
    3. alter database clear unarchived logfile group 2 ;
    4. alter database clear unarchived logfile group 3 ;
    5. alter database open resetlogs;
    6. ELSE,
    7. Recreate the controflile with the RESETLOGS option.
    8. 1) Get the controlfile trace from below command :
    9. SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/control.sql' resetlogs ;
    10. 2) Modify the CREATE CONTROLFILE script /tmp/control.sql and ensure that all directories for the online redo logs
    11. exist and Oracle has permission to write to it
    12. 3) Create the controlfile in NOMOUNT state :
    13. SQL> STARTUP FORCE NOMOUNT
    14. SQL> @/tmp/control.sql
    15. controlfile created
    16. 4) Run a fake recovery :
    17. SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL ;
    18. Type <CANCEL> when prompted
    19. 5) Open with RESETLOGS option:
    20. SQL> ALTER DATABASE OPEN RESETLOGS ;
    复制代码




    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    运维联盟俱乐部 ( 冀ICP备19036648号 )

    GMT+8, 2024-5-17 10:13 , Processed in 0.051757 second(s), 21 queries , Gzip On.

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表