试验一:用命令清空日志组方法

  1、 查看原来表中数据

 

 


 SQL>; conn test/test
  Connected.
  SQL>; select * from test;
  TEL
  ----------
  1
  2
  3

  2、插入新数据

 


  SQL>; insert into test values(4);
  1 row created.
  SQL>; commit;
  Commit complete.
  SQL>;

  3、 正常关闭数据库

  4、 利用os command删除所有redo文件

  5、 启动数据库

 


  SQL>; startup
  ORACLE instance started.
  Total System Global Area 353862792 bytes
  Fixed Size 730248 bytes
  Variable Size 285212672 bytes
  Database Buffers 67108864 bytes
  Redo Buffers 811008 bytes
  Database mounted.
  ORA-00313: open failed for members of log group 1 of thread 1
  ORA-00312: online log 1 thread 1: '/T3/ORACLE/oradata/ORA9/redo01.log'

  6、 查看当前日志状态

 


  SQL>; select * from v$log;
  GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
  ---------- ---------- ---------- ---------- ---------- --- ----------------
  FIRST_CHANGE# FIRST_TIME
  ------------- ----------
  1 1 2 104857600 1 YES INACTIVE
  487837 01-9月 -05
  2 1 4 104857600 1 NO CURRENT
  487955 01-9月 -05
  3 1 3 104857600 1 YES INACTIVE
  487839 01-9月 -05

  看来redo01.log不是当前日志,对于这类非当前日志可以直接clear,系统会重新自动生成一个redo文件

  SQL>; alter database clear logfile group 1;

  Database altered.