Sun Cluster 3.1 Data Service for Oracle Guide

Registering and Configuring Sun Cluster HA for Oracle

This section contains the procedures that you need to configure Sun Cluster HA for Oracle.

Sun Cluster HA for Oracle Extension Properties

Use the extension properties in Table 1–2 to create your resources. Use the command scrgadm -x parameter=value to configure extension properties when you create your resource. Use the procedure in “Administering Data Service Resources” in Sun Cluster 3.1 Data Service Planning and Administration Guide to configure the extension properties if you have already created your resources. You can update some extension properties dynamically. You can update others, however, only when you create or disable a resource. The Tunable entries indicate when you can update each property. See “Standard Properties” in Sun Cluster 3.1 Data Service Planning and Administration Guide for details about all Sun Cluster properties.

Table 1–2 Sun Cluster HA for Oracle Listener Extension Properties

Name/Data Type 

Description 

LISTENER_NAME (string)

The name of the Oracle listener. 

 

Default: LISTENER

Range: None

Tunable: When disabled

 

ORACLE_HOME (string)

The path to the Oracle home directory. 

 

Default: None

Range: Minimum = 1

Tunable: When disabled

User_env (string)

A file that contains environment variables to be set before listener startup and shutdown. Those environment variables that have values that differ from Oracle defaults must be defined in this file.  

For example, a user's listener.ora file might not reside under the /var/opt/oracle directory or the $ORACLE_HOME/network/admin. directory. In this situation, the TNS_ADMIN environment variable should be defined.

The definition of each environment variable that is defined must follow the format VARIABLE_NAME=VARIABLE_VALUE. Each of these environment variables must be specified, one per line in the environment file.

 

Default: ““

Range: None

Tunable: Any time

Table 1–3 describes the extension properties that you can set for the Oracle server. For the Oracle server, you are required to set only the following extension properties:

Table 1–3 Sun Cluster HA for Oracle Server Extension Properties

Name/Data Type 

Description 

Alert_log_file (string)

Oracle alert log file. 

 

Default: None

Range: Minimum = 1

Tunable: Any time

Auto_End_Bkp (Boolean)

Specifies whether the following recovery actions are performed if an Oracle relational database management system (RDBMS) hot backup is interrupted.

  • Recognizing when a database fails to open because of files that remain in hot backup mode. This verification process occurs when Sun Cluster HA for Oracle starts.

  • Identifying and releasing all files that remain in hot backup mode.

  • Opening the database for use.

The permitted values for this property are as follows:  

  • False – Specifies that the recovery actions are not performed. This value is the default.

  • True – Specifies that the recovery actions are performed.

Default: False

Range: None

Tunable: Any time

Connect_cycle (integer)

The number of probe cycles that the server fault monitor performs before disconnecting from the database. 

 

Default: 5

Range: 099,999

Tunable: Any time

Connect_string (string)

The Oracle user and password that the server fault monitor uses to connect to the database. 

 

Default: None

Range: Minimum = 1

Tunable: Any time

Custom_action_file (string)

The absolute path of the file that defines the custom behavior of the Sun Cluster HA for Oracle server fault monitor. 

 

Default: ““

Range: None

Tunable: Any time

Introduced in release: 3.1 10/03

Debug_level (integer)

The level to which Sun Cluster HA for Oracle debug messages are logged. 

 

Default: 1

Range: 1– 100

Tunable: Any time

ORACLE_HOME (string)

The path to the Oracle home directory. 

 

Default: None

Range: Minimum = 1

Tunable: When disabled

ORACLE_SID (string)

The Oracle system identifier. 

 

Default: None

Range: Minimum = 1

Tunable: When disabled

Parameter_file (string)

The Oracle parameter file. If the Oracle parameter file is not specified, this property defaults to Oracle's default. 

 

Default: ““

Range: Minimum = 0

Tunable: Any time

Probe_timeout (integer)

The time-out value (in seconds) that the server fault monitor uses to probe an Oracle server instance. 

 

Default: 60

Range: 0 99,999

Tunable: Any time

Restart_type (string)

Specifies the entity that the server fault monitor restarts when the response to a fault is restart. The permitted values for this property are as follows: 

  • RESOURCE_GROUP_RESTART – Specifies that all resources in the resource group that contains this resource are restarted

  • RESOURCE_RESTART – Specifies that only this resource is restarted

Default: RESOURCE_GROUP_RESTART

Range: None

Tunable: Any time

User_env (string)

A file that contains environment variables to be set before server startup and shutdown. Those environment variables that have values that differ from Oracle defaults must be defined in this file.  

For example, a user's listener.ora file might not reside under the /var/opt/oracle directory or the $ORACLE_HOME/network/admin. directory. In this situation, the TNS_ADMIN environment variable should be defined.

The definition of each environment variable that is defined must follow the format VARIABLE_NAME=VARIABLE_VALUE. Each of these environment variables must be specified, one per line in the environment file.

 

Default: NULL

Range: None

Tunable: Any time

Wait_for_online (Boolean)

Wait in the START method until the database is online.

 

Default: True

Range: None

Tunable: Any time

 

How to Register and Configure Sun Cluster HA for Oracle

Use this procedure to configure Sun Cluster HA for Oracle as a failover data service. This procedure assumes that you installed the data service packages during your initial Sun Cluster installation. If you did not install the Sun Cluster HA for Oracle packages as part of your initial Sun Cluster installation, go to Installing the Sun Cluster HA for Oracle Packages to install the data service packages. Otherwise, use this procedure to configure the Sun Cluster HA for Oracle.

