DEV Community

umzzil nng
umzzil nng

Posted on • Originally published at oraerror.com

Oracle ORA-00301 Error: Causes and Solutions Complete Guide

ORA-00301: Error in Adding Log File – File Cannot Be Created

ORA-00301 occurs when Oracle fails to physically create a new Redo Log file during an ALTER DATABASE ADD LOGFILE operation. The error is raised at the OS level, meaning Oracle cannot write the new file to the specified path. This is a critical issue since Redo Logs are essential for database recovery and ongoing transaction management.


Top 3 Causes and Fixes

1. Directory Does Not Exist or Insufficient OS Permissions

The most common cause. The target directory either doesn't exist on the OS or the oracle OS user lacks write permissions.

Fix:

# Create directory and grant permissions on OS level
mkdir -p /u02/oradata/ORCL/redo
chown oracle:oinstall /u02/oradata/ORCL/redo
chmod 755 /u02/oradata/ORCL/redo
Enter fullscreen mode Exit fullscreen mode
-- Check existing log file locations
SELECT group#, member, status
FROM v$logfile
ORDER BY group#;

-- Add new Redo Log group after directory is confirmed
ALTER DATABASE ADD LOGFILE GROUP 4
  ('/u02/oradata/ORCL/redo/redo04a.log',
   '/u03/oradata/ORCL/redo/redo04b.log')
  SIZE 200M;
Enter fullscreen mode Exit fullscreen mode

2. Insufficient Disk Space

If the target filesystem is full or nearly full, the OS will refuse to create the file. Always verify available space before adding large Redo Log files.

-- Check current Redo Log sizes
SELECT a.group#,
       a.member,
       b.bytes / 1024 / 1024 AS size_mb,
       b.status
FROM   v$logfile a,
       v$log b
WHERE  a.group# = b.group#
ORDER  BY a.group#;
Enter fullscreen mode Exit fullscreen mode
# Check available disk space on OS
df -h /u02/oradata/ORCL/redo
Enter fullscreen mode Exit fullscreen mode

Free up space (e.g., remove old archive logs via RMAN), then retry:

-- Retry adding log file after space is freed
ALTER DATABASE ADD LOGFILE GROUP 5
  ('/u02/oradata/ORCL/redo/redo05.log')
  SIZE 100M;
Enter fullscreen mode Exit fullscreen mode

3. File Already Exists or ASM Misconfiguration

If a file with the same name already exists at the target path, Oracle won't overwrite it by default. In ASM environments, a typo in the disk group name or an unmounted disk group will also trigger ORA-00301.

-- Check for duplicate file entries
SELECT * FROM v$logfile WHERE member LIKE '%redo04%';

-- Use REUSE to overwrite existing file (use with caution)
ALTER DATABASE ADD LOGFILE GROUP 4
  ('/u02/oradata/ORCL/redo/redo04.log')
  SIZE 200M REUSE;

-- For ASM: verify disk group status
SELECT name, state, total_mb, free_mb
FROM v$asm_diskgroup;

-- ASM example for adding Redo Log
ALTER DATABASE ADD LOGFILE GROUP 6
  ('+DATA/ORCL/ONLINELOG/redo06.log',
   '+FRA/ORCL/ONLINELOG/redo06b.log')
  SIZE 200M;
Enter fullscreen mode Exit fullscreen mode

Quick Prevention Tips

  • Monitor disk usage proactively. Set up alerts when the Redo Log filesystem exceeds 75–80% capacity. Use OEM or a simple cron-based shell script to avoid surprise failures.
  • Always multiplex Redo Logs. Place log members on separate disks or ASM disk groups, and validate directory existence, permissions, and free space as a checklist before every ADD LOGFILE operation.

Related Errors

Error Code Description
ORA-00312 Online log file not found or inaccessible
ORA-00302 Maximum number of log members exceeded
ORA-19502 Write error on file during file creation
ORA-27040 OS-level file create error, often appears alongside ORA-00301

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