I have done this tutorial before where I have showed how to enable archive log mode in Oracle Database 10g and 11g. Click here to check that out.
Since then so many things have changed. Oracle has switched from grid to multi-tenant architecture. So I thought to update the tutorial. But this time I have done it in even more detail. I have done a series where I showed what a DBA should do before setting up the Archive log mode in Oracle Database.
If you haven’t followed the series then here is a quick guide to what you should do before switching from NOARCHIVELOG to ARCHIVELOG mode in Oracle Database
Once you are done setting either FRA or Archive log directory then you are all set to switch from NOARCHIVELOG to ARCHIVELOG mode. And, here is how you do that –
How To Enable ArchiveLog mode in Oracle Database 18/19c.
I will be performing the procedure of enabling Archive log mode on Oracle Database 19c. You can follow the steps for any version that is 12c or later as the process is the same.
Step 1: Connect With Container Database
First connect with your container database using SYS user.
C:\> SQLPLUS / AS SYSDBA
Step 2: Check the status of log mode
Before you enable the Archive log mode just check to make sure whether it’s already enabled or not. And you can do that just by writing a simple statement, like this
SQL> ARCHIVE LOG LIST;
If the log mode of your database is set to “ARCHIVELOG” then you don’t have to do anything. But if it is set to “NOARCHIVELOG” then follow along –
Step 3: Shutdown the database
In order to switch the log mode we first need to shutdown the database
SQL> Shutdown immediate
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> STARTUP mount;
Step 5: Enable the Archive log mode.
Now we will switch the log mode from NO ARCHIVE LOG to ARCHIVE LOG mode.
SQL> ALTER DATABASE archivelog;
Step 6: Open The Database
In order to use the database for normal database activities we need to open it.
SQL> ALTER DATABASE open;
Step 7: Check The Log mode
Before we start working with our database, we must check if we have successfully enabled the ARCHIVELOG mode or not?
SQL> SELECT log_mode FROM v$database;
If the result of this statement comes out as “ARCHIVELOG” then that means we have successfully enabled the ARCHIVELOG mode in our Oracle Database.
That is how we enable ARCHIVELOG mode in Oracle Database 12c, 18c, 19c and later versions.
Hope you enjoyed this read. Thanks and have a great day!