Step 1: Connect With Container Database
[oracle@oracle-db-19c ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 1 12:32:21 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
Step 2: Check the status of log mode
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/oracle/product/19.3.0/dbhome_1/dbs/arch
Oldest online log sequence 124
Current log sequence 126
SQL>
Step 3: Shutdown the database
In order to switch the log mode we first need to shutdown the database.
SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
Step 4: Mount The Database
To perform the ALTER DDL statement (that we need to do in order to switch the log mode) we need to mount the database first.
SQL>
SQL> startup mount;
ORACLE instance started.
Total System Global Area 629145392 bytes
Fixed Size 9137968 bytes
Variable Size 385875968 bytes
Database Buffers 218103808 bytes
Redo Buffers 16027648 bytes
Database mounted.
SQL>
Step 5: Enable the Archive log mode.
SQL>
SQL> alter database archivelog;
Database altered.
SQL>
Step 6: Open The Database
In order to use the database for normal database activities we need to open it.
SQL>
SQL> alter database open;
Database altered.
SQL>
Step 7: Check The Log mode
SQL>
SQL> set pagesize 200
SQL> set linesize 200
SQL> select log_mode from v$database;
LOG_MODE
------------------------------------
ARCHIVELOG
SQL>
If the result of this statement comes out as “ARCHIVELOG” then that means we have successfully enabled the ARCHIVELOG mode in our Oracle Database.