Sun Cluster 3.0 Data Services Installation and Configuration Guide

Registering and Configuring Sun Cluster HA for Oracle

Sun Cluster HA for Oracle is registered and configured as a failover data service. You must register the data service and configure resource groups and resources for the Oracle server and listener. For details on resources and resource groups, see Chapter 1, Planning for Sun Cluster Data Services and the Sun Cluster 3.0 Concepts document.

How to Register and Configure Sun Cluster HA for Oracle

To register and configure the Sun Cluster HA for Oracle data service, use the Cluster Module of Sun Management Center or the following command-line procedure.

To perform this procedure, you must have the following information:

Perform this procedure on any cluster member.

  1. Become superuser on a node in the cluster.

  2. Register the resource types for the data service.

    For Sun Cluster HA for Oracle, you register two resource types, SUNW.oracle_server and SUNW.oracle_listener, as follows:


    # scrgadm -a -t SUNW.oracle_server
    # scrgadm -a -t SUNW.oracle_listener
    
    -a

    Adds the data service resource type.

    -t SUNW.oracle_type

    Specifies the predefined resource type name for your data service.

  3. Create a failover resource group to hold the network and application resources.

    You can optionally select the set of nodes on which the data service can run with the -h option, as follows:


    # scrgadm -a -g resource-group-name [-h nodelist]
    -g resource-group-name

    Specifies the name of the resource group. This name can be your choice but must be unique for resource groups within the cluster.

    -h nodelist

    Specifies an optional comma-separated list of physical node names or IDs that identify potential masters. The order here determines the order in which the nodes are considered as primary during failover.


    Note -

    Use -h to specify the order of the node list. If all the nodes in the cluster are potential masters, you need not use the -h option.


  4. Verify that all logical host names that you are using have been added to your name service database.

    You should have done this verification as part of the Sun Cluster installation.


    Note -

    To avoid any failures because of name service lookup, ensure that all logical host names are present in the server's and client's /etc/hosts file.


  5. Add a logical host name to the failover resource group.


    # scrgadm -a -L -g resource-group-name -l logical-hostname \
    [-j resource-name] [-n network-interface-id-list] 
    -l logical-hostname

    Specifies a logical hostname.

    -j resource-name

    An optional name for the logical host name resource. If a name is not specified, the default resource name is the first name to appear after the -l option.

    -n network-interface-id-list

    An optional comma-separated list that identifies the NAFO groups on each node. All nodes in nodelist of the resource group must be represented in the network-interface-list. If you do not specify this option, scrgadm attempts to discover a net adapter on the subnet identified by the hostname list for each node in nodelist.

  6. Create Oracle application resources in the failover resource group.


    # scrgadm -a -j resource-name -g resource-group-name \
    
    -t SUNW.oracle_server \ 
    -x Connect_string=user/passwd \
    -x ORACLE_SID=instance-name \
    -x ORACLE_HOME=Oracle-home \
    -x Alert_log_file=path-to-log
    

    # scrgadm -a -j resource-name -g resource-group-name \
    
    -t SUNW.oracle_listener \ 
    -x LISTENER_NAME=listener-name \
    -x ORACLE_HOME=Oracle-home
    
    -j resource-name

    Specifies the name of the resource to add.

    -g resource-group-name

    Specifies the name of the resource group into which the resources are to be placed.

    -t SUNW.oracle_server/listener

    Specifies the type of the resource to add.

    -x Alert_log_file=path-to-log

    Sets the path under $ORACLE_HOME for the server message log.

    -x Connect_string=user/passwd

    The user and password used by the fault monitor to connect to the database. These settings must agree with the permissions you set up in "How to Set Up Oracle Database Permissions". If you are using Solaris authorization, type a slash (/) instead of the user name and password.

    -x ORACLE_SID=instance-name

    Sets the Oracle system identifier.

    -x LISTENER_NAME=listener-name

    Sets the name of the Oracle listener instance. This name must match the corresponding entry in listener.ora.

    -x ORACLE_HOME=Oracle-home

    Sets the path to the Oracle home directory.


    Note -

    Optionally, you can set additional extension properties that belong to the Oracle data service to override the default value. See "Configuring Sun Cluster HA for Oracle Extension Properties" for a list of extension properties.


  7. Enable the resource and fault monitoring, then move the resource group into a managed state and bring it online.


    # scswitch -Z -g resource-group-name
    
    -Z

    Enables the resource and monitor, moves the resource group to the managed state, and brings it online.

    -g resource-group-name

    Specifies the name of the resource group.

Example-Registering Sun Cluster HA for Oracle

The following example shows how to register Sun Cluster HA for Oracle on a two- node cluster.


Cluster Information
Node names: phys-schost-1, phys-schost-2
Logical Hostname: schost-1
Resource group: oracle-rg (failover resource group), Oracle Resources: oracle-server, oracle-listener,Oracle Instances: ora-lsnr (listener), ora-srvr (server)
 
(Add the failover resource group to contain all the resources.)
# scrgadm -a -g oracle-rg
 
(Add the logical hostname resource to the resource group.)
# scrgadm -a -L -g oracle-rg -l schost-1 
 
(Register the Oracle resource types)
# scrgadm -a -t SUNW.oracle_server
# scrgadm -a -t SUNW.oracle_listener
 
(Add the Oracle application resources to the resource group.)
# scrgadm -a -j oracle-server -g oracle-rg \
-t SUNW.oracle_server -x ORACLE_HOME=/global/oracle \
-x Alert_log_file=/global/oracle/message-log \
-x ORACLE_SID=ora-srvr -x Connect_string=scott/tiger
 
# scrgadm -a -j oracle-listener -g oracle-rg \
-t SUNW.oracle_listener -x ORACLE_HOME=/global/oracle \
-x LISTENER_NAME=ora-lsnr
 
(Bring the resource group online.)
# scswitch -Z -g oracle-rg

How to Configure SUNW.HAStorage Resource Type

The SUNW.HAStorage resource type synchronizes actions between HA storage and data service. Because Sun Cluster HA for Oracle is disk-intensive, we strongly recommend that you set up SUNW.HAStorage.

For details on the background, see the SUNW.HAStorage(5) man page and "Relationship Between Resource Groups and Disk Device Groups". For the procedure, see "How to Set Up SUNW.HAStorage Resource Type for New Resources".