Sun Cluster 3.1 Data Service for Oracle

Installing and Configuring Sun Cluster HA for Oracle

This chapter contains the following procedures.


Note –

You can use SunPlex Manager to install and configure this data service. See the SunPlex Manager online help for details.


Installing and Configuring Sun Cluster HA for Oracle

Table 1–1 lists the tasks for installing and configuring Sun Cluster HA for Oracle. Perform these tasks in the order that they are listed.

Table 1–1 Task Map: Installing and Configuring HA for Oracle

Task 

For Instructions, Go To 

Plan the Sun Cluster HA for Oracle installation and configuration. 

Planning the Sun Cluster HA for Oracle Installation and Configuration

Prepare the nodes and disks 

Preparing the Nodes and Disks

Install the Oracle software 

How to Install the Oracle Software

Verify the Oracle installation 

How to Verify the Oracle Installation

Create an Oracle database 

How to Create an Oracle Database

Set up Oracle database permissions 

How to Set Up Oracle Database Permissions

Install the Sun Cluster HA for Oracle packages 

How to Install Sun Cluster HA for Oracle Packages

Register and configure Sun Cluster HA for Oracle 

How to Register and Configure Sun Cluster HA for Oracle

Verify the Sun Cluster HA for Oracle installation 

How to Verify the Oracle Installation

Understand Sun Cluster HA for Oracle fault monitor 

Understanding Sun Cluster HA for Oracle Fault Monitor

Planning the Sun Cluster HA for Oracle Installation and Configuration

This section contains the information you need to plan your Sun Cluster HA for Oracle installation and configuration.

Configuration Requirements


Caution – Caution –

Your data service configuration might not be supported if you do not adhere to these requirements.


Use the requirements in this section to plan the installation and configuration of Sun Cluster HA for Oracle. These requirements apply to Sun Cluster HA for Oracle only. You must meet these requirements before you proceed with your Sun Cluster HA for Oracle installation and configuration.

For requirements that apply to all data services, see “Identifying Data Service Special Requirements” on page 3.

Configuration Planning Questions

Use the questions in this section to plan the installation and configuration of Sun Cluster HA for Oracle. Insert the answers to these questions into the data service worksheets in the Sun Cluster 3.1 Release Notes.

Preparing the Nodes and Disks

This section contains the procedures you need to prepare the nodes and disks.

How to Prepare the Nodes

Use this procedure to prepare for the installation and configuration of Oracle software.


Caution – Caution –

Perform all of the steps described in this section on all of the nodes. If you do not perform all of the steps on all of the nodes, the Oracle installation will be incomplete, and Sun Cluster HA for Oracle will fail during startup.



Note –

Consult the Oracle documentation before you perform this procedure.


The following steps prepare your nodes and install the Oracle software.

  1. Become superuser on all of the cluster members.

  2. Configure the /etc/nsswitch.conf files as follows so that the data service starts and stops correctly if a switchover or failover occurs.

    On each node that can master the logical host that runs Sun Cluster HA for Oracle, include one of the following entries for group in the /etc/nsswitch.conf file.


    group:		 	files
    group:		 	files [NOTFOUND=return] nis
    group:		 	files [NOTFOUND=return] nisplus

    Sun Cluster HA for Oracle uses the su user command to start and stop the database node. The network information name service might become unavailable when a cluster node's public network fails. Adding one of the preceding entries for group ensures that the su(1M) command does not refer to the NIS/NIS+ name services if the network information name service is unavailable.

  3. Configure the cluster file system for Sun Cluster HA for Oracle.

    If raw devices contain the databases, configure the global devices for raw-device access. See the Sun Cluster 3.1 Software Installation Guide for information on how to configure global devices.

    If you use the SolsticeTM DiskSuite/Solaris Volume Manager, configure the Oracle software to use UNIX file system (UFS) logging on mirrored meta devices or raw-mirrored meta devices. See the Solstice DiskSuite/Solaris Volume Manager documentation for more information on how to configure raw-mirrored meta devices.

  4. Prepare the $ORACLE_HOME directory on a local or multihost disk.


    Note –

    If you install the Oracle binaries on a local disk, use a separate disk if possible. Installing the Oracle binaries on a separate disk prevents the binaries from overwrites during operating environment reinstallation.


  5. On each node, create an entry for the database administrator group (DBA) in the /etc/group file, and add potential users to the group.

    You typically name the DBA group dba. Verify that the root and oracle users are members of the dba group, and add entries as necessary for other DBA users. Ensure that the group IDs are the same on all of the nodes that run Sun Cluster HA for Oracle, as the following example illustrates.


    dba:*:520:root,oracle 

    You can create group entries in a network name service (for example, NIS or NIS+). If you do so, add your entries to the local /etc/inet/hosts file to eliminate dependency on the network name service.

  6. On each node, create an entry for the Oracle user ID (oracle).

    You typically name the Oracle user ID oracle. The following command updates the /etc/passwd and /etc/shadow files with an entry for the Oracle user ID.


    # useradd -u 120 -g dba -d /Oracle-home oracle
    

    Ensure that the oracle user entry is the same on all of the nodes that run Sun Cluster HA for Oracle.

