Monday, November 19, 2007

converting Noarchivelog to archive log mode in RAC

The Steps that we followed while enabling archivelog mode in a RAC database.

steps:
-1) Backup the database!
0) Shut down all instances of the database, except the one upon which
the changes will be made.
1) alter system set cluster_database=false scope=spfile;
-- verification
---------------
SQL> show parameter cluster_database

NAME TYPE VALUE
------------------------------------ -----------
------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2

2) shut down and startup the same instance in 'MOUNT EXCLUSIVE';
ORACLE instance started.

Total System Global Area 599785472 bytes
Fixed Size 780280 bytes
Variable Size 166729736 bytes
Database Buffers 432013312 bytes
Redo Buffers 262144 bytes
Database mounted.

-- verification
---------------
SQL> show parameter cluster_database

NAME TYPE VALUE
------------------------------------ -----------
------------------------------
cluster_database boolean FALSE
cluster_database_instances integer 1


3) Set the required parameters.
SQL> ALTER SYSTEM SET log_archive_start=TRUE scope=SPFILE;

System altered.

SQL> ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' scope=SPFILE;

System altered.

SQL> ALTER SYSTEM SET log_archive_dest='/u01/app/oracle/oradata/bmc/arch/'
scope=SPFILE;

System altered.

4) shut the database and STARTUP MOUNT

SQL> SELECT name,open_mode FROM v$database;

NAME OPEN_MODE
--------- ----------
BMC MOUNTED

5) Enable ARCHIVELOG mode

SQL> alter database archivelog;

Database altered.

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/oradata/bmc/arch/
Oldest online log sequence 16
Next log sequence to archive 17
Current log sequence 17
SQL> select name,open_mode from v$database;

NAME OPEN_MODE
--------- ----------
BMC MOUNTED

6) Set cluster_database=true again.
SQL> alter system set cluster_database=true scope=spfile;

System altered.

7) Shut down and restart all the instances.

Our database is now in ArchiveLog Mode.

The above process has been tried and tested on our database. If anyone out
there suggest a better way to do the same, please feel free to let me know.