How to Enable Archive Log Mode in Oracle 19c

If you want to enable archive log mode in your Oracle database because you want to backup your database while it’s opened, then you should follow these simple steps.

Be aware that you’ll need to restart your database.

So here we go.

First you connect as sysdba and do some checking

sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Apr 10 12:09:10 2021
Version 19.8.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.8.0.0.0

SQL> SELECT LOG_MODE FROM V$DATABASE;

LOG_MODE
------------
NOARCHIVELOG

SQL> show parameter LOG_ARCHIVE_DEST_1

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1                   string
log_archive_dest_10                  string
log_archive_dest_11                  string
log_archive_dest_12                  string
log_archive_dest_13                  string
log_archive_dest_14                  string
log_archive_dest_15                  string
log_archive_dest_16                  string
log_archive_dest_17                  string
log_archive_dest_18                  string
log_archive_dest_19                  string

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1 = 'LOCATION=USE_DB_RECOVERY_FILE_DEST' scope=both;

System altered.

Now you need to stop the Oracle database and to mount it.

SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> STARTUP MOUNT
ORACLE instance started.

Total System Global Area 1073738888 bytes
Fixed Size                  9143432 bytes
Variable Size             532676608 bytes
Database Buffers          524288000 bytes
Redo Buffers                7630848 bytes
Database mounted.

SQL> ALTER DATABASE ARCHIVELOG;

Database altered.

SQL> ALTER DATABASE OPEN;

Database altered.

SQL> ALTER SYSTEM SWITCH LOGFILE;

System altered.

So now you can check that archive log mode is enabled in your Oracle database.

SQL> SELECT NAME FROM V$ARCHIVED_LOG;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/fra/ORADB/archivelog/2021_04_10/o1_mf_1_19_j72qftrw_.arc

SQL> SELECT LOG_MODE FROM V$DATABASE;

LOG_MODE
------------
ARCHIVELOG

SQL> show parameter LOG_ARCHIVE_DEST_1

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1                   string      LOCATION=USE_DB_RECOVERY_FILE_
                                                 DEST
log_archive_dest_10                  string
log_archive_dest_11                  string
log_archive_dest_12                  string
log_archive_dest_13                  string
log_archive_dest_14                  string
log_archive_dest_15                  string
log_archive_dest_16                  string
log_archive_dest_17                  string
log_archive_dest_18                  string
log_archive_dest_19                  string

I hope this was helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *