Was sind “ACTIVE” Online-Redolog-Files?

10. Juni 2013 Aus Von Markus Flechtner

In der View V$LOG ist „ACTIVE“ einer der möglichen Stati eines Online-Redolog-Files.
Üblicherweise ist es das letzte aktuelle Redolog-File nach einem Log-Switch

SQL> alter system switch logfile;

System altered.

SQL> select group#,sequence#,status from v$log;

GROUP# SEQUENCE# STATUS
———- ———- —————-
1 133 INACTIVE
2 134 ACTIVE
3 135 CURRENT

Nach einem Checkpoint (z.B. manuell via „ALTER SYSTEM CHECKPOINT;“) wird es „INACTIVE“.

SQL> alter system checkpoint;
System altered.

SQL> select group#,sequence#,status from v$log;

GROUP# SEQUENCE# STATUS
———- ———- —————-
1 133 INACTIVE
2 134 INACTIVE
3 135 CURRENT

Die Oracle-Doku (11.2 Reference) sagt zum Status „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.“

Ausführlicher sind die Antworten zu diesem Thema in der OTN-Community (https://forums.oracle.com/thread/1108495):

„ACTIVE means that not all dirty blocks in the Buffer Cache – of which modifications where recorded with the Redo Protocol, stored to the Online Log – have been written to disk yet.“ (Uwe Hesse)

Der Checkpoint beim Logswitch erwischt unter Umständen nicht alle „dirty blocks“, d.h. Bei „ACTIVE“-Logfiles sind noch Transaktionen im File, deren zugehörigen DB-Blöcke noch nicht geschrieben wurden (vgl. auch http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:69959697198021).

Daher wird das Logfile auch nach einem weiteren Checkpoint „INACTIVE“. Solange es aber „ACTIVE“ ist, wird es nicht überschrieben, unabhängig davon, ob es schon vom ARC-Prozess archiviert wurde oder nicht.