Recovery File Structures   «Prev  Next»
Lesson 7Multiplexing redo log files
ObjectiveDemonstrate how to multiplex online redo log files in Oracle AI Database 26ai and verify their groups, members, and storage locations.

Multiplexing Online Redo Log Files in Oracle 26ai

Multiplexing maintains more than one physical member of an online redo log group. Each member receives the same redo stream, so losing one member need not mean losing the group's redo. The protection depends on keeping usable copies in genuinely separate storage failure domains.

Two administrative operations are easy to confuse: adding a member supplies another copy within an existing group; adding a group supplies another destination in the sequence of log switches. This lesson first builds two groups with two members each, then adds a third group while continuing to use the same two storage locations.

The previous lesson followed redo from the memory buffer to the online logs. Here, the focus is the organization of those physical files: how to read the diagrams, inspect the actual configuration, and make changes that match the intended layout.

Groups, members, and the current write destination

A group is the unit that the database selects at a log switch. A member is a physical file belonging to that group. In a multiplexed group, the members are copies, not independent logs holding different transactions. Adding a second member therefore increases physical storage without doubling the amount of distinct redo the group holds.

LGWR writes the current group for its redo thread. With two usable members, it writes both copies of that group's redo. It does not write group 1, group 2, and group 3 simultaneously for the same thread. At a switch, writing moves to the next group available in the cycle.

Each redo thread needs at least two groups. Multiple members per group are recommended for redundancy, but two members are not the database's minimum requirement for every group. Members within a group must have equal sizes. These distinctions are described in Oracle's guide to managing the redo log.

Read the two-group configuration

The first diagram contains two groups and four files. Read across a row to identify one group's members. Read down a disk column to identify files that share a storage failure domain.

Two online redo log groups with two members each; LGWR writes both members of current group 1 across separate failure domains.
Two groups, four files: group 1 is current, and group 2 is next when reusable.

The highlighted row pairs g1_loga.ora with g1_logb.ora. Both belong to group 1. The next row pairs g2_loga.ora with g2_logb.ora in group 2. The teal arrows identify the current write destination; the dashed arrow represents a later log switch.

After group 2, this two-group example returns to group 1 when that group can be reused. The labels describe a snapshot and an expected sequence, not permanently assigned roles. Group 2 will itself become current, and group 1 will eventually receive a new redo sequence.

Place copies in separate failure domains

Disk 1 represents failure domain A; Disk 2 represents failure domain B. In the examples below, paths under /u01 correspond to A and paths under /u02 to B. Those names are placeholders for storage whose independence has been checked.

Different directories, mount points, or Windows drive letters do not prove independence. Two volumes might share one device, controller, or storage service. Review the underlying storage layout with the platform administrator, including the failure the design is intended to tolerate.

Ask a concrete question: if the storage containing every loga file becomes unavailable, where are the usable logb files? Their paths must lead to surviving storage. Also consider other database files on the failed device; redundant redo members cannot compensate for every possible loss of datafiles, control files, or infrastructure.

Keep a simple record mapping each member to its actual storage. The diagram is a teaching model, whereas that record describes the deployed system. Update the record after storage migrations so the intended protection remains visible to the next administrator.

Inspect the database before adding files

The SQL examples assume a single-instance CDB named CDB1. Use SQL*Plus or another suitable administrative client connected to the intended CDB root, with catalog access and the required ALTER DATABASE privilege for changes. Online logfile clauses operate at CDB scope; a PDB does not receive a separate set simply because it has its own datafiles. See the ALTER DATABASE prerequisites.

Begin with read-only inspection. These examples are illustrative commands, not captured results from your database.

SELECT name, cdb, log_mode
FROM v$database;

SELECT group#, thread#, sequence#,
       ROUND(bytes / 1024 / 1024) AS size_mib,
       members, archived, status AS group_status
FROM v$log
ORDER BY thread#, group#;

SELECT group#, type,
       NVL(status, 'IN USE') AS member_status,
       member
FROM v$logfile
WHERE type = 'ONLINE'
ORDER BY group#, member;

V$DATABASE identifies the database and archive mode. V$LOG reports groups, their sizes, member counts, and recovery states. V$LOGFILE lists the physical members. Filtering for ONLINE keeps standby redo members out of this particular inspection.