How to Configure Oracle Database Access with Solstice DiskSuiteTM

Use this procedure to configure the Oracle database with Solstice DiskSuite volume manager.

  1. Configure the disk devices for the Solstice DiskSuite software to use.

    See the Sun Cluster 3.1 Software Installation Guide for information on how to configure the Solstice DiskSuite software.

  2. If you use raw devices to contain the databases, run the following commands to change each raw-mirrored metadevice's owner, group, and mode.

    If you do not use raw devices, do not perform this step.

    1. If you create raw devices, run the following commands for each device on each node that can master the Oracle resource group.


      # chown oracle /dev/md/metaset/rdsk/dn
      # chgrp dba /dev/md/metaset/rdsk/dn
      # chmod 600 /dev/md/metaset/rdsk/dn
      
      metaset

      Specifies the name of the diskset.

      /rdsk/dn

      Specifies the name of the raw disk device within the metaset diskset.

    2. Verify that the changes are effective.


      # ls -lL /dev/md/metaset/rdsk/dn
      

How to Configure Oracle Database Access With VERITAS Volume Manager

Use this procedure to configure the Oracle database with VERITAS Volume Manager software.

  1. Configure the disk devices for the VxVM software to use.

    See the Sun Cluster 3.1 Software Installation Guide for information on how to configure VERITAS Volume Manager.

  2. If you use raw devices to contain the databases, run the following commands on the current disk-group primary to change each device's owner, group, and mode.

    If you do not use raw devices, do not perform this step.

    1. If you create raw devices, run the following command for each raw device.


      # vxedit -g diskgroup set user=oracle group=dba mode=600 volume
      
      diskgroup

      Specifies the name of the disk group.

      volume

      Specifies the name of the raw volume within the disk group.

    2. Verify that the changes are effective.


      # ls -lL /dev/vx/rdsk/diskgroup/volume
      

    3. Reregister the disk device group with the cluster to keep the VxVM namespace consistent throughout the cluster.


      # scconf -c -D name=diskgroup
      

Installing the Oracle Software

This section contains the procedures you need to install Oracle software.

How to Install the Oracle Software

User this procedure to install the Oracle software.

  1. Become superuser on a cluster member.

  2. Note the Oracle installation requirements.

    Install Oracle binaries on one of the following locations.

    • local disks of the cluster nodes

    • highly available local file system

    • cluster file system


      Note –

      Before you install the Oracle software on the cluster file system, start the Sun Cluster software and become the owner of the disk device group.


    See Preparing the Nodes and Disks for more information about installation locations.

  3. Install the Oracle software.

    Regardless of where you install the Oracle software, modify each node's /etc/system files as you would in standard Oracle installation procedures. Reboot afterward.

    Log in as oracle to ensure ownership of the entire directory before you perform this step. See the appropriate Oracle installation and configuration guides for instructions on how to install Oracle software.

Verifying the Oracle Installation and Configuration

This section contains the procedure you need to verify the Oracle installation and configuration.

How to Verify the Oracle Installation

Use this procedure to verify the Oracle installation. This procedure does not verify that your application is highly available because you have not installed your data service yet.

  1. Verify that the oracle user and the dba group own the $ORACLE_HOME/bin/oracle directory.

  2. Verify that the $ORACLE_HOME/bin/oracle permissions are set as follows.


    -rwsr-s--x
  3. Verify that the listener binaries exist in the $ORACLE_HOME/bin directory.

Where to Go From Here

When you have completed the work in this section, go to Creating an Oracle Database.

