What is archive log mode?
In the Oracle world, your database can run in one of two modes: NOARCHIVELOG or ARCHIVELOG. Choosing between them is the difference between having a "Delete" button or a "Save" button for your business history.
Archive Log Mode is the setting that ensures every single change made to your database is preserved in a permanent file. It is the mandatory foundation for any production environment.
To understand Archive Log Mode, you have to understand the Online Redo Logs.
Online Redo Logs: These are a small set of files (usually 3 or 4) that record every transaction as it happens. They work in a circular fashion. When the last file is full, Oracle circles back and starts overwriting the first one.
Archived Redo Logs: When you enable ARCHIVELOG mode, Oracle doesn't just overwrite the old logs. Before it clears an Online Redo Log, a background process (ARCn) makes a copy of it and saves it to a permanent location.
In NOARCHIVELOG mode, you can only restore the database to the exact moment your last backup finished. If your backup finished at midnight and the database crashes at 4:00 PM, you lose 16 hours of data.
In ARCHIVELOG mode, you can restore that midnight backup and then "replay" the archived logs to recover the database to the exact second before the crash.
If you aren't in Archive Log Mode, you have to shut the database down to take a backup (Cold Backup). In Archive Log Mode, you can back up the database while users are actively reading and writing to it.
You cannot use Data Guard or GoldenGate effectively without Archive Log Mode. These technologies rely on those archived streams of data to keep the standby databases in sync.
A user commits a transaction.
The change is written to the Online Redo Log.
The log file fills up (a Log Switch occurs).
The ARCn process wakes up and copies the full log to the Archive Destination.
Only after the copy is successful is the Online Redo Log cleared for new data.
| Feature | NOARCHIVELOG | ARCHIVELOG |
| Data Loss Risk | High (Lose everything since last backup). | Zero (Recover to the last committed second). |
| Backups | Must be offline (Offline/Cold). | Can be online (Online/Hot). |
| Storage Needs | Low. | Higher (Requires space for logs). |
| Ideal For | Test/Development (disposable data). | Production / Mission Critical. |
Switching to Archive Log Mode requires a brief moment of downtime because the database must be in a MOUNT state:
-- 1. Shut down the database
SHUTDOWN IMMEDIATE;
-- 2. Mount it
STARTUP MOUNT;
-- 3. Change the mode
ALTER DATABASE ARCHIVELOG;
-- 4. Open the database
ALTER DATABASE OPEN;
You can verify the status with: archive log list;
If you enable Archive Log Mode, you must have a strategy to manage the files. If the destination (usually the Fast Recovery Area) fills up and Oracle cannot archive a log, the entire database will hang and refuse to process any more transactions until space is cleared.
Peer Tip: Always include
DELETE INPUTin your RMAN backup scripts. This tells RMAN to back up the archived logs to a safe place and then delete them from the local disk to prevent your storage from filling up.