CURRENT:
The online redo log is active, that is, needed for instance recovery, and it is the log to which the database is currently writing. The redo log can be open orclosed.
ACTIVE:
The online redo log is active and required for instance recovery, but is not the log to which the database is currently writing. It may be in use for blockrecovery, and may or may not be archived.Once perform "alter system checkpoint",the log will be change inactive.
INACTIVE:
The log is no longer needed for instance recovery. It may be in use for media recovery,and may or may not be archived.
UNUSED:
The online redo log has never been written to.
CLEARING:
The log is being re-created as an empty log after an ALTER DATABASECLEAR LOGFILE statement. After the log is cleared, then 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 thenew log header. . .
The ALTER DATABASE CLEAR LOGFILE statement can fail with an I/O error due to media failure when it is not possible to:
Relocate the redo log file onto alternative media by re-creating it under the currently configured redo log filename
Reuse the currently configured log filename to re-create the redo log file because the name itself is invalid or unusable (for example, due to media failure)
In these cases, the ALTER DATABASE CLEAR LOGFILE statement (before receiving the I/O error) would have successfully informed the control file that the log was being cleared and did not require archiving. The I/O error occurred at the step in which the CLEAR LOGFILE statement attempts to create the newredo log file and write zeros to it.
This fact is reflected in V$LOG.CLEARING_CURRENT.
查看Redo log的状态和具体文件,可用如下语句:
SQL> select group#,bytes/1024/1024||'M',status from v$log;
GROUP# BYTES/1024/1024||'M' STATUS
---------- ----------------------------------------- ----------------
1 50M UNUSED
2 50M INACTIVE
3 50M CURRENT
SQL> select group#,member from v$logfile;
GROUP# MEMBER
---------- --------------------------------------------------
3 /u01/oradata/orcl/redo03.log
2 /u01/oradata/orcl/redo02.log
1 /u01/oradata/orcl/redo01.log