Group status and member status answer different questions. In V$LOG, CURRENT identifies the current group; ACTIVE identifies a noncurrent group still needed for crash recovery. INACTIVE means it is no longer needed for instance recovery. UNUSED can identify a newly added group that has not been written.

In V$LOGFILE, a null status means the member is in use. The query displays that null as IN USE; this is a display label, not another Oracle status. INVALID means inaccessible, and STALE means incomplete contents. Neither is a substitute for a group's recovery state.

Read the two result sets together. A group can have two registered member paths without both currently being usable. Conversely, an INACTIVE group is not a failed group; it describes recovery eligibility, not a storage fault.

For example, a CURRENT group, an archived ACTIVE group, and an archived INACTIVE group are not contradictory observations. The first is receiving writes, the second is still required for crash recovery, and the third has progressed beyond that requirement. Read each row's archive flag and status together instead of deciding that every archived group can immediately be removed.

Add second members to the existing groups

Assume the inspection finds groups 1 and 2, each with one member under /u01/oradata/CDB1/: g1_loga.ora and g2_loga.ora. The goal is to reach the first diagram by adding their partners under /u02/oradata/CDB1/.

Confirm the new destination directories exist, have sufficient space, and are writable by the database software owner. Confirm that the proposed files are neither already registered nor existing files you intend to reuse. If the two-member layout already exists, inspect it instead of repeating these statements.

ALTER DATABASE ADD LOGFILE MEMBER
  '/u02/oradata/CDB1/g1_logb.ora' TO GROUP 1;

ALTER DATABASE ADD LOGFILE MEMBER
  '/u02/oradata/CDB1/g2_logb.ora' TO GROUP 2;

The MEMBER keyword and TO GROUP clause identify existing groups. Oracle determines each new file's size from its group. These examples omit REUSE, which should not be added merely to suppress a file-exists error. Investigate an unexpected existing file before deciding what it represents.

Re-run the inspection queries. Expect the intended member count and exact new paths, then check their status as the groups are used. A newly added member can initially appear INVALID until first use; registration alone does not demonstrate complete, usable contents. Do not assume the command instantly copies every historical record into the new file.

The first diagram represents the resulting normal layout. Confirm normal use and investigate persistent unexpected statuses through the alert log and storage checks. Save the before-and-after query results with the change record so another administrator can identify what was added.

Understand switching and reuse before adding a group

Log switches move the redo stream through groups, while multiplexing keeps copies within each group. Those two dimensions explain why an extra member cannot solve a shortage of reusable groups. It receives the same stream as its partner rather than providing another place in the switching cycle.

A used group must no longer be required for instance recovery before reuse. In ARCHIVELOG mode, its redo must also have been archived as required. Checkpoint progress and archiving are separate conditions: an archived group can still be ACTIVE. A switch does not guarantee that the old group immediately becomes INACTIVE.

If an instance repeatedly reaches a group that is not ready, investigate the reason. Additional groups can provide more time before reuse, but they do not repair an unavailable archive destination or make slow storage faster. Compare switch history and alert-log messages with the workload before choosing a configuration.

For example, a burst of batch work may consume groups much faster than a quiet interval. Evaluating only the quiet period can hide the pressure. Consider representative activity and distinguish a temporary burst from a sustained inability to write, checkpoint, or archive fast enough.

Add a third group with two members

Now assume group 3 does not exist, the first two groups have their intended members, and the proposed group 3 paths are available. Create the new group with one member in each of the same two failure domains:

ALTER DATABASE ADD LOGFILE GROUP 3 (
  '/u01/oradata/CDB1/g3_loga.ora',
  '/u02/oradata/CDB1/g3_logb.ora'
) SIZE 512M;

This statement creates one group containing two members. It does not create a third disk, and a second ADD MEMBER statement for g3_logb.ora is unnecessary. The 512M size is illustrative, assuming compatible existing group sizes; select the actual size and check block-size compatibility for the target system.

Plan storage for both copies. In this example, the two 512 MiB member files consume about 1 GiB of file space together, while representing one group's 512 MiB redo capacity. Three such groups with two members each require about 3 GiB for their six member files. Archived logs and backups require additional storage outside this calculation.

