How To Enable Archive Mode In RAC

How to enable the archive mode in three nodes RAC environment,this is what the page will talk about.

ref doc:How To Enable/Disable Archive Log Mode in Real Application Cluster Environment (Doc ID 235158.1)

1.the current information of RAC

[oracle@node3 ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....a1.inst application    ONLINE    ONLINE    node1
ora....a2.inst application    ONLINE    ONLINE    node2
ora....a3.inst application    ONLINE    ONLINE    node3
ora.aaa.db     application    ONLINE    ONLINE    node1
ora....E1.lsnr application    ONLINE    ONLINE    node1
ora.node1.gsd  application    ONLINE    ONLINE    node1
ora.node1.ons  application    ONLINE    ONLINE    node1
ora.node1.vip  application    ONLINE    ONLINE    node1
ora....E2.lsnr application    ONLINE    ONLINE    node2
ora.node2.gsd  application    ONLINE    ONLINE    node2
ora.node2.ons  application    ONLINE    ONLINE    node2
ora.node2.vip  application    ONLINE    ONLINE    node2
ora....E3.lsnr application    ONLINE    ONLINE    node3
ora.node3.gsd  application    ONLINE    ONLINE    node3
ora.node3.ons  application    ONLINE    ONLINE    node3
ora.node3.vip  application    ONLINE    ONLINE    node3

2.prepare the arch directory for on each node.(3 directories for each node)

[oracle@node1 oracle]$ mkdir  arch1
[oracle@node1 oracle]$ mkdir  arch2
[oracle@node1 oracle]$ mkdir  arch3
[oracle@node1 oracle]$ pwd
/opt/app/oracle
[oracle@node1 oracle]$ ll
total 24
drwxr-xr-x 3 oracle oinstall 4096 Aug 12  2012 admin
drwxr-xr-x 2 oracle oinstall 4096 Nov 13 20:19 arch1
drwxr-xr-x 2 oracle oinstall 4096 Nov 13 20:19 arch2
drwxr-xr-x 2 oracle oinstall 4096 Nov 13 20:19 arch3
drwxrwx--- 7 oracle oinstall 4096 Aug 14 20:13 oraInventory
drwxrwxr-x 3 oracle oinstall 4096 Aug 11  2012 product

We have three dir in $ORACLE_BASE in each node,named arch1,arch2,arch3.

3.set the archive path for all the nodes

[oracle@node1 ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....a1.inst application    ONLINE    ONLINE    node1
ora....a2.inst application    ONLINE    ONLINE    node2
ora....a3.inst application    ONLINE    ONLINE    node3
ora.aaa.db     application    ONLINE    ONLINE    node3
ora....E1.lsnr application    ONLINE    ONLINE    node1
ora.node1.gsd  application    ONLINE    ONLINE    node1
ora.node1.ons  application    ONLINE    ONLINE    node1
ora.node1.vip  application    ONLINE    ONLINE    node1
ora....E2.lsnr application    ONLINE    ONLINE    node2
ora.node2.gsd  application    ONLINE    ONLINE    node2
ora.node2.ons  application    ONLINE    ONLINE    node2
ora.node2.vip  application    ONLINE    ONLINE    node2
ora....E3.lsnr application    ONLINE    ONLINE    node3
ora.node3.gsd  application    ONLINE    ONLINE    node3
ora.node3.ons  application    ONLINE    ONLINE    node3
ora.node3.vip  application    ONLINE    ONLINE    node3
set the path of archive
alter system set log_archive_dest_1='LOCATION=/opt/app/oracle/arch1' scope=spfile sid='aaa1'
alter system set log_archive_dest_1='LOCATION=/opt/app/oracle/arch2' scope=spfile sid='aaa2'
alter system set log_archive_dest_1='LOCATION=/opt/app/oracle/arch3' scope=spfile sid='aaa3'

SQL> alter system set log_archive_dest_1='LOCATION=/opt/app/oracle/arch1' scope=spfile sid='aaa1';

System altered.

SQL> alter system set log_archive_dest_1='LOCATION=/opt/app/oracle/arch2' scope=spfile sid='aaa2';

System altered.

SQL> alter system set log_archive_dest_1='LOCATION=/opt/app/oracle/arch3' scope=spfile sid='aaa3';

System altered.

4.shutdown all the instance

[oracle@node1 ~]$ srvctl stop instance -d aaa -i aaa1
[oracle@node1 ~]$ srvctl stop instance -d aaa -i aaa2
[oracle@node1 ~]$ srvctl stop instance -d aaa -i aaa3

[oracle@node1 ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....a1.inst application    OFFLINE   OFFLINE
ora....a2.inst application    OFFLINE   OFFLINE
ora....a3.inst application    OFFLINE   OFFLINE
ora.aaa.db     application    OFFLINE   OFFLINE
ora....E1.lsnr application    ONLINE    ONLINE    node1
ora.node1.gsd  application    ONLINE    ONLINE    node1
ora.node1.ons  application    ONLINE    ONLINE    node1
ora.node1.vip  application    ONLINE    ONLINE    node1
ora....E2.lsnr application    ONLINE    ONLINE    node2
ora.node2.gsd  application    ONLINE    ONLINE    node2
ora.node2.ons  application    ONLINE    ONLINE    node2
ora.node2.vip  application    ONLINE    ONLINE    node2
ora....E3.lsnr application    ONLINE    ONLINE    node3
ora.node3.gsd  application    ONLINE    ONLINE    node3
ora.node3.ons  application    ONLINE    ONLINE    node3
ora.node3.vip  application    ONLINE    ONLINE    node3

5.enable the archive mode in node1

start the instance to mount stage

[oracle@node1 oracle]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Nov 13 21:22:31 2013

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  2095704 bytes
Variable Size             176162216 bytes
Database Buffers          100663296 bytes
Redo Buffers                6291456 bytes
Database mounted.
SQL>

SQL> alter database archivelog;

Database altered.

open the instance

SQL> alter database open;

Database altered.

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

[oracle@node1 oracle]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....a1.inst application    ONLINE    ONLINE    node1
ora....a2.inst application    OFFLINE   OFFLINE
ora....a3.inst application    OFFLINE   OFFLINE
ora.aaa.db     application    ONLINE    ONLINE    node2
ora....E1.lsnr application    ONLINE    ONLINE    node1
ora.node1.gsd  application    ONLINE    ONLINE    node1
ora.node1.ons  application    ONLINE    ONLINE    node1
ora.node1.vip  application    ONLINE    ONLINE    node1
ora....E2.lsnr application    ONLINE    ONLINE    node2
ora.node2.gsd  application    ONLINE    ONLINE    node2
ora.node2.ons  application    ONLINE    ONLINE    node2
ora.node2.vip  application    ONLINE    ONLINE    node2
ora....E3.lsnr application    ONLINE    ONLINE    node3
ora.node3.gsd  application    ONLINE    ONLINE    node3
ora.node3.ons  application    ONLINE    ONLINE    node3
ora.node3.vip  application    ONLINE    ONLINE    node3
[oracle@node1 oracle]$

open the other instances on each nodes

[oracle@node1 oracle]$ srvctl start instance -d aaa -i aaa2
[oracle@node1 oracle]$ srvctl start instance -d aaa -i aaa3

[oracle@node1 oracle]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....a1.inst application    ONLINE    ONLINE    node1
ora....a2.inst application    ONLINE    ONLINE    node2
ora....a3.inst application    ONLINE    ONLINE    node3
ora.aaa.db     application    ONLINE    ONLINE    node2
ora....E1.lsnr application    ONLINE    ONLINE    node1
ora.node1.gsd  application    ONLINE    ONLINE    node1
ora.node1.ons  application    ONLINE    ONLINE    node1
ora.node1.vip  application    ONLINE    ONLINE    node1
ora....E2.lsnr application    ONLINE    ONLINE    node2
ora.node2.gsd  application    ONLINE    ONLINE    node2
ora.node2.ons  application    ONLINE    ONLINE    node2
ora.node2.vip  application    ONLINE    ONLINE    node2
ora....E3.lsnr application    ONLINE    ONLINE    node3
ora.node3.gsd  application    ONLINE    ONLINE    node3
ora.node3.ons  application    ONLINE    ONLINE    node3
ora.node3.vip  application    ONLINE    ONLINE    node3

6.check out the information of archive mode in RAC

//on node1
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/app/oracle/arch1
Oldest online log sequence     145
Next log sequence to archive   147
Current log sequence           147

//on node2
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/app/oracle/arch1
Oldest online log sequence     145
Next log sequence to archive   147
Current log sequence           147

//on node3
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/app/oracle/arch3
Oldest online log sequence     8
Next log sequence to archive   9
Current log sequence           9

//try to generate a archive log file manually

SQL>  alter system switch logfile;

System altered.

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
[oracle@node3 ~]$ cd $ORACLE_BASE/arch3
[oracle@node3 arch3]$ ll
total 4460
-rw-rw---- 1 oracle oinstall 4552192 Nov 13 21:35 3_9_791116323.dbf

attention:this parameter cluster_database has not been used in the whole process