How to change archivelog mode of the oracle database

How to change archivelog mode of the database


Most of the High Availability and Point in time Recovery features of Oracle require you to enable ARCHIVELOG mode for your database. When you enable this mode, redo logs will be archived instead of overwritten. The archive logs are stored in a separate place usually can backed up regularly by your standard filesystem backup system (NetBackup, RMAN or whatever). Archive logs are utilized by RMAN, Data Guard, Flashback and many others.

Note: It is recommended to perform a backup of the database (after a shutdown normal or immediate) prior to changing the archive status of a database.

If you are going to enable archivelog mode on a real database that is important to you, I would recommend shutting down the database and doing a cold backup just in case. Keeping a "final noarchivelog mode backup" seems to be a good and excepted practice.

Enabling archive mode is simple, just connect to your database in mounted but closed mode (startup mount) and alter the database. But if you don't tune a little you'll run into problems down the road, so let’s specify some parameters too. Namely, consider LOG_ARCHIVE_DEST.

NOTE: Production database must be in archivelog mode.

-- Execute the following command to check the archival mode of your database.


To change the archival mode of the database, Please follow the following statement(s):

1.    Shutdown the database.
2.    If you wish you can specify log location in pfile, else they will go into some default place like DB_RECOVERY_FILE_DEST.
3.    Start the database in mount state.
4.    Alter the archivelog mode of the database.
5.    Alter the database into open mode.

You can also use pfile for this operation. You can specify as many as 10 different archive log destinations by using the parameters log_archive_dest_1 through log_archive_dest_10. Remember, if you run out of space in your archive log destination the database will shut down!
 
You should check whether init.ora for your particular instance is present or not in the default directory say <ORACLE_HOME/dbs>. If it not present then issue below command to create it before closing the database.
 
sql> create pfile from spfile;
 
Now you can shutdown the database to make necessary changes.

Once you are satisfied with the changes in initialization file, you should create the 
corresponding spfile by issuing:

sql> create spfile from pfile;

It will go into the default location.

############################
# Archive Log Destinations
############################
log_archive_dest_1='location=/u03/oraarch/mynewdb/arclog/'
# If you want to change archive log format.
LOG_ARCHIVE_FORMAT = 'mynewdb_arc_%t_%s_%r.arc'

ARCHIVELOG | NOARCHIVELOG

Use the ARCHIVELOG clause and NOARCHIVELOG clause only if your instance has the database mounted but not open.

To see current archivelog mode either use
Sql> archive log list
OR
SQL> select name, log_mode from v$database;

Noarchivelog    ===>>>   Archivelog

SQL> archive log list

Sql> shutdown immediate

SQL> startup mount

SQL> alter database archivelog;
Database altered.

SQL> alter database open;
Database altered.

SQL> archive log list

Archivelog    ===>>>   Noarchivelog
SQL> archive log list

Sql> shutdown immediate

SQL> startup mount

SQL> alter database noarchivelog;
Database altered.

SQL> alter database open;
Database altered.

SQL> archive log list

Comments

Back To Top

Popular posts from this blog

How to save video from Internet Explorer

error 18 at 0 depth lookup: self signed certificate

How to check fragmentation in MySQL tables