DEV Community

umzzil nng
umzzil nng

Posted on • Originally published at oraerror.com

Oracle ORA-00322 Error: Causes and Solutions Complete Guide

ORA-00322: log of thread is not current copy — Causes, Fixes & Prevention

ORA-00322 occurs when Oracle detects that an online redo log file is not the current, valid copy expected by the control file or recovery process. This typically surfaces during database startup, media recovery, or after a storage failure. Left unresolved, it prevents the database from transitioning to the OPEN state.


Top 3 Causes

1. Corrupted or Out-of-Sync Redo Log Member (Multiplexed Group)

When a redo log group has multiple members and one becomes physically corrupted or falls out of sync due to a disk failure, Oracle raises ORA-00322. Since all members in a group must be identical, any discrepancy triggers the error.

-- Check redo log group and member status
SELECT l.GROUP#, l.THREAD#, l.SEQUENCE#, l.STATUS,
       lm.MEMBER, lm.STATUS AS MEMBER_STATUS
FROM   V$LOG l
JOIN   V$LOGFILE lm ON l.GROUP# = lm.GROUP#
ORDER BY l.GROUP#;
Enter fullscreen mode Exit fullscreen mode

If you see INVALID or STALE in MEMBER_STATUS, that member needs to be dropped and re-added.

2. Incomplete Media Recovery Before Database Open

Attempting ALTER DATABASE OPEN after a partial or incomplete recovery causes SCN mismatches between the control file and redo logs. Oracle no longer recognizes the existing logs as "current" for the recovered database state.

-- If recovery is incomplete, open with RESETLOGS
-- First, perform recovery until the desired point
RECOVER DATABASE UNTIL CANCEL;

-- Then open with RESETLOGS to reset log sequence
ALTER DATABASE OPEN RESETLOGS;
Enter fullscreen mode Exit fullscreen mode

⚠️ Always take a full backup immediately after RESETLOGS.

3. Snapshot or Cloning Without Proper Log Reset

Restoring a database from a storage snapshot or manually copying datafiles without resetting the redo logs causes the control file to reference log headers that don't match the current instance state. This is common in test environment cloning scenarios.

-- Use RMAN DUPLICATE for proper cloning (avoids log inconsistency)
-- On the auxiliary instance:
RMAN> DUPLICATE TARGET DATABASE TO testdb
      FROM ACTIVE DATABASE
      SPFILE
      LOGFILE
        GROUP 1 ('/u02/oradata/testdb/redo01.log') SIZE 50M,
        GROUP 2 ('/u02/oradata/testdb/redo02.log') SIZE 50M;
Enter fullscreen mode Exit fullscreen mode

Quick Fix Solutions

Fix 1 — Clear a damaged redo log group (MOUNT state)

-- Mount the database first
STARTUP MOUNT;

-- Clear the problematic log group
ALTER DATABASE CLEAR LOGFILE GROUP 2;

-- If the log has not been archived yet (risk of data loss)
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 2;

-- Open the database
ALTER DATABASE OPEN;
Enter fullscreen mode Exit fullscreen mode

Fix 2 — Drop and re-add a bad multiplexed member

-- Drop the corrupted member
ALTER DATABASE DROP LOGFILE MEMBER '/u01/oradata/orcl/redo02b.log';

-- Re-add a fresh member to the same group
ALTER DATABASE ADD LOGFILE MEMBER '/u01/oradata/orcl/redo02b.log'
    TO GROUP 2;

-- Force a log switch to sync the new member
ALTER SYSTEM SWITCH LOGFILE;
Enter fullscreen mode Exit fullscreen mode

Fix 3 — Post-recovery RESETLOGS open

-- After incomplete recovery via RMAN
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE UNTIL SCN 9876543;

-- Open with RESETLOGS
ALTER DATABASE OPEN RESETLOGS;

-- Immediately back up the database
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
Enter fullscreen mode Exit fullscreen mode

Prevention Tips

1. Always multiplex redo logs across separate disks and monitor regularly.
Set up a scheduled job to alert the DBA when any log member shows INVALID or STALE status.

-- Schedule this check daily
SELECT l.GROUP#, lm.MEMBER, lm.STATUS
FROM   V$LOG l
JOIN   V$LOGFILE lm ON l.GROUP# = lm.GROUP#
WHERE  lm.STATUS IN ('INVALID', 'STALE');
Enter fullscreen mode Exit fullscreen mode

2. Use RMAN DUPLICATE for all database cloning operations — never manually copy datafiles and redo logs. Always run a full RMAN backup immediately after any RESETLOGS operation to establish a new backup baseline and avoid dependency on pre-RESETLOGS archived logs.


Related Errors

Error Code Description
ORA-00312 Online log file not found or inaccessible
ORA-00313 Cannot open redo log group member
ORA-00316 File is not a valid Oracle log file
ORA-00333 Redo log read error during recovery

📖 Want a more detailed guide?
Check out the full in-depth version (Korean) on oraerror.com — includes detailed analysis, additional SQL examples, and prevention tips.

Top comments (0)