Instance Architecture   «Prev  Next»

Lesson 15 The Archiver (ARC0)
Objective Explain the function of the Archiver.

Archiver (ARCn): How Redo Is Archived, What the 6 Images Show, and How to Troubleshoot

ARCn (Archiver) copies each filled online redo log to one or more archive destinations when the database runs in ARCHIVELOG mode. This preserves a complete redo history for media recovery, point-in-time recovery, and standby databases. LGWR writes redo to the online logs; ARCn copies completed logs to archived redo.

Image sequence (6 panels) - the essential story

1) As changes are made to an Oracle database, a log of those changes is written to the redo log files.
1) Redo is generated and written by LGWR to the current online redo log.
2) As each redo log is filled, the archiver process will begin to copy it to the archive.
2) When a log fills and a log switch occurs, ARCn starts copying that full log to archive destinations.
3) The archiver will more or less keep up with the log writer
3) Under normal load, ARCn keeps pace with LGWR so free log groups are always available.
4) If the log writer gets far enough ahead to fill up all the redo log files, then database users will be forced to wait while the archiver copies another file
4) If all groups fill before ARCn can archive them, LGWR must wait (“cannot advance”) - user commits stall.
5) When a database is running in archive log mode, then log writer will not overwrite a log file until it has been copied by the archiver.
5) In ARCHIVELOG mode, LGWR will not reuse a group until every destination has successfully archived it.
6) Once a log file has been copied, processing will resume. The archived log files preserve a record of all changes and is used for disaster recovery.
6) After archiving completes, processing resumes; archived logs form the recovery stream.

Caption analysis (why these 6 matter)

ARCn vs LGWR - responsibilities

Configuration snippets

-- Enable and point archive destinations (example pattern)
ALTER SYSTEM SET log_archive_dest_1 =
  'LOCATION=/u01/arch VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)';

-- Add a remote destination (Data Guard style, example)
ALTER SYSTEM SET log_archive_dest_2 =
  'SERVICE=stby1 ASYNC NOAFFIRM LGWR VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
   DB_UNIQUE_NAME=STBY1';

-- Let Oracle scale ARCn automatically; optionally set a floor
ALTER SYSTEM SET log_archive_max_processes = 4 SCOPE=BOTH;

-- Force archival of the current group on demand
ALTER SYSTEM ARCHIVE LOG CURRENT;

Troubleshooting “Failed to archive log” (alert log)

The message indicates delay/backlog, not necessarily data loss. Check destinations and throughput:

  1. Are destinations reachable and writable? Verify path/permissions/space; clear full filesystems.
  2. Enough redo groups and size? Right-size for workload so ARCn has time to copy between switches.
  3. Throughput: ensure archive device and network (for remote) are fast enough; consider more ARCn processes.
  4. Health views (examples below) to see errors, lag, and process states.

Monitoring

-- Destinations and status (errors, space, lag hints)
SELECT dest_id, status, error, destination, archived_seq#
FROM   v$archive_dest
ORDER  BY dest_id;

-- Archiver background processes
SELECT process, status, log_sequence
FROM   v$archive_processes
ORDER  BY process;

-- Recent switch cadence
SELECT sequence#, first_time, next_time
FROM   v$log_history
ORDER  BY first_time DESC
FETCH FIRST 20 ROWS ONLY;

-- What has been archived
SELECT sequence#, applied, completion_time
FROM   v$archived_log
ORDER  BY sequence# DESC
FETCH FIRST 20 ROWS ONLY;

Practical guidance


SEMrush Software