Creating an Oracle Database

This section contains the procedure to configure and create the initial Oracle database in a Sun Cluster environment. If you create and configure additional databases, omit the procedure How to Create an Oracle Database.

How to Create an Oracle Database

  1. Prepare database configuration files.

    Place all of the database-related files (data files, redolog files, and control files) on either shared raw global devices or on the cluster file system. See Preparing the Nodes and Disks for information on install locations.

    Within the init$ORACLE_SID.ora or config$ORACLE_SID.ora file, you might need to modify the assignments for control_files and background_dump_dest to specify the locations of the control files and alert files.


    Note –

    If you use Solaris authentication for database logins, set the remote_os_authent variable in the init$ORACLE_SID.ora file to True.


  2. Create the database.

    Start the Oracle installer and select the option to create a database. Alternatively, depending on your Oracle version, you can use the Oracle svrmgrl(1M) command to create the database.

    During creation, ensure that all of the database-related files are placed in the appropriate location, either on shared global devices or on the cluster file system.

  3. Verify that the file names of your control files match the file names in your configuration files.

  4. Create the v$sysstat view.

    Run the catalog scripts that create the v$sysstat view. The Sun Cluster fault monitoring scripts use this view.

Where to Go From Here

When you have completed the work in this section, go to Setting Up Oracle Database Permissions.

Setting Up Oracle Database Permissions

This section contains the procedure on how to set up Oracle database permissions.

How to Set Up Oracle Database Permissions

Use this procedure to set up Oracle database permissions for Oracle 8i and Oracle 9i.

  1. Enable access for the user and password to be used for fault monitoring.

    • To use the Oracle authentication method – For all of the supported Oracle releases, enter the following script into the screen that the sqlplus command displays to enable access.


      # sqlplus “/as sysdba”
       
      			grant connect, resource to user identified by passwd;
      			alter user user default tablespace system quota 1m on
      				system;
             			grant select on v_$sysstat to user;
      			grant create session to user;
      			grant create table to user;
       
         exit;
    • To use the Solaris authentication method – Grant permission for the database to use Solaris authentication.


      Note –

      The user for which you enable Solaris authentication is the user who owns the files under the $ORACLE_HOME directory. The following code sample shows that the user oracle owns these files.



      # sqlplus “/as sysdba”
       
      			create user ops$oracle identified by externally
      				default tablespace system quota 1m on system;
      			grant connect, resource to ops$oracle;
            			grant select on v_$sysstat to ops$oracle;
      			grant create session to ops$oracle;
      			grant create table to ops$oracle;
       
         exit;
  2. Configure NET8 for the Sun Cluster software.

    The listener.ora file must be accessible from all of the nodes that are in the cluster. Place these files either under the cluster file system or in the local file system of each node that can potentially run the Oracle resources.


    Note –

    If you place the listener.ora file in a location other than the /var/opt/oracle directory or the $ORACLE_HOME/network/admin directory, then you must specify TNS_ADMIN or an equivalent Oracle variable (see the Oracle documentation for details) in a user-environment file. You must also run the scrgadm(1M) command to set the resource extension parameter User_env, which will source the user-environment file. See Table 1–2 or Table 1–3 for format details.


    Sun Cluster HA for Oracle imposes no restrictions on the listener name—it can be any valid Oracle listener name.

    The following code sample identifies the lines in listener.ora that are updated.


    LISTENER =
    	(ADDRESS_LIST =
    			(ADDRESS =
    				(PROTOCOL = TCP) 
    					(HOST = logical-hostname) <- use logical hostname
    				(PORT = 1527)
    			)
    	)
    .
    .
    SID_LIST_LISTENER =
    	.
    			.
    						(SID_NAME = SID) <- Database name, 
    default is ORCL	

    The following code sample identifies the lines in tnsnames.ora that are updated on client machines.


    service_name =
    	.
    			.
    						(ADDRESS = 
    								(PROTOCOL = TCP)
    								(HOST = logicalhostname)	<- logical hostname
    								(PORT = 1527) <- must match port in LISTENER.ORA
    						)
    				)
    				(CONNECT_DATA =
    						(SID = <SID>)) <- database name, default is ORCL

    The following example shows how to update the listener.ora and tnsnames.ora files given the following Oracle instances.

    Instance 

    Logical Host 

    Listener 

    ora8

    hadbms3

    LISTENER-ora8

    ora9

    hadbms4

    LISTENER-ora9

    The corresponding listener.ora entries are the following entries.


    LISTENER-ora9 =
    	(ADDRESS_LIST =
    			(ADDRESS =
    				(PROTOCOL = TCP)
    				(HOST = hadbms4)
    				(PORT = 1530)
    			)
    		)
    SID_LIST_LISTENER-ora9 =
    	(SID_LIST =
    			(SID_DESC =
    				(SID_NAME = ora9)
    			)
    		)
    LISTENER-ora8 =
      (ADDRESS_LIST =
        (ADDRESS= (PROTOCOL=TCP) (HOST=hadbms3)(PORT=1806))
      )
    SID_LIST_LISTENER-ora8 =
      (SID_LIST =
         (SID_DESC =
    			(SID_NAME = ora8)
    		 )	
      )

    The corresponding tnsnames.ora entries are the following entries.


    ora8 =
    (DESCRIPTION =
       (ADDRESS_LIST = 
    			(ADDRESS = (PROTOCOL = TCP) 
    			(HOST = hadbms3) 
    			(PORT = 1806))
       	)    
    	(CONNECT_DATA = (SID = ora8))
    )
    ora9 =
    (DESCRIPTION =
      (ADDRESS_LIST =
            (ADDRESS = 
    				(PROTOCOL = TCP) 
    				(HOST = hadbms4) 
    				(PORT = 1530))
      )
      	(CONNECT_DATA = (SID = ora9))
    )
  3. Verify that the Sun Cluster software is installed and running on all of the nodes.


    # scstat
    

