活着,寻找生存。
分类: Oracle
2015-11-21 15:26:42
SQL> col status for a15 SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIV STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME ---------- ---------- ---------- ---------- ---------- ---------- ------ --------------- ------------- ------------------- ------------ ------------------- 1 1 48 524288000 512 1 NO CURRENT 5922462 2015-11-19 11:00:49 2.8147E+14 2 1 47 524288000 512 1 YES INACTIVE 5586193 2015-11-16 22:55:17 5922462 2015-11-19 11:00:49 3 1 46 524288000 512 1 YES INACTIVE 5239552 2015-11-14 07:58:39 5586193 2015-11-16 22:55:17 ---这里因为之前调整了,所以你看到是500m。 SQL> select * from v$logfile; GROUP# STATUS TYPE MEMBER IS_REC ---------- --------------- -------------- ---------------------------------------- ------ 3 ONLINE /opt/oracle/oradata/ora/redo03.log NO 2 ONLINE /opt/oracle/oradata/ora/redo02.log NO 1 ONLINE /opt/oracle/oradata/ora/redo01.log NO |
UNUSED - Online redo log has never been written to. This is the state of a redo log that was just added, or just after a RESETLOGS, when it is not the current redo log.
CURRENT - Current redo log. This implies that the redo log is active. The redo log could be open or closed.
ACTIVE - Log is active but is not the current log. It is needed for crash recovery. It may be in use for block recovery. It may or may not be archived.
CLEARING - Log is being re-created as an empty log after an ALTER DATABASE CLEAR LOGFILEstatement. After the log is cleared, the status changes to UNUSED.
CLEARING_CURRENT - Current log is being cleared of a closed thread. The log can stay in this status if there is some failure in the switch such as an I/O error writing the new log header.
INACTIVE - Log is no longer needed for instance recovery. It may be in use for media recovery. It might or might not be archived.
SQL> alter database drop logfile group 2; Database altered. 在操作系统层面通过rm -rf 删除redo02.log文件 SQL> alter database add logfile group 2 '/opt/oracle/oradata/ora/redo02.log' size 512m; Database altered. |
SQL> alter database drop logfile group 3; Database altered. 在操作系统层面通过rm -rf 删除redo03.log文件 SQL> alter database add logfile group 3 '/opt/oracle/oradata/ora/redo03.log' size 512m; Database altered. |
SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIV STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME ---------- ---------- ---------- ---------- ---------- ---------- ------ --------------- ------------- ------------------- ------------ ------------------- 1 1 48 524288000 512 1 NO CURRENT 5922462 2015-11-19 11:00:49 2.8147E+14 2 1 0 536870912 512 1 YES UNUSED 0 0 3 1 0 536870912 512 1 YES UNUSED 0 0 |
SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered. SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIV STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME ---------- ---------- ---------- ---------- ---------- ---------- ------ --------------- ------------- ------------------- ------------ ------------------- 1 1 51 524288000 512 1 YES INACTIVE 6215824 2015-11-21 15:18:14 6215827 2015-11-21 15:18:15 2 1 52 536870912 512 1 NO CURRENT 6215827 2015-11-21 15:18:15 2.8147E+14 3 1 50 536870912 512 1 YES INACTIVE 6215821 2015-11-21 15:18:12 6215824 2015-11-21 15:18:14 |
SQL> alter database drop logfile group 1; Database altered. 在操作系统层面通过rm -rf 删除redo01.log文件 SQL> alter database add logfile group 1 '/opt/oracle/oradata/ora/redo01.log' size 512m; Database altered. |
SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIV STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME ---------- ---------- ---------- ---------- ---------- ---------- ------ --------------- ------------- ------------------- ------------ ------------------- 1 1 0 536870912 512 1 YES UNUSED 0 0 2 1 52 536870912 512 1 NO CURRENT 6215827 2015-11-21 15:18:15 2.8147E+14 3 1 50 536870912 512 1 YES INACTIVE 6215821 2015-11-21 15:18:12 6215824 2015-11-21 15:18:14 |