Monday, February 25, 2013

Steps to Configure database in archive log mode


Please follow below steps to configure database in archive log mode.
Check if the database running archive log mode or not by using following query.
SQL> select NAME,LOG_MODE from v$database;
NAME      LOG_MODE
——— ————
RMANDV1   NOARCHIVELOG
There are two init.ora parameters we need to change before configuring database in archive log mode.
1)LOG_ARCHIVE_DEST —/u01/app/archive/rmandv1
2)LOG_ARCHIVE_FORMAT —’rmandv1%t_%s_%r.arc’
alter system set LOG_ARCHIVE_DEST=’/d01/app/archive/rmandv1′ scope =both;
alter system set LOG_ARCHIVE_FORMAT=’rmandv1%t_%s_%r.arc’ scope =spfile;
Step1)Shutdown the database
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Step2)Start  up a new instance and mount, but do not open the database.
SQL> startup mount;
ORACLE instance started.
Total System Global Area  180355072 bytes
Fixed Size                  2094896 bytes
Variable Size              88082640 bytes
Database Buffers           83886080 bytes
Redo Buffers                6291456 bytes
Database mounted.
Step3)Put the database in archive log mode
SQL> alter database archivelog;
Database altered
Now open the database
SQL> alter database open;
Database altered.
check now if your database is in archive log mode.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/archive/rmandv1
Oldest online log sequence     18
Next log sequence to archive   20
Current log sequence           20