当前使用的日志是不能删除的
SQL> col member for a
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
ONLINE /data/dbstat/redodbf NO
STALE ONLINE /data/dbstat/redolog NO
ONLINE /data/dbstat/redolog NO
SQL> alter database drop logfile group ;
alter database drop logfile group
*
ERROR at line :
ORA: log is current log for instance dbstat (thread ) cannot drop
ORA: online log thread : /data/dbstat/redolog
Inactive的删除后增加新的日志文件
SQL> alter database drop logfile group ;
Database altered
SQL> alter database add logfile group (/data/dbstat/redodbf) size M reuse;
Database altered
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
ONLINE /data/dbstat/redodbf NO
ONLINE /data/dbstat/redodbf NO
ONLINE /data/dbstat/redolog NO
SQL> set linesize
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
YES UNUSED
NO CURRENT ::
YES UNUSED
切换日志组当current变成非活动时(inactive)将其删除
SQL> alter system switch logfile;
System altered
SQL> alter database drop logfile group ;
alter database drop logfile group
*
ERROR at line :
ORA: log needed for crash recovery of instance dbstat (thread )
ORA: online log thread : /data/dbstat/redolog
SQL> alter system switch logfile;
System altered
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
NO ACTIVE ::
NO ACTIVE ::
NO CURRENT ::
SQL> alter system checkpoint;
System altered
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
NO INACTIVE ::
NO INACTIVE ::
NO CURRENT ::
SQL> alter database drop logfile group ;
Database altered
SQL> alter database add logfile group (/data/dbstat/redodbf) size M;
Database altered
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
NO INACTIVE ::
YES UNUSED
NO CURRENT ::