| Lesson 3 | Listing redo log files |
| Objective | List redo log file groups and members. |
Oracle Database records redo log configuration information in the control file and exposes it through dynamic performance views. A complete inventory uses V$LOG for redo log groups and V$LOGFILE for the individual members belonging to those groups.
These views answer different questions. V$LOG shows which group is current or still needed for recovery, while V$LOGFILE shows where each member is stored and whether Oracle has detected a problem with that member.
| View | Level | Important information |
|---|---|---|
V$LOG | One row per redo log group | THREAD#, SEQUENCE#, size, member count, archive state, and group status |
V$LOGFILE | One row per redo log member | Group number, member name, member status, online or standby type, recovery-destination indicator, and container identifier |
The following query joins the views on GROUP#. Including THREAD# makes the output useful for both single-instance databases and Oracle Real Application Clusters environments.
SELECT l.thread#,
l.group#,
l.sequence#,
ROUND(l.bytes / 1024 / 1024) AS size_mb,
l.members,
l.archived,
l.status AS group_status,
NVL(lf.status, 'IN USE') AS member_status,
lf.type,
lf.is_recovery_dest_file,
lf.member
FROM v$log l
JOIN v$logfile lf
ON lf.group# = l.group#
ORDER BY l.thread#, l.group#, lf.member;
THREAD# GROUP# SEQUENCE# SIZE_MB MEMBERS ARCHIVED GROUP_STATUS MEMBER_STATUS TYPE MEMBER
------- ------ --------- ------- ------- -------- ------------ ------------- ------ ------------------------
1 1 184 1024 2 YES INACTIVE IN USE ONLINE +DATA/ORCL/ONLINELOG/...
1 1 184 1024 2 YES INACTIVE IN USE ONLINE +RECO/ORCL/ONLINELOG/...
1 2 185 1024 2 NO CURRENT IN USE ONLINE +DATA/ORCL/ONLINELOG/...
1 2 185 1024 2 NO CURRENT IN USE ONLINE +RECO/ORCL/ONLINELOG/...
ASM generates complete member names, so the displayed path is typically longer than the abbreviated example. Databases using conventional filesystems display operating-system paths instead.
Other transitional values, including CLEARING and CLEARING_CURRENT, can appear while Oracle clears a log. Always evaluate ARCHIVED together with group status before performing maintenance.
The STATUS column in V$LOGFILE describes a member, not its group. A null value means that the member is in use; the query displays that null as IN USE for readability.
Investigate any non-null problem status and corroborate it with the alert log and relevant trace files. Do not confuse these member values with the CURRENT, ACTIVE, or INACTIVE group values from V$LOG.
For every group, compare the MEMBERS count from V$LOG with the rows returned from V$LOGFILE. Multiplexed members should be distributed across independent storage or ASM failure groups so that one storage failure does not remove every member of a redo log group.
The IS_RECOVERY_DEST_FILE column identifies members located in the Fast Recovery Area. A balanced configuration commonly places members so that a single disk group, mount point, controller, or failure group is not the only location for a group's redo.
Dynamic performance views are normally queried by database administrators or monitoring accounts with appropriate catalog privileges. Grant only the access required by the operational role; application schemas generally should not need direct access to redo log configuration views.
V$LOG.V$LOGFILE.CURRENT group for each redo thread.In the next lesson, you will learn how to create new redo log groups and members for your database.
Before you move on, take this quiz covering the material so far.
Listing Redo Log Files - Quiz