Sun Cluster 3.0 12/01 Data Services Installation and Configuration Guide

Chapter 2 Installing and Configuring Sun Cluster HA for Oracle

This chapter contains the following procedures.

You must configure Sun Cluster HA for Oracle as a failover data service. See Chapter 1, Planning for Sun Cluster Data Services and the Sun Cluster 3.0 12/01 Concepts document for general information about data services, resource groups, resources, and other related topics.


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

The following table lists sections that describe the installation and configuration tasks.

Table 2-1 Task Map: Installing and Configuring HA for Oracle

Task 

For Instructions, Go To 

Prepare to install Sun Cluster HA for Oracle 

"Preparing to Install Sun Cluster HA for Oracle"

Install the Oracle application software 

"Installing the Oracle Server Software"

Create an Oracle database 

"Creating an Oracle Database"

Set up Oracle database permissions 

"Setting Up Oracle Database Permissions"

Install the Sun Cluster HA for Oracle packages 

"Installing Sun Cluster HA for Oracle Packages"

Register resource types and configure resource groups and resources 

"Registering and Configuring Sun Cluster HA for Oracle"

Verify the Sun Cluster HA for Oracle installation 

"Verifying the Sun Cluster HA for Oracle Installation"

Configure extension properties 

"Configuring Sun Cluster HA for Oracle Extension Properties"

View fault monitor information 

"Sun Cluster HA for Oracle Fault Monitor"

Preparing to Install Sun Cluster HA for Oracle

Before you install Sun Cluster HA for Oracle, select an install location for the following files.

Installing the Oracle Server Software

Use the procedures in this section to complete the following tasks.


Note -

Before you configure Sun Cluster HA for Oracle, follow the procedures in the Sun Cluster 3.0 12/01 Software Installation Guide to configure the Sun Cluster software on each node.


How to Prepare the Nodes

This procedure describes how to prepare the cluster nodes for installation of the Oracle application 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:
    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.0 12/01 Software Installation Guide for information on how to configure global devices.

    When you use the SolsticeTM DiskSuite volume manager, configure the Oracle software to use UNIX file system (UFS) logging or raw-mirrored meta devices. See the Solstice DiskSuite 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 Install the Oracle Software

Perform the following steps 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

    • 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 to Install Sun Cluster HA for Oracle" 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.

How to Verify the Oracle Installation

Perform the following steps to verify the Oracle installation.

  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

Complete the procedures in this section to configure and create the initial Oracle database in a Sun Cluster configuration. If you create and configure additional databases, omit the procedure "How to Create an Oracle Database".

How to Configure Oracle Database Access With Solstice DiskSuiteTM

If you use the Solstice DiskSuite volume manager, perform the following steps to configure Oracle database access with the Solstice DiskSuite volume manager.

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

    See the Sun Cluster 3.0 12/01 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

If you use VxVM software, perform the following steps to configure Oracle database access with the VxVM software.

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

    See the Sun Cluster 3.0 12/01 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
      

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 to Install Sun Cluster HA for Oracle" 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

Use this procedure to set up Oracle database permissions.

How to Set Up Oracle Database Permissions

When completing Step 2 or Step 3 of this procedure, select and configure either the Oracle authentication method or the Solaris authentication method for fault monitoring access.

  1. Determine the Oracle release you are using.

    If you are using Oracle 8i, go to Step 2.

    If you are using Oracle 9i, skip to Step 3.

  2. Enable access for the user and password to be used for fault monitoring for Oracle 8i.


    Note -

    If you are using Oracle 9i, go to Step 3.


    To complete this step, perform one of the following tasks, then skip to Step 4.

    • Oracle authentication method for Oracle 8i - For all of the supported Oracle releases, enter the following script into the screen that the srvmgrl command displays to enable access.


      # svrmgrl
       
      	connect internal;
      			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;
      	disconnect;
      
         exit;
    • Solaris authentication method for Oracle 8i - Grant permission for the database to use Solaris authentication.


      Note -

      The user for whom 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.



      # svrmgrl
       
      	connect internal;
      			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;
      	disconnect;
      
         exit;
  3. Enable access for the user and password to be used for fault monitoring for Oracle 9i.


    Note -

    If you are using Oracle 8i, go to Step 2.


    • To use the Oracle authentication method for Oracle 9i - 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 for Oracle 9i - 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;
  4. Configure NET8 for the Sun Cluster software.

    The listener.ora and tnsnames.ora files 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 and tnsnames.ora files 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 2-2 or Table 2-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

    ora7

    hadbms4

    LISTENER-ora7

    The corresponding listener.ora entries are the following entries.


    LISTENER-ora7 =
    	(ADDRESS_LIST =
    			(ADDRESS =
    				(PROTOCOL = TCP)
    				(HOST = hadbms4)
    				(PORT = 1530)
    			)
    		)
    SID_LIST_LISTENER-ora7 =
    	(SID_LIST =
    			(SID_DESC =
    				(SID_NAME = ora7)
    			)
    		)
    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))
    )
    ora7 =
    (DESCRIPTION =
      (ADDRESS_LIST =
            (ADDRESS = 
    				(PROTOCOL = TCP) 
    				(HOST = hadbms4) 
    				(PORT = 1530))
      )
      	(CONNECT_DATA = (SID = ora7))
    )
  5. 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 SUNWscor, the Sun Cluster HA for Oracle package, on a 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 SUNWscor package.

How to Install Sun Cluster HA for Oracle Packages

You need the Sun Cluster 3.0 Agents 12/01 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 3.0 Agents 12/01 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 3.0 Agents 12/01 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

Register and configure Sun Cluster HA for Oracle 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 12/01 Concepts document for details on resources and resource groups.

How to Register and Configure Sun Cluster HA for Oracle

This procedure describes how to use the scrgadm command to register and configure Sun Cluster HA for Oracle.


Note -

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.


Note -

Perform this procedure on any cluster member.


  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/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 NAFO groups on each node. All of the nodes in nodelist of the resource group must be represented in the netiflist. If you do not specify this option, scrgadm(1M) attempts to discover a net adapter on the subnet that the hostname list identifies for each node in nodelist. For example, -n nafo0@nodename, nafo0@nodename2.

  6. 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
    
    -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 "Configuring Sun Cluster HA for Oracle Extension Properties" for a list of extension properties.


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

How to Configure SUNW.HAStorage Resource Type

The SUNW.HAStorage resource type synchronizes actions between HA storage and the data service. Sun Cluster HA for Oracle 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.

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 tns_service variable defined in the tnsnames.ora file.


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


Configuring Sun Cluster HA for Oracle Extension Properties

This section describes the Sun Cluster HA for Oracle extension properties. Typically, you use the command line scrgadm -x parameter=value to configure the extension properties when you create the Oracle server and listener resources. You can also use the procedures described in Chapter 13, Administering Data Service Resources to configure them later. See Appendix A, Standard Properties for details on all of the Sun Cluster properties.

Table 2-2 describes the extension properties that you can set for the Oracle listener resource. The required extension property for creating an Oracle listener resource is the ORACLE_HOME property. You can update some extension properties dynamically. You can update others, however, only when you create the resource. The Tunable entries indicate when you can update each property.

Table 2-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 2-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 2-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

Connect_cycle (integer)

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

 

Default: 5

Range: 0 - 99,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

 

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

 

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.