Where to Go From Here

Go to Installing Sun Cluster HA for Oracle Packages to register and configure Sun Cluster HA for Oracle.

Installing Sun Cluster HA for Oracle Packages

Use the scinstall(1M) utility to install the SUNWscor package on your cluster. Do not use the -s option to non-interactive scinstall to install all of the data service packages.

If you installed the SUNWscor data service package as part of your initial Sun Cluster installation, proceed to Registering and Configuring Sun Cluster HA for Oracle. Otherwise, use the following procedure to install the SUNWscorpackage.

How to Install Sun Cluster HA for Oracle Packages

You need the Sun Cluster Agents CD-ROM to complete this procedure. Perform this procedure on all of the cluster nodes that run Sun Cluster HA for Oracle.

  1. Load the Sun Cluster Agents CD-ROM into the CD-ROM drive.

  2. Run the scinstall utility with no options.

    This step starts the scinstall utility in interactive mode.

  3. Choose the menu option, Add Support for New Data Service to This Cluster Node.

    The scinstall utility prompts you for additional information.

  4. Provide the path to the Sun Cluster Agents CD-ROM.

    The utility refers to the CD as the “data services cd.”

  5. Specify the data service to install.

    The scinstall utility lists the data service that you selected and asks you to confirm your choice.

  6. Exit the scinstall utility.

  7. Unload the CD from the drive.

Where to Go From Here

See Registering and Configuring Sun Cluster HA for Oracle to register Sun Cluster HA for Oracle and to configure the cluster for the data service.

Registering and Configuring Sun Cluster HA for Oracle

This section contains the procedures 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 line 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 on 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, if the user does not have a listener.ora file under /var/opt/oracle or $ORACLE_HOME/network/admin, then the TNS_ADMIN environment variable should be defined). Also, the definition of each environment variable 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. The only extension properties that you are required to set for the Oracle server are the ORACLE_HOME, ORACLE_SID, Alert_log_file, and Connect_string 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)

A feature that performs the following recovery actions in the event of an interrupted Oracle RDRMS hot backup. 

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

  • Identifies and releases all files left in hot backup mode.

  • Opens the database for use.

You can turn this feature ON and OFF. The default state is OFF (False).  

Default: False

Range: None

Tunable: Any time

Connect_cycle (integer)

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

 

Default: 5

Range: 099,999

Tunable: Any time

Connect_string (string)

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

 

Default: None

Range:Minimum = 1

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 fault monitor uses to probe an Oracle server instance. 

 

Default: 60

Range:0 99,999

Tunable: Any time

Restart_type (string)

