TA的每日心情 | 开心 2023-8-9 11:05 |
---|
|
用rman得备份在异机做恢复,打开数据库得时候报错如下:
- SQL> alter database open resetlogs;
- alter database open resetlogs
- *
- ERROR at line 1:
- ORA-00392: log 1 of thread 1 is being cleared, operation not allowed
- ORA-00312: online log 1 thread 1: '/<PATH>/group_1.log'
- ORA-00312: online log 1 thread 1: '/<PATH>/group_12.log'
复制代码 原因:
- The first command "alter database open resetlogs" is abnormally abrupted leaving the redo log status as
- CLEARING/CLEARING_CURRENT in controlfile :
- SQL> select GROUP#,THREAD#,SEQUENCE#,MEMBERS,ARCHIVED,STATUS,FIRST_CHANGE# from v$log order
- by first_change# ;
- GROUP# THREAD# SEQUENCE# MEMBERS ARCHIVED STATUS FIRST_CHANGE#
- ------------- ----------- ----------- -------------- ---------- ---------------- -------------------
- 2 1 0 2 YES CLEARING 12142264718335
- 3 1 0 2 YES CLEARING 12142306351551
- 1 1 0 2 NO CLEARING_CURRENT 12142306351562
复制代码 处理:
- At first, see if below command helps :
- alter database clear unarchived logfile group 1 ;
- alter database clear unarchived logfile group 2 ;
- alter database clear unarchived logfile group 3 ;
- alter database open resetlogs;
- ELSE,
- 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 ;
复制代码
|
|