Register and configure the Sun Cluster HA for Oracle data service as a failover data service. You must register the data service and configure resource groups and resources for the Oracle server and listener. See Chapter 1, Planning for Sun Cluster Data Services and the Sun Cluster 3.0 U1 Concepts document for details on resources and resource groups.
This procedure describes how to use the scrgadm command to register and configure the Sun Cluster HA for Oracle data service.
Other options also enable you to register and configure the data service. See "Tools for Data-Service Resource Administration" for details about these options.
You must have the following information to perform this procedure.
The names of the cluster nodes that master the data service.
The logical hostname that clients use to access the data service. Normally, you set up this IP address when you install the cluster. See the section on how to set up logical hostnames in the Sun Cluster 3.0 U1 Installation Guide for details.
The path to the Oracle application binaries for the resources that you plan to configure.
Perform this procedure on any cluster member.
Become superuser on a cluster member.
Run the scrgadm command to register the resource types for the data service.
For the Sun Cluster HA for Oracle data service, 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 |
Adds the data service resource type.
Specifies the predefined resource type name for your data service.
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] |
Specifies the name of the resource group. This name can be your choice but must be unique for resource groups within the cluster.
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.
Use the -h option to specify the order of the node list. If all the nodes in the cluster are potential masters, you do not need to use the -h option.
Verify that all logical hostnames that you use have been added to your name-service database.
You should have performed this verification during the Sun Cluster installation.
Ensure that all logical hostnames are present in the server's and client's /etc/hosts file to avoid any failures because of name-service lookup.
Add a logical hostname to the failover resource group.
# scrgadm -a -L -g resource-group -l logical-hostname \ [-j resource] [-n netiflist] |
Specifies a logical hostname.
An optional name for the logical-hostname resource. If a name is not specified, the default resource name is the first name to appear after the -l option.
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 netiflist. If you do not specify this option, scrgadm attempts to discover a net adapter on the subnet that the hostname list identifies for each node in nodelist.
Create Oracle application resources in the failover resource group.
# 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 |
# scrgadm -a -j resource -g resource-group \ -t SUNW.oracle_listener \ -x LISTENER_NAME=listener \ -x ORACLE_HOME=Oracle-home |
Specifies the name of the resource to add.
Specifies the name of the resource group into which the resources are to be placed.
Specifies the type of the resource to add.
Sets the path under $ORACLE_HOME for the server message log.
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.
Sets the Oracle system identifier.
Sets the name of the Oracle listener instance. This name must match the corresponding entry in listener.ora.
Sets the path to the Oracle home directory.
When a fault occurs in an Oracle server resource that causes a restart, the whole resource group is restarted. Any other resources (such as Apache or DNS) in the resource group are restarted, even if they did not have a fault. To prevent other resources from being restarted along with an Oracle server resource, put them in a separate resource group.
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.
Run the scswitch command to complete the following tasks.
Enable the resource and fault monitoring.
Move the resource group into a managed state.
Bring the resource group online.
# scswitch -Z -g resource-group |
Enables the resource and monitor, moves the resource group to the managed state, and brings it online.
Specifies the name of the resource group.
The following example shows how to register the Sun Cluster HA for Oracle data service 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 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 |
The SUNW.HAStorage resource type synchronizes actions between HA storage and the data service. The Sun Cluster HA for Oracle data service is disk-intensive, and therefore you should configure the SUNW.HAStorage resource type.
See the SUNW.HAStorage(5) man page and "Relationship Between Resource Groups and Disk Device Groups" for background information. See "How to Set Up SUNW.HAStorage Resource Type for New Resources" for the procedure.
Go to "Verifying the Sun Cluster HA for Oracle Installation" after you register and configure the Sun Cluster HA for Oracle data service.