ORACLE HA on SUN CLUSTER 2.2 ARCHITECTURE: 420R x 2 (2 nodes) node 1: wlsora1 node 2: wlsora2 A5200 x 2 (Storage) Disk group: rootdg Disk Group: wlsdg01 CLUSTER CONFIGURATION: 1 Logical Host: wlsoracle 1 DataBase: oradata mount point : /opt/oracledata ccd : /wlsoracle Data Service: oracle ORACLE HA $ORACLE_SID : vignette $ORACLE_HOME : /opt/oracle/product/8.1.6 $ORACLE_BASE : /opt/oracle STEPS FOR SETTING UP SUN CLUSTER HA FOR ORACLE 1. Sun Cluster needs to be running # scadmin startcluster wlsora1 wlsora (Make sure that the node is the ownership of the disk group) 2. Prepare database configuration files Place all parameter files, data files, redolog files and control files on the logical hosts (disk group) In this case: /opt/oracle/admin -> /wlsoracle (logicalhost (diskgroup) /opt/oracle/prodcut/8.1.6/dbs -> /wlsoracle * copy the directory * After that check the permissions and the ownership (owner: oracle group: oinstall) 3. Make SID entris for the Sun Cluster HA for Oracle databses of all database instance /var/opt/oracle/oratab add the next line ( ORACLE_SID:ORACLE_HOME:N ) : vignette:/opt/oracle/product/8.1.6:N 4. Authentication method : Oracle authentication a. Enable access for the user and password to be used for FAULT MONITORING As oracle user run: # svrmgrl SVRMGRL> connect internal; SVRMGRL> grand connect, resource to oracle identified by oracle; SVRMGRL> alter user oracle default tablespace system quota 1m on system; SVRMGRL> grant select on v_$sysstat to oracle; SVRMGRL> grant create session to oracle; SVRMGRL> grant create table to oracle; SVRMGRL> disconnect; SVRMGRL> exit; We used oracle account but we could use some account that is alreday created like system account. Then: username: oracle password: oracle 5. Create and update the tnsnames.ora and listener.ora files under /var/opt/oracle on ALL NODES. NOTE: these files are links and their ownership is owner: oracle group: oinstall permissions: lrwxrwxrwx the real location is : listener.ora -> /opt/oracle/product/8.1.6/network/admin/listener.ora tnsnames.ora -> /opt/oracle/product/8.1.6/network/admin/tnsnames.ora This is the listener.ora file: ################################################################################################ LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = wlsoracle)(PORT = 1521)) # the HOST is the LOGICAL HOST NAME ) ) (DESCRIPTION = (PROTOCOL_STACK = (PRESENTATION = GIOP) (SESSION = RAW) ) (ADDRESS = (PROTOCOL = TCP)(HOST = wlsoracle)(PORT = 2481)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /opt/oracle/product/8.1.6) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = vignette) # The GLOBAL_DBNAME is the ORACLE_SID (ORACLE_HOME = /opt/oracle/product/8.1.6) (SID_NAME = vignette) # The SID_NAME is the ORACLE_SID ) ) ################################################################################################ This is the tnsnames.ora file: ################################################################################################ VIGNETTE = # SERVICE NAME (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = wlsoracle)(PORT = 1521)) # the HOST is the LOGICAL HOST NAME ) (CONNECT_DATA = (SID = vignette) # The SID is the ORACLE_SID ) ) EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) ) ################################################################################################ 6. Verify that Sun Cluster and the cluster daemon are installed and running on all hosts # hastat 7. Register and activate Sun Cluster HA for Oracle # hareg -s -r oracle -h wlsoracle NOTE: wlsoracle is the LOGICAL HOST 8. If the cluster is running already, activate the ORACLE DATA SERVICE: # hareg -y oracle 9. Before continue, first check the status of data service: # cd /opt/SUNWcluster/bin # hastat | more ############################################### STATUS OF DATA SERVICES RUNNING IN THE CLUSTER Status Of Registered Data Services oracle: On ############################################### 10. Setup Sun Cluster HA for Oracle configuration data: The instance will be monitored by Sun Cluster: # haoracle insert $ORACLE_SID wlsoracle 60 10 120 300 oracle/oracle /wlsoracle$ORACLE_HOME/dbs/init$ORACLE_SID.ora LISTENER $ORACLE_SID = vignette wlsoracle = LOGICALHOST 60 = probe cycle time 10 = connectivity probe cycle count 120 = probe time out 300 = restart delay oracle/oracle = user/password ( user that was created in the step 4 ) /wlsoracle$ORACLE_HOME/dbs/init$ORACLE_SID.ora = indicates the pfile to use to start up the database. This must be on a logical host's disk group. LISTENER = Oracle listener. 11. Bring the database instance into service # cd /opt/SUNWcluster/bin # haoracle start $ORACLE_SID NOTE: if you did not start the Oracle instance before issusing the haoracle command, Sun Cluster will start the Oracle instance for you when you issue the command. 12. Check the status of data service running: # cd /opt/SUNWcluster/bin # hastat | more ############################################### STATUS OF DATA SERVICES RUNNING IN THE CLUSTER Status Of Registered Data Services oracle: On Status Of Data Services Running On wlsora1 Data Service "oracle": Database Status on wlsora1: vignette - running; Status Of Data Services Running On wlsora2 Data Service "oracle": Not being managed on this system ############################################### 13. Verify the Sun Cluster HA for Oracle # haswitch wlsora2 wlsoracle # haswitch phys-hahost2 logicalhost and repeat again from the other host ( phys-hahost2) # haswitch wlsora1 wlsoracle # haswitch phys-hahost1 logicalhost