| Lesson 4 | Manual archiving |
| Objective | Manually archive the online redo log files in Oracle 23ai. |
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).
sqlplus / as sysdba
archive log list;
-- Script-friendly check
select log_mode from v$database;
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;
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;
This command requests that the database archive the current redo so it is available for recovery.
alter system archive log current;
select thread#, sequence#, first_time, next_time, archived, name
from v$archived_log
order by first_time desc
fetch first 10 rows only;
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;
v$archive_dest shows errors, resolve them before relying on archived logs for recovery objectives.