Manual | Automatic Archiving   «Prev  Next»
Lesson 4 Manual archiving
Objective Manually archive the online redo log files in Oracle 23ai.

Manual archiving

In Oracle 23ai, most production databases run in ARCHIVELOG mode with automatic archiving enabled. However, DBAs still use “manual archiving” as an operational action to force redo to be archived on demand. This is commonly done before a backup checkpoint, after changing archive destinations, or when validating that redo is safely landing in the expected location.

Manual archiving does not replace automatic archiving. Instead, it forces a log switch and/or archives the current redo, so recovery-required redo is written into an archived redo log file (or into the Fast Recovery Area, if configured).

Manual Archiving in Oracle 23ai

Step 1: Connect as SYSDBA (SQL*Plus)

sqlplus / as sysdba

Step 2: Confirm the database is in ARCHIVELOG mode

archive log list;

-- Script-friendly check
select log_mode from v$database;

Step 3: Confirm archive destinations and status

Use these commands to see where archived redo logs are written (filesystem destination(s) and/or the FRA), and whether Oracle reports any destination errors.

show parameter log_archive_dest;
show parameter log_archive_dest_1;
show parameter db_recovery_file_dest;

select dest_id, status, destination, error
from   v$archive_dest
order  by dest_id;

Step 4: Force a log switch (creates a new redo log sequence)

A log switch advances to the next online redo log group. This is often paired with archiving to ensure the just-completed log is archived.

alter system switch logfile;

Step 5: Archive the current redo (manual archive action)

This command requests that the database archive the current redo so it is available for recovery.

alter system archive log current;

Step 6: Verify archived logs were created

select thread#, sequence#, first_time, next_time, archived, name
from   v$archived_log
order  by first_time desc
fetch first 10 rows only;

Enabling ARCHIVELOG mode (requires downtime)

If the database is currently in NOARCHIVELOG mode, you must restart into MOUNT state to enable ARCHIVELOG mode. This is a controlled maintenance operation because the database must be closed during the mode change.

shutdown immediate;
startup mount;
alter database archivelog;
alter database open;

archive log list;

Operational notes and safety checks

Manual Archiving - Exercise

Click the Exercise link below to test your understanding of the manual archive processing.
Manual Archiving - Exercise The next lesson is about automatic archiving of the redo log files.

SEMrush Software 4 SEMrush Banner 4