When a fault with this resource is detected, a value of RESOURCE_RESTART will ensure only this resource restarts. A value of RESOURCE_GROUP_RESTART will ensure all resources in the resource group restart.

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, if the user does not have a listener.ora file under /var/opt/oracle or $ORACLE_HOME/network/admin, then the TNS_ADMIN environment variable should be defined). Also, the definition of each environment variable 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

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 How to Install 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 using 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 filesystem and local filesystem 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 will confuse the resource group causing it to failover.


    • Move the resource group into a MANAGED state.

    • Bring the resource group online.

    This node will be made the primary for device group ora-set1 and raw device /dev/global/dsk/d1. Device groups associated with file systems such as /global/ora-inst and /global/ora-data/logs will also be 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
      -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.


    Note –

    When a fault occurs in an Oracle server resource and 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 their default values. See Sun Cluster HA for Oracle Extension Properties for a list of extension properties.


  10. Run the scswitch command to complete the following task.

    • 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.

Verifying the Sun Cluster HA for Oracle Installation

Perform the following verification tests to make sure that you have correctly installed Sun Cluster HA for Oracle.

These sanity checks ensure that all of the nodes that run Sun Cluster HA for Oracle can start the Oracle instance and that the other nodes in the configuration can access the Oracle instance. Perform these sanity checks to isolate any problems starting the Oracle software from Sun Cluster HA for Oracle.

How to Verify the Sun Cluster HA for Oracle Installation

  1. Log in as oracle to the node that currently masters the Oracle resource group.

  2. Set the environment variables ORACLE_SID and ORACLE_HOME.

  3. Confirm that you can start the Oracle instance from this node.

  4. Confirm that you can connect to the Oracle instance.

    Use the sqlplus command with the user/password variable defined in the connect_string property.


    # sqlplus user/passwd@tns_service
    
  5. Shut down the Oracle instance.

    The Sun Cluster software will restart the Oracle instance because the Oracle instance is under Sun Cluster control.

  6. Switch the resource group that contains the Oracle database resource to another cluster member.

    The following example shows how to complete this step.


    # scswitch -z -g resource-group -h node 
    
  7. Log in as oracle to the node that now contains the resource group.

  8. Repeat Step 3 and Step 4 to confirm interactions with the Oracle instance.

Oracle Clients

Clients must always refer to the database by using the network resource (an IP address that can move between physical nodes during failover), not the physical hostname (a machine name).

For example, in the tnsnames.ora file, you must specify the network resource (logical hostname or shared address) as the host on which the database instance is running. See How to Set Up Oracle Database Permissions.


Note –

Oracle client-server connections cannot survive a Sun Cluster HA for Oracle switchover. The client application must be prepared to handle disconnection and reconnection or recovery as appropriate. A transaction monitor might simplify the application. Further, Sun Cluster HA for Oracle node recovery time is application dependent.


Understanding Sun Cluster HA for Oracle Fault Monitor

The two fault monitors for Sun Cluster HA for Oracle are a server and a listener monitor.

Oracle Server Fault Monitor

The fault monitor for the Oracle server uses a request to the server to query the health of the server.

The server fault monitor consists of the following two processes.

All of the database connections from the probe are performed as user oracle. The main fault monitor determines that the operation is successful if the database is online and no errors are returned during the transaction.

If the database transaction fails, the main process checks the internal action table for an action to be performed and performs the predetermined action. If the action executes an external program, it is executed as a separate process in the background. Possible actions include the following.

The probe uses the time-out value that is set in the resource property Probe_timeout to determine how much time to spend to successfully probe Oracle.

The server fault monitor also scans Oracle's alert_log_file and takes action based on any errors that the fault monitor finds.

The server fault monitor is started through pmfadm to make the monitor highly available. If the monitor is killed for any reason, the Process Monitor Facility (PMF) automatically restarts the monitor.

Oracle Listener Fault Monitor

The Oracle listener fault monitor checks the status of an Oracle listener.

If the listener is running, the Oracle listener fault monitor considers a probe successful. If the fault monitor detects an error, the listener is restarted.

The listener probe is started through pmfadm to make the probe highly available. If the probe is killed, PMF automatically restarts the probe.

If a problem occurs with the listener during a probe, the probe tries to restart the listener. The value set in the resource property Retry_count determines the maximum number of times that the probe attempts the restart. If, after trying for the maximum number of times, the probe is still unsuccessful, the probe stops the fault monitor and does not switch over the resource group.