In this article we will look at enabling and disabling database archivelog mode. Check Archivelog Mode. You can use any of the below queries to check database archivelog mode status. When a database is in archive log mode chances of data loss are minimal. Here is a step by step procedure of how to enable archive logging in an Oracle database. First and foremost this requires you to change a few parameters in the parameter file and also shut down the database.
To enable archivelog mode in RAC perform the below steps.
Step 1) Taket he sqlplus connection and verify the mount state of the RAC DB
SQL> select instance_name,status from gv$instance;
INSTANCE_NAME STATUS
—————- ————
PRDDB1 OPEN
PRDDB2 OPEN
Step 2) check the archivelog mode
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Step 3) Add the archive log location to the database
SQL> alter system set log_archive_dest_1=’LOCATION=+ARCH’ SCOPE=SPFILE SID=’*’;
Step 4) Add the archive log format this is optional step
SQL> ALTER SYSTEM SET LOG_ARCHIVE_FORMAT=’%t_%s_%r.arc’ SCOPE=SPFILE SID=’*’;
Step 5) Stop the DATABASE
[oracle@prddb01 ~]$ srvctl stop database -d PRDDB
Step 6) Start the database in mount stage
[oracle@prddb01 ~]$ srvctl stop database -d PRDDB -o mount
[oracle@prddb01 ~]$ srvctl status database -d PRDDB
Instance PRDDB1 is running on node prddb01
Instance PRDDB2 is running on node prddb02
Step 7) verfiy the db instance state from SQLPLUS
[oracle@prddb01 ~]$ sqlplus sys as sysdba
SQL> select instance_name,status from gv$instance;
INSTANCE_NAME STATUS
————— ————
PRDDB1 MOUNTED
PRDDB2 MOUNTED
Step 8) Enable Archivemode on DB
![Alter Database Archivelog Enable Alter Database Archivelog Enable](https://i1.wp.com/databasetips.net/wp-content/uploads/2018/12/archivelogmode.png?resize=694%2C540)
Alter Database Oracle
SQL> alter database archivelog;
Database altered.
Step 9) Stop and Start the DB.
![Alter Database Archivelog Enable Alter Database Archivelog Enable](https://img.yumpu.com/17918332/1/500x640/backup-and-recovery-concepts.jpg)
[oracle@prddb01 ~]$ srvctl stop database -d PRDDB
[oracle@prddb01 ~]$ srvctl start database -d PRDDB
[oracle@prddb01 ~]$ sqlplus ‘/ as sysdba’
Alter Database Archivelog Enable Command
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +ARCH
![](https://cdn-ak.f.st-hatena.com/images/fotolife/r/ruriatunifoefec/20200910/20200910011327.png)