ORA-00257: Archiver Error - Connect Internal Only Until Freed
ORA-00257: Archiver Error - Connect Internal Only Until Freed
Section titled “ORA-00257: Archiver Error - Connect Internal Only Until Freed”Error Description
Section titled “Error Description”ORA-00257 occurs when the Oracle archiver process cannot write archive log files to the configured archive destination, typically due to insufficient disk space or permission issues. This is a critical error that can halt database operations.
Complete Error Message
Section titled “Complete Error Message”ORA-00257: archiver error. Connect internal only, until freed.
Severity Level
Section titled “Severity Level”🔴 CRITICAL - Database may halt new transactions until resolved.
Common Causes
Section titled “Common Causes”1. Insufficient Disk Space
Section titled “1. Insufficient Disk Space”- Archive log destination filesystem is full
- Rapid log generation exceeding disk capacity
- Large transactions filling archive destination quickly
2. Permission Issues
Section titled “2. Permission Issues”- Oracle process lacks write permissions to archive destination
- Directory permissions changed after configuration
- File system mounted read-only
3. Hardware Issues
Section titled “3. Hardware Issues”- Disk failure in archive destination
- Network issues with remote archive destinations
- Storage subsystem problems
4. Configuration Problems
Section titled “4. Configuration Problems”- Invalid archive destination path
- Archive destination not accessible
- Multiple archive processes competing for resources
Immediate Diagnosis Steps
Section titled “Immediate Diagnosis Steps”1. Check Archive Destination Space
Section titled “1. Check Archive Destination Space”-- Check current archive destinationSELECT destination, status, errorFROM v$archive_destWHERE status = 'ERROR';
-- Check archive destination space usageSELECT destination, ROUND(space_limit/1024/1024, 2) as limit_mb, ROUND(space_used/1024/1024, 2) as used_mb, ROUND((space_used/space_limit)*100, 2) as pct_usedFROM v$recovery_file_dest;
2. Check Archiver Process Status
Section titled “2. Check Archiver Process Status”-- Check archiver processesSELECT process, status, sequence#, thread#FROM v$managed_standbyWHERE process LIKE 'ARC%';
-- Check archive log statusSELECT thread#, sequence#, status, archived, appliedFROM v$logORDER BY thread#, sequence#;
3. Check Operating System Space
Section titled “3. Check Operating System Space”# Check filesystem space (Linux/Unix)df -h /u01/app/oracle/archive
# Check available inodesdf -i /u01/app/oracle/archive
# Check recent archive logsls -ltr /u01/app/oracle/archive/*.arc | tail -10
Immediate Solutions
Section titled “Immediate Solutions”1. Free Up Archive Destination Space
Section titled “1. Free Up Archive Destination Space”Delete Old Archive Logs (Use with caution)
Section titled “Delete Old Archive Logs (Use with caution)”# First, ensure logs are backed up or not needed for recovery# Check what's safe to delete with RMAN
# Connect to RMANrman target /
# Delete obsolete archive logsRMAN> DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';
# Or delete specific sequence rangeRMAN> DELETE ARCHIVELOG FROM SEQUENCE 1000 UNTIL SEQUENCE 1500 THREAD 1;
Move Archive Logs to Another Location
Section titled “Move Archive Logs to Another Location”# Create new archive destinationmkdir -p /u02/app/oracle/archivechown oracle:oinstall /u02/app/oracle/archivechmod 755 /u02/app/oracle/archive
# Move old archivesmv /u01/app/oracle/archive/1_1000_*.arc /u02/app/oracle/archive/
2. Temporarily Disable Archiving (Emergency Only)
Section titled “2. Temporarily Disable Archiving (Emergency Only)”-- Connect as SYSDBAALTER SYSTEM SET log_archive_start=FALSE SCOPE=MEMORY;
-- Or change to NOARCHIVELOG mode (requires downtime)SHUTDOWN IMMEDIATE;STARTUP MOUNT;ALTER DATABASE NOARCHIVELOG;ALTER DATABASE OPEN;
3. Add Additional Archive Destinations
Section titled “3. Add Additional Archive Destinations”-- Add secondary archive destinationALTER SYSTEM SET log_archive_dest_2='LOCATION=/u02/app/oracle/archive OPTIONAL REOPEN=300';ALTER SYSTEM SET log_archive_dest_state_2=ENABLE;
-- Verify new destinationSELECT destination, status FROM v$archive_dest WHERE dest_id = 2;
Long-term Solutions
Section titled “Long-term Solutions”1. Implement Archive Log Management Policy
Section titled “1. Implement Archive Log Management Policy”RMAN Retention Policy
Section titled “RMAN Retention Policy”-- Set retention policyRMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
-- Configure automatic deletionRMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
Scheduled Archive Log Cleanup
Section titled “Scheduled Archive Log Cleanup”#!/bin/bash# archive_cleanup.sh - Run daily via cron
export ORACLE_HOME=/u01/app/oracle/product/19cexport ORACLE_SID=PRODexport PATH=$ORACLE_HOME/bin:$PATH
# Delete archive logs older than 7 days that are backed uprman target / <<EOFDELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';EXIT;EOF
2. Monitor Archive Log Generation
Section titled “2. Monitor Archive Log Generation”-- Create monitoring view for archive log generationCREATE OR REPLACE VIEW archive_log_rate ASSELECT TO_CHAR(first_time, 'YYYY-MM-DD HH24') as hour, COUNT(*) as logs_per_hour, ROUND(SUM(blocks * block_size)/1024/1024, 2) as mb_per_hourFROM v$archived_logWHERE first_time > SYSDATE - 7GROUP BY TO_CHAR(first_time, 'YYYY-MM-DD HH24')ORDER BY 1 DESC;
-- Check current generation rateSELECT * FROM archive_log_rate WHERE ROWNUM <= 24;
3. Set Up Archive Destination Monitoring
Section titled “3. Set Up Archive Destination Monitoring”-- Create alert when archive destination reaches 85% fullCREATE OR REPLACE PROCEDURE check_archive_space AS v_pct_used NUMBER;BEGIN SELECT ROUND((space_used/space_limit)*100, 2) INTO v_pct_used FROM v$recovery_file_dest;
IF v_pct_used > 85 THEN -- Send alert or write to alert log EXECUTE IMMEDIATE 'BEGIN DBMS_SYSTEM.KSDWRT(2, ''WARNING: Archive destination '' || :1 || ''% full''); END;' USING v_pct_used; END IF;EXCEPTION WHEN OTHERS THEN NULL; -- Handle exceptions appropriatelyEND;/
Prevention Strategies
Section titled “Prevention Strategies”1. Proactive Monitoring
Section titled “1. Proactive Monitoring”- Set up alerts at 75% and 85% space usage
- Monitor archive log generation rates
- Track filesystem growth trends
- Implement automated cleanup procedures
2. Capacity Planning
Section titled “2. Capacity Planning”-- Calculate archive log generation trendsSELECT TRUNC(first_time) as log_date, COUNT(*) as daily_logs, ROUND(SUM(blocks * block_size)/1024/1024/1024, 2) as daily_gb, ROUND(AVG(blocks * block_size)/1024/1024, 2) as avg_log_size_mbFROM v$archived_logWHERE first_time > SYSDATE - 30GROUP BY TRUNC(first_time)ORDER BY 1 DESC;
3. Best Practices
Section titled “3. Best Practices”- Configure multiple archive destinations
- Use Fast Recovery Area (FRA) for automatic management
- Implement RMAN backup strategy
- Regular capacity monitoring and alerting
- Test archive log recovery procedures
Related Parameters
Section titled “Related Parameters”Key Archive Parameters
Section titled “Key Archive Parameters”-- Check current archive configurationSELECT name, value FROM v$parameterWHERE name IN ( 'log_archive_dest_1', 'log_archive_dest_2', 'log_archive_format', 'log_archive_max_processes', 'db_recovery_file_dest', 'db_recovery_file_dest_size');
Recommended Settings
Section titled “Recommended Settings”-- Basic archive configurationALTER SYSTEM SET log_archive_dest_1='LOCATION=/u01/app/oracle/archive';ALTER SYSTEM SET log_archive_format='%t_%s_%r.arc';ALTER SYSTEM SET log_archive_max_processes=4;
-- Fast Recovery Area configurationALTER SYSTEM SET db_recovery_file_dest='/u01/app/oracle/fra';ALTER SYSTEM SET db_recovery_file_dest_size=100G;
Troubleshooting Steps
Section titled “Troubleshooting Steps”1. Verify Archive Process Health
Section titled “1. Verify Archive Process Health”-- Check archiver background processesSELECT paddr, name, descriptionFROM v$bgprocessWHERE name LIKE 'ARC%';
-- Check for archiver errors in alert logSELECT message_text, originating_timestampFROM v$diag_alert_extWHERE message_text LIKE '%ARC%'AND originating_timestamp > SYSDATE - 1ORDER BY originating_timestamp DESC;
2. Check File System Issues
Section titled “2. Check File System Issues”# Check for filesystem errorsdmesg | grep -i error | tail -20
# Check file system healthfsck -n /dev/sdb1 # Read-only check
# Check mount optionsmount | grep archive
3. Network Connectivity (Remote Destinations)
Section titled “3. Network Connectivity (Remote Destinations)”# Test network connectivity to standbyping standby_server
# Test SQL*Net connectivitytnsping standby_service
# Check listener statuslsnrctl status
Common Mistakes to Avoid
Section titled “Common Mistakes to Avoid”- Never delete archive logs without backup verification
- Don’t disable archiving in production without understanding impact
- Avoid setting archive destinations to root filesystem
- Don’t ignore archive destination monitoring
- Never delete current online redo logs
Related Oracle Errors
Section titled “Related Oracle Errors”- ORA-16038: Log Cannot Be Archived - Archive destination issues
- ORA-01654: Unable to Extend Index - Space-related errors
- ORA-19502: Write Error on File - File system write errors
Emergency Recovery
Section titled “Emergency Recovery”If database is hung due to ORA-00257:
-- Connect as SYSDBA (may need to connect internal)sqlplus / as sysdba
-- Check database statusSELECT status FROM v$instance;
-- If needed, force log switch to different destinationALTER SYSTEM SWITCH LOGFILE;
-- Temporarily change archive destinationALTER SYSTEM SET log_archive_dest_1='LOCATION=/tmp';
-- Clear the error after freeing spaceALTER SYSTEM ARCHIVE LOG CURRENT;
Documentation and Monitoring
Section titled “Documentation and Monitoring”Keep track of:
- Archive log generation patterns
- Space usage trends
- Cleanup schedules and results
- Recovery procedures tested
- Alert thresholds and responses
This error requires immediate attention as it can halt database operations. Always ensure you have tested backup and recovery procedures before making changes to archive log configuration.