Home » Oracle » Oracle Database » How to enable archivelog mode in Oracle & Disable it

How to enable archivelog mode in Oracle & Disable it

In this post, we will check about How to enable archivelog mode in Oracle ( alter database archivelog) in Both Single instance and RAC environments. We will also get to see how to disable the archivelog (alter database noarchivelog) in Both Single and RAC environments. We will also look at the common error ORA-00265. There may be many reasons to enable the archive log mode. You want to enable online backup, you want Datagaurd, and You want point-in-time recovery of the Oracle database.

How to enable archivelog mode in Oracle

Before enabling archivelog mode, please make sure RECOVERY_DEST is set to the right location and has good space. If you not using RECOVERY_DEST for archiving, then make sure the path given is correct and has good space. You will have database downtime to enable archivelog mode. Here is the sequence of steps to enable archivelog mode

SQL> Shutdown immediate
SQL>Startup mount
SQL>Alter database archivelog;
SQL> Alter database Open;
Verify Using
SQL> ARCHIVE LOG LIST
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FLASH
Oldest online log sequence 1199
Next log sequence to archive 1298
Current log sequence 1298

How to enable archivelog mode in Oracle RAC

Stop the Database
srvctl stop database -d TEST
Mount the database
srvctl start database -d RAC -o mount
Enable Archive log mode
sqlplus "/ as sysdba"
alter database archivelog;
Shutdown and startup the cluster
srvctl stop database -d TEST
srvctl start database -d TEST

ora-00265: instance recovery required, cannot set archivelog mode

If you are getting ORA-00265 while putting the database in archivelog, then you must have shut down the DB in abort mode. If that is the case, then do these steps to prevent this error

SQL> Startup
SQL> shutdown immediate
SQL>Alter database archivelog;
SQL> Alter database Open;
Verify Using
SQL> ARCHIVE LOG LIST
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FLASH
Oldest online log sequence 1199
Next log sequence to archive 1298
Current log sequence 1298

This can happen in the RAC instance as sometimes, the srvctl command aborts the Database, if it does shut down in time, then do this

Stop the Database
srvctl stop database -d TEST
start the database
srvctl start database -d TEST
Mount the database
srvctl start database -d RAC -o mount
Enable Archive log mode
sqlplus "/ as sysdba"
alter database archivelog;
Shutdown and startup the cluster
srvctl stop database -d TEST
srvctl start database -d TEST

How to Disable archivelog mode in Oracle

You will have database downtime to disable archivelog mode. Here is the sequence of steps to disable archivelog mode

SQL> Shutdown immediate
SQL>Startup mount
SQL>Alter database noarchivelog;
SQL> Alter database Open;
Verify Using
SQL> ARCHIVE LOG LIST

How to disable archivelog mode in Oracle RAC

Stop the Database
srvctl stop database -d TEST
Mount the database
srvctl start database -d RAC -o mount
Disable Archive log mode
sqlplus "/ as sysdba"
alter database noarchivelog;
Shutdown and startup the cluster
srvctl stop database -d TEST
srvctl start database -d TEST

How to enable /disable in Container Database

These enable and disable commands are valid for the Container database (CDB) also. we can’t have separate archiving for the PDBs, the steps are executed at the CDB level only. So steps remain the same in 12c, 18c, and 19c Container databases.

See also  ORA-03113: end-of-file on communication channel

I hope you like this content on How to enable archivelog mode in Oracle

Related Articles
how to find archive log sequence number in oracle
Oracle DBA scripts
alter system switch logfile
alter table move
How to purge AUD$ table in Oracle
srvctl commands
https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12007.htm

Leave a Comment

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

Scroll to Top