| Lesson 6 | Recreating Online Redo Log Groups |
| Objective | Verify the conditions for replacing an inactive archived online redo log group, recreate its members on usable storage, and validate the resulting configuration in Oracle AI Database 26ai. |
An inaccessible online redo log group can prevent normal database operation even when its contents are no longer needed for instance recovery. If the original files cannot be used, an eligible group can be dropped and recreated with members on usable storage. The replacement restores online redo capacity; it does not reconstruct the old redo records.
This lesson follows a single-instance primary container database (CDB) running in ARCHIVELOG mode. Group 3 in thread 1 is inaccessible, but investigation establishes that it is inactive and archived. The current control files, normal startup configuration, datafiles, and redo needed for instance recovery remain usable. At least two valid groups will remain when group 3 is removed.
The illustrated database is mounted after an unsuccessful open attempt. An authorized DBA connects to CDB$ROOT, verifies the evidence, replaces group 3, and opens the database normally. The same maintenance concepts also help with planned resizing, but a planned change on a healthy open database has different preparation steps.
Do not transfer this example unchanged to a lost current group, an active group, or a database with additional file damage. RAC and Data Guard configurations also require their applicable thread and standby coordination.
The previous lessons introduced ALTER DATABASE CLEAR LOGFILE. Clearing reinitializes an existing configured group. Explicit replacement uses DROP LOGFILE to remove a group from the database structure and ADD LOGFILE to define its replacement. These operations have different restrictions and should not be treated as interchangeable command sequences.
Start by deciding what actually failed. A temporary storage interruption may require restoring access rather than recreating files. A surviving usable member calls for consideration of member repair. Whole-group replacement is appropriate only after confirming that its old contents and the remaining configuration permit the operation.
| Finding | Maintenance direction |
|---|---|
| Original files are usable after a temporary access fault is repaired | Restore access and reassess operation before discarding files. |
| One or more usable members survive | Preserve the surviving redo and assess member-only repair. |
| An eligible group needs reinitialization at its configured destinations | Consider the documented clearing procedure. |
| An eligible group needs new members, locations, or size | Plan explicit group replacement and verify the remaining groups. |
| Required redo is lost or the database has additional damage | Develop a recovery plan before changing the redo structure. |
A failed clear is not automatic permission to drop a group. Oracle may already have recorded a clearing operation in the control file before an I/O failure interrupted recreation. Inspect the resulting state and use the documented failure-handling procedure. Do not substitute a DROP command merely because CLEAR returned an error.
V$LOG describes online redo groups. V$LOGFILE describes their members. Both expose a column named STATUS, but those columns answer different questions. A member marked STALE does not establish that its group is inactive.
Use this joined query when you want to examine the two levels together:
SELECT l.group#, l.thread#, l.status AS group_status,
l.archived, f.status AS member_status, f.member
FROM v$log l
JOIN v$logfile f ON f.group# = l.group#
WHERE f.type = 'ONLINE'
ORDER BY l.group#, f.member;
A current group is the group being written by LGWR. An active group remains necessary for instance recovery. An inactive group is no longer required for that purpose, but its redo may still be needed to recover an older backup or an offline datafile. Archiving and instance-recovery requirements must be assessed separately.
When LGWR can write to a usable member, a failed member need not mean the loss of the whole group. Preserve that surviving copy. Adding a replacement member does not establish that it already contains the group's earlier redo, so do not immediately discard the last usable member on that assumption.
Member maintenance has its own restrictions. This lesson does not provide an unconditional member ADD/DROP script against current or active groups. After diagnosing a member-only failure, follow the appropriate procedure and verify that redundancy has actually been restored. Review the related lesson on multiplexing and protecting redo log files.
For the group 3 example, establish the following conditions before issuing DROP:
INACTIVE.Count groups, not members. A group with two members is still one group. If only two valid groups exist, do not drop one and rely on adding it back afterward. Establish suitable additional capacity first where appropriate, or reassess the supported alternatives. Oracle's minimum is also not a sizing recommendation for every workload.
Maintain a recoverable backup strategy before planned maintenance. A backup does not make an otherwise ineligible group safe to drop, and ARCHIVED=YES does not prove that an archive file is still accessible. Preserve the recovery chain rather than relying on a single status flag.
Select the affected instance's Oracle environment and connect using an authorized account:
sqlplus / as sysdba
If the instance is shut down, mount it for this investigation:
STARTUP MOUNT
Use this startup command only when the instance is down. If an earlier open failure left it mounted, continue there. Do not restart an already running instance just to follow the example. Once mounted, verify the context:
SHOW CON_NAME
SELECT instance_name, status
FROM v$instance;
SELECT name, database_role, open_mode, log_mode
FROM v$database;
The expected context is the root of the intended primary CDB, mounted and in ARCHIVELOG mode. Redo groups belong to the CDB's redo thread; switching to an application PDB is not the way to perform this maintenance.
An open attempt may have reported ORA-00313 and ORA-00312. These identify an opening problem and an associated redo filename. Inspect accompanying operating-system errors, alert-log entries, and trace information. An open failure alone does not prove physical corruption or that every member has been lost.
Inspect the entire configuration so that the decision accounts for both the failed group and the groups that must remain:
SELECT group#, thread#, sequence#, status, archived,
members, bytes
FROM v$log
ORDER BY group#;
SELECT group#, type, status, member
FROM v$logfile
ORDER BY group#, member;
Record the original member paths and group sizes before changing metadata. Cross-check every member against storage and diagnostic evidence. A blank member status does not replace physical accessibility checks, and the number of registered members does not prove all are usable.
For example, group 3 might be inactive and archived while groups 1, 2, and 4 remain valid. That gives three remaining groups after its removal. This is an illustrative configuration, not output from your database. Use your actual group inventory and investigate any additional failed group before continuing.
If the target is current, active, unarchived, or already in a clearing state, stop this sequence and reassess. Do not make the evidence fit the example by repeatedly switching logs or appending an option that discards unarchived redo.
The replacement uses two new filenames on storage intended to provide separate failure domains:
D:\ORADATA\ORCL\REDO03A_NEW.LOG
E:\ORADATA\ORCL\REDO03B_NEW.LOG
These Windows paths are examples. Verify the actual storage behind the drive letters; two letters can still refer to a shared point of failure. Confirm directory access for the operating-system account running Oracle, not merely for your interactive login.
For ASM or Oracle Managed Files, select the corresponding managed-storage creation method. Do not copy this filesystem example literally or assume that an ASM filename has the same lifecycle as an ordinary file. Resolve the storage fault before attempting recreation.
The example uses 200 MB members. Choose the real size using workload and operational requirements. A larger group changes switch frequency and archive volume per file; it does not repair a failed device. New filenames also avoid ambiguity about which previous file would be overwritten.
Recheck the prerequisites immediately before execution. In this example, group 3 is inactive and archived, recovery dependencies have been assessed, and at least two valid groups will remain. Then issue:
ALTER DATABASE DROP LOGFILE GROUP 3;
Read the statement's result before proceeding. If it fails, retain the diagnostic output and determine why the operation was rejected. Do not delete the member files at the operating-system level to bypass the restriction.
Once DROP succeeds, the old group is no longer registered in the database structure. Treat the following ADD as a separate operation. A later ROLLBACK does not restore a successfully dropped redo group and its old contents.
After the drop succeeds, create group 3 with its two new members:
ALTER DATABASE ADD LOGFILE GROUP 3
('D:\ORADATA\ORCL\REDO03A_NEW.LOG',
'E:\ORADATA\ORCL\REDO03B_NEW.LOG')
SIZE 200M;
The statement deliberately omits REUSE. Do not add it just because an existing-file error appears. Establish why the file exists and whether it belongs to another configuration before choosing any overwrite operation.
If ADD fails after DROP succeeded, stop and diagnose the creation error. Correct the destination, permissions, capacity, or naming issue while preserving the other groups. Do not continue through an unattended script as though a replacement had been created successfully.
Reusing group number 3 keeps this example easy to follow. Planned replacements can use a different unused group number. Neither choice reconstructs the original group's redo.
Inspect the replacement before opening the mounted database:
SELECT group#, thread#, status, members, bytes
FROM v$log
WHERE group# = 3;
SELECT group#, status, member
FROM v$logfile
WHERE group# = 3
ORDER BY member;
Confirm the intended size, member count, and exact paths. A newly created group can be UNUSED until it is first used. That state is not a reason to repeat the creation operation.
Only after successful replacement and resolution of any other opening problems, open the database:
ALTER DATABASE OPEN;
This is a normal open, without RESETLOGS. The example does not call for restoring datafiles or using a backup control file. Automatic instance recovery may still occur after an abnormal shutdown. If opening produces another error, investigate that error rather than assuming more group replacements are needed.
Check the CDB and required PDB states after opening:
SELECT name, open_mode, database_role
FROM v$database;
SELECT name, open_mode, restricted
FROM v$pdbs;
Confirm application connectivity and review the alert log for new errors. Monitor subsequent normal use of the recreated group and the archiving process. Metadata confirms the configuration; operational evidence establishes whether the repaired storage continues to work.
Protect the updated control file through the site's backup procedure. For example, in an RMAN session connected to the target CDB:
RMAN> BACKUP CURRENT CONTROLFILE;
This uses the configured backup environment. A control-file backup protects structural metadata, not the online redo contents. RMAN does not back up online redo members, and a control-file backup alone does not replace datafile and archived-redo protection.
Handle obsolete files according to their management model. After a successful group drop, user-managed files can remain on disk and require deliberate cleanup of their exact paths. Oracle Managed Files are cleaned up automatically. Confirm the successful metadata change and identify the obsolete files before any separate deletion; do not use wildcard cleanup around live database files.
On a healthy open database, planned replacement can begin by adding new groups with unused numbers and new member paths. This preserves capacity while the old groups are prepared for retirement. Replace groups in controlled stages rather than dropping all intended targets at once.
A log switch moves writing to another group. It does not alone establish that the former group is inactive and archived. Checkpoint progress determines whether redo is still needed for instance recovery, while archiving preserves the redo for other recovery purposes. Requery the target before dropping it.
ALTER SYSTEM SWITCH LOGFILE remains valid for a justified maintenance step. It is not a loop to run until a damaged system stops complaining. Do not copy switching commands into the mounted incident example, where the target has already been verified inactive and archived.
Resizing is performed by replacement with appropriately sized groups, not by changing the size of an existing online redo member in place. Likewise, moving valid members can use a documented relocation procedure instead of discarding them. Choose the operation that serves the actual maintenance goal.
Document the final group inventory, paths, sizes, and storage layout. Keep the archived redo and backups needed by the recovery plan, and confirm that multiplexing spans useful failure boundaries. The next lesson demonstrates how to obtain recovery status information through data dictionary views.
Technical references: Oracle AI Database Backup and Recovery User's Guide, 26ai, G43741-04, section 37.7; Managing the Redo Log; and the ALTER DATABASE SQL reference.