You must have the following information to perform this procedure.

  1. Become superuser on a cluster member.

  2. Run the scrgadm command to 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 [-h nodelist]
    -g resource-group

    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 the -h option to specify the order of the node list. If all of the nodes that are in the cluster are potential masters, you do not need to use the -h option.


  4. Verify that all of the network resources that you use have been added to your name service database.

    You should have performed this verification during the Sun Cluster installation.


    Note –

    Ensure that all of the network resources are present in the server's and client's /etc/inet/hosts file to avoid any failures because of name service lookup.


  5. Add a network resource to the failover resource group.


    # scrgadm -a -L -g resource-group -l logical-hostname [-n netiflist] 
    -l logical-hostname

    Specifies a network resource. The network resource is the logical hostname or shared address (IP address) that clients use to access Sun Cluster HA for Oracle.

    [-n netiflist]

    Specifies an optional, comma-separated list that identifies the IP Networking Multipathing groups that are on each node. Each element in netiflist must be in the form of netif@node. netif can be given as an IP Networking Multipathing group name, such as sc_ipmp0. The node can be identified by the node name or node ID, such as sc_ipmp0@1 or sc_ipmp@phys-schost-1.


    Note –

    Sun Cluster does not currently support the use of the adapter name for netif.


  6. Register the SUNW.HAStoragePlus resource type with the cluster.


    # scrgadm -a -t SUNW.HAStoragePlus

  7. Create the resource oracle-hastp-rs of type SUNW.HAStoragePlus.


    # scrgadm -a -j oracle-hastp-rs -g oracle-rg -t SUNW.HAStoragePlus \
     
    [If your database is on a raw device, specify the global device path.]
    -x GlobalDevicePaths=ora-set1,/dev/global/dsk/dl \
     
    [If your database is on a Cluster File Service, specify 
    the global file system and local file system mount points.]
    -x FilesystemMountPoints=/global/ora-inst,/global/ora-data/logs,/
    local/ora-data \
     
    [Set AffinityOn to true.]
    -x AffinityOn=TRUE
    


    Note –

    AffinityOn must be set to TRUE and the local file system must reside on global disk groups to be failover.


  8. Run the scswitch command to complete the following tasks and bring the resource group oracle-rg online on a cluster node.


    Caution – Caution –

    Be sure to switch only at the resource group level. Switching at the device group level confuses the resource group, causing it to fail over.


    • Move the resource group into a MANAGED state.

    • Bring the resource group online.

    This node is made the primary for device group ora-set1 and raw device /dev/global/dsk/d1. Device groups that are associated with file systems such as /global/ora-inst and /global/ora-data/logs are also made primaries on this node.


    # scswitch -Z -g oracle-rg
    
  9. Create Oracle application resources in the failover resource group.

    • Oracle server resource:


      # scrgadm -a -j resource -g resource-group \
      -t SUNW.oracle_server \ 
      -x Connect_string=user/passwd \
      -x ORACLE_SID=instance \
      -x ORACLE_HOME=Oracle-home \
      -x Alert_log_file=path-to-log \
      -x Restart_type=entity-to-restart
      -y resource_dependencies=storageplus-resource
      
    • Oracle listener resource:


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

    Specifies the name of the resource to add.

    -g resource-group

    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

    Specifies the user and password that the fault monitor uses to connect to the database. These settings must agree with the permissions that you set up in How to Set Up Oracle Database Permissions. If you use Solaris authorization, type a slash (/) instead of the user name and password.

    -x ORACLE_SID=instance

    Sets the Oracle system identifier.

    -x LISTENER_NAME=listener

    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.

    -x Restart_type=entity-to-restart

    Specifies the entity that the server fault monitor restarts when the response to a fault is restart. Set entity-to-restart as follows:

    • To specify that all resources in the resource group that contains this resource are restarted, set entity-to-restart to RESOURCE_GROUP_RESTART. By default, the resource group that contains this resource is restarted.

      If you set entity-to-restart to RESOURCE_GROUP_RESTART, all other resources (such as Apache or DNS) in the resource group are restarted, even if they are not faulty. Therefore, include in the resource group only the resources that you require to be restarted when the Oracle server resource is restarted.

    • To specify that only this resource is restarted, set entity-to-restart to RESOURCE_RESTART.


    Note –

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


  10. Enable the resource and fault monitoring.


    # scswitch -Z -g resource-group
    
    -Z

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

    -g resource-group

    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: resource-group-1 (failover resource group)
Oracle Resources: oracle-server-1, oracle-listener-1
Oracle Instances: ora-lsnr (listener), ora-srvr (server)
 
(Add the failover resource group to contain all of the resources.)
# scrgadm -a -g resource-group-1
 
(Add the logical hostname resource to the resource group.)
# scrgadm -a -L -g resource-group-1 -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-1 -g resource-group-1 \
-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-1 -g resource-group-1 \
-t SUNW.oracle_listener -x ORACLE_HOME=/global/oracle \
-x LISTENER_NAME=ora-lsnr
 
(Bring the resource group online.)
# scswitch -Z -g resource-group-1

Where to Go From Here

Go to Verifying the Sun Cluster HA for Oracle Installation after you register and configure Sun Cluster HA for Oracle.