SQL> alter database add logfile group 4 '/u01/oracle/oradata/orcl/redo04.log' size 500M; Database altered. SQL> alter database add logfile group 5 '/u01/oracle/oradata/orcl/redo05.log' size 500M; Database altered. SQL> alter database add logfile group 6 '/u01/oracle/oradata/orcl/redo06.log' size 500M; Database altered. SQL> alter database drop logfile group 1; Database altered. SQL> alter database drop logfile group 2; alter database drop logfile group 2 * ERROR at line 1: ORA-01623: log 2 is current log for instance orcl (thread 1) - cannot drop ORA-00312: online log 2 thread 1: '/u01/oracle/oradata/orcl/redo02.log' 这里切换一下日志,然后再操作 SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> alter database drop logfile group 2; alter database drop logfile group 2 * ERROR at line 1: ORA-01624: log 2 needed for crash recovery of instance orcl (thread 1) ORA-00312: online log 2 thread 1: '/u01/oracle/oradata/orcl/redo02.log' 执行一下检查 SQL> alter system checkpoint; System altered. SQL> alter database drop logfile group 2; Database altered. SQL> alter database drop logfile group 3; Database altered. set linesize 500 col group# for 999 col mb for 999 col member for a100 col thread# for 999 col archived for a10 SQL> select a.group#,a.BYTES/1024/1024 mb,b.MEMBER,a.thread#,a.sequence#,a.members,a.archived,a.status,a.first_time,a.next_time from gv$log a,gv$logfile b where a.GROUP#=b.GROUP# group by a.group#,a.thread#,a.BYTES/1024/1024,b.MEMBER,a.sequence#,a.members,a.archived,a.status,a.first_time,a.next_time order by group#; GROUP# MB MEMBER THREAD# SEQUENCE# MEMBERS ARCHIVED STATUS FIRST_TIME NEXT_TIME ------ ---- ---------------------------------------------------------------------------------------------------- ------- ---------- ---------- ---------- ---------------- ------------ ------------ 4 500 /u01/oracle/oradata/orcl/redo04.log 1 64 1 YES INACTIVE 07-AUG-20 07-AUG-20 5 500 /u01/oracle/oradata/orcl/redo05log 1 65 1 NO CURRENT 07-AUG-20 6 500 /u01/oracle/oradata/orcl/redo06.log 1 0 1 YES UNUSED |