DEV Community

umzzil nng
umzzil nng

Posted on • Originally published at oraerror.com

Oracle ORA-00320 Error: Causes and Solutions Complete Guide

ORA-00320: Cannot Read File Header from Log of Thread

ORA-00320 is a critical Oracle error that occurs when the database engine is unable to read the file header of an online Redo Log file for a specific thread. This typically surfaces during database startup (STARTUP) or a log switch operation and can prevent the database from reaching the OPEN state. If left unresolved, it can lead to complete database unavailability, especially in RAC environments.


Top 3 Causes

1. Physical Corruption or Deletion of Redo Log File

The most common cause is a Redo Log file that has been accidentally deleted at the OS level or corrupted due to a storage failure. Oracle must read the header block of each Redo Log to retrieve critical metadata such as SCN and sequence number.

-- Check current Redo Log group and member status
SELECT a.GROUP#, a.THREAD#, a.SEQUENCE#, a.STATUS,
       b.MEMBER, b.STATUS AS MEMBER_STATUS
FROM   V$LOG a
JOIN   V$LOGFILE b ON a.GROUP# = b.GROUP#
ORDER  BY a.THREAD#, a.GROUP#;
Enter fullscreen mode Exit fullscreen mode

2. Incorrect File Permissions or Path Mismatch

If the Oracle OS user lacks read/write access to the Redo Log files, or if the path recorded in the control file no longer matches the actual file location (e.g., after a filesystem remount), ORA-00320 will be raised.

-- Verify paths registered in the control file
SELECT GROUP#, MEMBER FROM V$LOGFILE ORDER BY GROUP#;

-- After fixing OS permissions, check for INVALID members
SELECT GROUP#, MEMBER, STATUS
FROM   V$LOGFILE
WHERE  STATUS = 'INVALID';
Enter fullscreen mode Exit fullscreen mode

3. RAC Thread Configuration Issues

In Oracle RAC, each instance owns a dedicated Redo Log thread. If an instance is decommissioned but its thread remains enabled without valid log groups, or if a single-instance restore is performed from a RAC backup without cleaning up thread metadata, this error will occur.

-- Check all thread statuses
SELECT THREAD#, STATUS, ENABLED FROM V$THREAD;

-- Disable an orphaned thread
ALTER DATABASE DISABLE THREAD 2;
Enter fullscreen mode Exit fullscreen mode

Quick Fix Solutions

Fix 1: Drop and recreate an INACTIVE log group

-- Drop the corrupted/missing INACTIVE group
ALTER DATABASE DROP LOGFILE GROUP 3;

-- Re-add with two multiplexed members
ALTER DATABASE ADD LOGFILE THREAD 1
  GROUP 3 ('/u01/oradata/ORCL/redo03a.log',
            '/u01/oradata/ORCL/redo03b.log') SIZE 200M REUSE;
Enter fullscreen mode Exit fullscreen mode

Fix 2: Clear a corrupted CURRENT/ACTIVE log (last resort)

-- Mount the database first
STARTUP MOUNT;

-- Clear the unarchived log (risk of data loss)
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 2;

-- Attempt recovery and open with RESETLOGS
RECOVER DATABASE UNTIL CANCEL;
ALTER DATABASE OPEN RESETLOGS;
Enter fullscreen mode Exit fullscreen mode

Fix 3: Remove a bad RAC thread

-- Drop log groups belonging to the orphaned thread
ALTER DATABASE DROP LOGFILE GROUP 4;
ALTER DATABASE DROP LOGFILE GROUP 5;

-- Disable the unused thread
ALTER DATABASE DISABLE THREAD 2;
Enter fullscreen mode Exit fullscreen mode

Prevention Tips

1. Always multiplex Redo Logs across separate disks

Configure at least two members per log group on different physical disks or ASM disk groups. Run periodic checks to catch INVALID or STALE members before they become a crisis.

-- Scheduled health check for Redo Log members
SELECT l.GROUP#, l.THREAD#, l.STATUS, lf.MEMBER, lf.STATUS AS MEMBER_STATUS
FROM   V$LOG l
JOIN   V$LOGFILE lf ON l.GROUP# = lf.GROUP#
WHERE  lf.STATUS IN ('INVALID','STALE')
ORDER  BY l.THREAD#, l.GROUP#;
Enter fullscreen mode Exit fullscreen mode

2. Enable ARCHIVELOG mode and include archived logs in RMAN backups

Always run in ARCHIVELOG mode and ensure your RMAN backup policy covers archived logs. This guarantees a recovery path even when the current Redo Log is lost.

-- Confirm ARCHIVELOG mode
SELECT LOG_MODE FROM V$DATABASE;

-- Verify recent archive log generation
SELECT THREAD#, SEQUENCE#, COMPLETION_TIME
FROM   V$ARCHIVED_LOG
WHERE  COMPLETION_TIME > SYSDATE - 1
ORDER  BY COMPLETION_TIME DESC;
Enter fullscreen mode Exit fullscreen mode

Related Errors

  • ORA-00312 – Online log file identifier unrecognized; often appears alongside ORA-00320.
  • ORA-00313 – Failure to open a Redo Log group member; usually a permissions or path issue.
  • ORA-00316 – File header does not match expected Redo Log format.
  • ORA-00333 – Redo Log read error during recovery operations.

📖 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)