Query V$LOG and V$LOGFILE again. Confirm group 3, its two paths, and its size. It can appear UNUSED before the redo thread first writes it. The diagram below explains how it participates in the cycle, not an assertion that the command immediately changed the current group.

Group numbering is an administrative identifier. Do not confuse it with SEQUENCE#, which identifies successive uses of redo within a thread. Configuration limits belong to database creation and platform planning; they are not obtained by selecting MAXLOGFILES and MAXLOGMEMBERS from V$DATABASE. Consult the CREATE DATABASE reference when reviewing those limits.

Read the three-group configuration

The second diagram has three groups and six physical files. The third row extends the switching cycle, while the disk columns retain the same meaning as in the first diagram.

Three online redo log groups with two members each across two failure domains, showing switches from group 1 to 2 to 3 and back to 1.
Three groups, six files: the illustrated cycle is 1 to 2 to 3 to 1, subject to each group's reuse requirements.

Group 1 is current in this snapshot. Group 2 follows when reusable, then group 3, and finally group 1 again. The dashed arrows describe successive switches. They are not additional LGWR write arrows. The labels NEXT WHEN REUSABLE and THEN WHEN REUSABLE are explanations, not values returned by V$LOG.STATUS.

Member names and storage placement in the two diagrams
GroupDisk 1 / failure domain ADisk 2 / failure domain B
1g1_loga.orag1_logb.ora
2g2_loga.orag2_logb.ora
3g3_loga.orag3_logb.ora

The first two rows describe the four-file layout; all three describe the six-file layout. A third member would add another copy to a row. A third group adds the new row shown here. That distinction is useful when translating a storage request into the correct SQL operation.

Understand the protection and its limits

Multiplexing protects the availability of online redo copies. It does not preserve an unlimited history: groups are reused. Archived redo and database backups serve separate purposes, and neither should be removed from a recovery plan merely because each online group has two members.

Similarly, two local copies are not proof of site-level protection. A shared infrastructure failure may affect both. Review the complete recovery design, including the database files and the availability of archived redo, rather than treating the diagram as a complete high-availability architecture.

ASM and Oracle Managed Files can change how storage and filenames are managed. Apply the same inspection questions to the actual deployment instead of copying filesystem paths into an ASM configuration. In RAC, retain thread context when reviewing groups and use the cluster's storage and administration procedures.

Remove groups or members only as planned maintenance

Adding group 3 does not require dropping it afterward. Group removal is a separate maintenance decision, for example when correcting a configuration after reviewing capacity and reuse behavior. A drawing that contains fewer groups is not, by itself, a reason to remove working redundancy or capacity.

For an already-used group 3, verify that it is INACTIVE, that required archiving has completed, and that at least two valid groups will remain in its thread. Check the intended database and group number before the optional operation:

SELECT group#, thread#, status, archived, members
FROM v$log
ORDER BY thread#, group#;

-- Optional maintenance after verifying the stated conditions:
ALTER DATABASE DROP LOGFILE GROUP 3;

A switch away from a CURRENT group is not enough to prove that recovery no longer needs it. Recheck the state. An UNUSED group has a different history from an already-used group; evaluate its actual state rather than forcing every case through the same example.

Removing one member is different from removing its group. Before member maintenance, confirm another usable member remains and that the group's state and archive requirements allow the operation. Do not drop a good copy just to test the diagram. Follow the documented group and member maintenance procedures, then verify the resulting configuration.

Verify the result and continue

Review three pieces of evidence together: group information, member information, and storage placement. The first confirms the switching configuration, the second confirms the registered copies and their state, and the third establishes what a storage failure would affect.

Match the exact filenames and group numbers to the intended design. Check that the new copies enter normal use and that unexpected alert-log messages are resolved. Keep the recorded configuration current; a successful command is the beginning of verification, not a substitute for it.

Finally, compare the SQL with the drawing in both directions. Every illustrated member should correspond to the intended registered path, and every registered online member should have an understood role in the design. If the real database contains additional groups or members, document them rather than removing them to make its output resemble a simplified teaching example.

You should now be able to explain both diagrams and choose between adding a member and adding a group.

Multiplexed Redo Logs - Quiz

Check your understanding of groups, members, switching, and storage placement in the Multiplexed Redo Logs - Quiz.


SEMrush Software 7 SEMrush Banner 7