1. 非归档模式下,非current redo 丢失或损坏(inactive状态)
 
方法:直接清除损坏日志组,或者直接删除日志,打开数据库后再重新添加;

注意:归档模式方法一样

--例子
--Session 1

SQL> select * from v$log;

 GROUP# THREAD# SEQUENCE# BYTES  BLOCKSIZE  MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- --------------------------
  1     1        91    52428800    512      1       NO  CURRENT  1627245    29-DEC-15  2.8147E+14
  2     1        89    52428800    512      1       NO  INACTIVE 1627239    29-DEC-15  1627242     29-DEC-15
  3     1        90    52428800    512      1       NO  INACTIVE 1627242    29-DEC-15  1627245     29-DEC-15
 
 

SQL> col member for a70
SQL> select * from v$Logfile;

    GROUP# STATUS  TYPE    MEMBER                          IS_
---------- ------- ------- -------------------------------------
  1    ONLINE  /u01/app/oracle/oradata/orcl/redo01.log     NO
  2    ONLINE  /u01/app/oracle/oradata/orcl/redo02.log     NO
  3    ONLINE  /u01/app/oracle/oradata/orcl/redo03.log     NO

SQL> alter system checkpoint;

System altered.

--Session 2  把group3的inactive状态的redo损坏

[root@zw_test_26_75 ~]# dd if=/dev/null of=/u01/app/oracle/oradata/orcl/redo03.log bs=512 count=10
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000115041 s, 0.0 kB/s

--Session 1

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

数据库能不能正常起来?

这个是非归档

SQL> startup
ORACLE instance started.

Total System Global Area  952020992 bytes
Fixed Size      2258960 bytes
Variable Size    314574832 bytes
Database Buffers   629145600 bytes
Redo Buffers      6041600 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 14561
Session ID: 145 Serial number: 3

启动报错,查看alert.log日志

Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_lgwr_14545.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/orcl/redo03.log'
ORA-27047: unable to read the header block of file
 

怎么顺利打开数据库?

SQL> alter database clear logfile group 3;

Database altered.


能不能打开数据库


SQL> alter database open;

Database altered.

SQL> select status from v$instance;

STATUS
------------
OPEN


数据库已经打开,如果此时打开报错,就用以下方法尝试;

SQL> alter database drop logfile group 2;
Database altered.

SQL> alter database open;
Database altered.

 
SQL> alter database add logfile group 2 ('/u01/app/oracle/oradata/orcl/redo02.log') size 20m;
Database altered.