When managing an Oracle database, you’ll inevitably encounter the term ARCHIVELOG mode. This feature plays a critical role in backup and recovery operations.
In this article, we’ll thoroughly explain the concept of ARCHIVELOG mode for beginners, including how it works, how to check and switch modes, and its importance in data protection—all illustrated with clear text-based diagrams.
- What Is ARCHIVELOG Mode?
- Differences Between NOARCHIVELOG and ARCHIVELOG
- Why Is ARCHIVELOG Mode Needed?
- How to Check the Current Log Mode
- How to Switch to ARCHIVELOG Mode
- Confirming and Setting Archive Log Destination
- Output Archive Logs to Multiple Directories
- FRA and Archive Log Integration
- Operational Cautions for ARCHIVELOG Mode
- 🔁 Restore and Recovery with ARCHIVELOG Mode
- Summary: ARCHIVELOG Mode Is the Foundation of Safe Oracle Operations
What Is ARCHIVELOG Mode?
Oracle records all changes made by transactions in REDO log files. These logs are reused in a circular manner, but if you want to preserve them before they’re overwritten, Oracle provides a mechanism called archiving.
Archived redo logs (archive logs) are generated when a log switch occurs, which is the moment when the active redo log file is switched to the next one in the log group.
┌────────────────────┐
│ What is a Log Switch? │
└────────────────────┘
↓
・Occurs when the active redo log file changes
・The previous redo log is archived as an archive log
Based on whether these logs are preserved, Oracle operates in one of two modes:
┌────────────────────────────┐
│ Difference in Log Modes │
├────────────────┬────────────────┤
│ NOARCHIVELOG Mode │ Redo logs are overwritten │
│ ARCHIVELOG Mode │ Redo logs are archived and saved │
└────────────────┴────────────────┘
Differences Between NOARCHIVELOG and ARCHIVELOG
❌ NOARCHIVELOG Mode
- Redo logs are overwritten.
- If a failure occurs, data after the last backup is lost.
- Only offline (cold) backups are possible.
✅ ARCHIVELOG Mode
- Redo logs are saved as archive logs.
- Complete recovery is possible up to the point of failure.
- Supports online backups during normal operations.
Why Is ARCHIVELOG Mode Needed?
ARCHIVELOG mode is essential in the following scenarios:
- Systems where zero data loss is acceptable (e.g., finance, healthcare).
- When using RMAN for online backups.
- For 24/7 operations without downtime.
┌────────────────────┐
│ Database Failure Occurs! │
└────────────────────┘
↓
・NOARCHIVELOG → Only recover to last backup (data loss)
・ARCHIVELOG → Recover to point just before failure (no data loss)
How to Check the Current Log Mode
Use the following SQL command in SQL*Plus:
ARCHIVE LOG LIST;
Sample output:
SQL> archive log list
Database log mode Archive Mode ★
Automatic archival Enabled
Archive destination /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch
Oldest online log sequence 4
Next log sequence to archive 6
Current log sequence 6
- “Archive Mode” → ARCHIVELOG enabled
- “No Archive Mode” → ARCHIVELOG not enabled
How to Switch to ARCHIVELOG Mode
You must bring the database to MOUNT state (not open) to change the mode.
-- Shutdown the database
SHUTDOWN IMMEDIATE
-- Start in MOUNT mode
STARTUP MOUNT
-- Enable ARCHIVELOG mode
ALTER DATABASE ARCHIVELOG;
-- Open the database
ALTER DATABASE OPEN;
Confirming and Setting Archive Log Destination
SHOW PARAMETER log_archive_dest_1
To change the destination:
ALTER SYSTEM SET log_archive_dest_1='LOCATION=/u02/arch' SCOPE=BOTH;
Output Archive Logs to Multiple Directories
Oracle allows you to output archive logs to up to 31 destinations simultaneously.
This helps with:
- Redundancy (high availability)
- Saving to both FRA and external directories
- Physical separation of redo logs and backup disks
ALTER SYSTEM SET log_archive_dest_1='LOCATION=/u01/arch1' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_2='LOCATION=/u02/arch2' SCOPE=BOTH;
FRA and Archive Log Integration
FRA (Fast Recovery Area) can be used as an archive log destination.
ALTER SYSTEM SET db_recovery_file_dest_size=10G SCOPE=BOTH;ALTER SYSTEM SET db_recovery_file_dest='/u03/fra' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST' SCOPE=BOTH;
⚠️ Be careful: if the FRA becomes full, the database may stop due to being unable to archive logs. Regular monitoring is essential.
Operational Cautions for ARCHIVELOG Mode
| Item | Notes |
|---|---|
| Archive destination | If full, log switch fails → database may halt |
| Backup integration | Use RMAN to automatically manage retention |
| Log file deletion | Old archive logs should be deleted regularly via RMAN |
| Multi-destination setup | Ensure all archive destinations are writing successfully |
🔁 Restore and Recovery with ARCHIVELOG Mode
The true strength of ARCHIVELOG mode is revealed during restore and recovery operations.
🔧 Restore
- Use RMAN backup sets to restore datafiles, control files, etc.
- Required when physical files are lost due to disk failure or corruption.
🔁 Recovery
- Apply archive logs and online redo logs to redo committed transactions.
- You can recover to any point in time, SCN, or log sequence.
┌─────────────────────────────────────────┐
│ Conceptual Image: Restore vs Recovery │
├───────────────┬──────────────────────────┤
│ Restore │ Restore files from backup │
│ Recovery │ Apply archive logs to catch up │
└───────────────┴──────────────────────────┘
RMAN Example
# Restore from backup
RESTORE DATABASE;
# Recover using archive logs
RECOVER DATABASE;
# Open the database
ALTER DATABASE OPEN;
Summary: ARCHIVELOG Mode Is the Foundation of Safe Oracle Operations
ARCHIVELOG mode is essential for reliable backup and recovery, and forms the basis of high availability Oracle environments.
┌────────────────────────────────────────┐
│ Benefits of Using ARCHIVELOG Mode │
├────────────────────────────────────────┤
│ ✔ Complete recovery without data loss │
│ ✔ Supports online backups │
│ ✔ Redundancy through multiple destinations │
│ ✔ Enables flexible restore and recovery │
└────────────────────────────────────────┘
If your system is still running in NOARCHIVELOG mode, it’s time to reconsider your strategy!
[reference]
6.1.3 About Archived Redo Log Files

コメント