Sun Cluster Data Service for Oracle Real Application Clusters Guide for Solaris OS

Automating the Startup and Shutdown of Oracle Real Application Clusters Database Instances

Automating the startup and shutdown of Oracle Real Application Clusters database instances involves registering and configuring the following resources:

The Oracle RAC server resources provide fault monitoring only to enable the status of Oracle Real Application Clusters resources to be monitored by Sun Cluster utilities. These resources do not provide automatic fault recovery.

The procedures that follow contain instructions for registering and configuring resources. These instructions explain how to set only extension properties that Sun Cluster Support for Oracle Real Application Clusters requires you to set. Optionally, you can set additional extension properties to override their default values. For more information, see the following sections:

Registering and Configuring Oracle RAC Server Resources

The SUNW.oracle_rac_server resource type represents the Oracle RAC server in a Sun Cluster configuration. Each instance of the Oracle RAC server is represented by a single SUNW.oracle_rac_server resource.

Configure each SUNW.oracle_rac_server resource as a single-instance resource that is restricted to run on only one node. You enforce this restriction as follows:

Oracle RAC server instances should be started only after the RAC framework is enabled on a cluster node. You ensure that this requirement is met by creating the following affinities and dependencies:

If you are using Sun StorEdge QFS shared file system, ensure that each Oracle RAC server instance is started only after Sun StorEdge QFS resources for this instance are started on a cluster node. You meet this requirement by creating a dependency between the Oracle RAC server resource and its related Sun StorEdge QFS resources.

How to Register and Configure Oracle RAC Server Resources

  1. On one node of the cluster, become superuser.

  2. Register the SUNW.oracle_rac_server resource type.


    # scrgadm -a -t SUNW.oracle_rac_server
    
  3. For each node where Sun Cluster Support for Oracle Real Application Clusters can run, create a resource group and a resource for the Oracle RAC server.

    1. Create a failover resource group to contain the Oracle RAC server resource.


      # scrgadm -a -g rac-server-rg -h node \
      -y RG_AFFINITIES=++rac-fmwk-rg \
      [-y RG_DEPENDENCIES=sqfs-rg-list]
      
      -g rac-server-rg

      Specifies the name that you are assigning to the resource group.

      -h node

      Specifies the node for which you are creating the resource group. You must specify only one node.

      -y RG_AFFINITIES=++rac-fmwk-rg

      Creates a strong positive affinity to the RAC framework resource group. If the RAC framework resource group was created by using the scsetup utility, the RAC framework resource group is named rac-framework-rg.

      -y RG_DEPENDENCIES=sqfs-rg-list

      Specifies a comma-separated list of Sun StorEdge QFS resource groups on which this Oracle RAC server instance depends. These resource groups are created when you register and configure the data service for the Sun StorEdge QFS metadata server. For more information about these resources, see Configuration Planning Questions. Create this dependency only if you are using Sun StorEdge QFS shared file system.

    2. Add an instance of the SUNW.oracle_rac_server resource type to the resource group that you created in Step a.

      When you create this resource, specify the following information about the resource:

      • The Oracle home directory. The Oracle home directory contains the binary files, log files, and parameter files for the Oracle software.

      • The Oracle system identifier. This identifier is the name of the Oracle database instance.


      # scrgadm -a -j rac-server-resource -g rac-server-rg \
      -t SUNW.oracle_rac_server \
      -y RESOURCE_DEPENDENCIES=rac-fmwk-rs[, sqfs-rs-list] \
      -x ORACLE_SID=ora-sid \
      -x ORACLE_HOME=ora-home
      
      -j rac-server-resource

      Specifies the name that you are assigning to the SUNW.oracle_rac_server resource.

      -g rac-server-rg

      Specifies the resource group to which you are adding the resource. This resource group must be the resource group that you created in Step a.

      -y RESOURCE_DEPENDENCIES=rac-fmwk-rs[, sqfs-rs-list]

      Specifies the resources on which this Oracle RAC server instance depends.

      You must specify the RAC framework resource. If the RAC framework resource group is created by using the scsetup utility, this resource is named rac_framework.

      If you are using Sun StorEdge QFS shared file system, you must also specify a comma-separated list of Sun StorEdge QFS resources. These resources are created when you register and configure the data service for the Sun StorEdge QFS metadata server. For more information about these resources, see Configuration Planning Questions.

      -x ORACLE_SID=ora-sid

      Specifies the Oracle system identifier. This identifier is the name of the Oracle database instance.

      -x ORACLE_HOME=ora-home

      Specifies the path to the Oracle home directory. The Oracle home directory contains the binary files, log files, and parameter files for the Oracle software.


Example 2–1 Registering and Configuring Oracle RAC Server Resources

This example shows the sequence of operations that is required to register and configure Oracle RAC server resources for a two-node cluster.

The example assumes that a RAC framework resource group named rac-framework-rg has been created. The example also assumes that this resource group contains a SUNW.rac_framework resource named rac_framework.

  1. To register the SUNW.oracle_rac_server resource type, the following command is run:


    # scrgadm -a -t SUNW.oracle_rac_server
    
  2. To create the RAC1-rg resource group for node node1, the following command is run:


    # scrgadm -a -g RAC1-rg -h node1 \
    -y RG_AFFINITIES=++rac-framework-rg
    
  3. To create the RAC2-rg resource group for node node2, the following command is run:


    # scrgadm -a -g RAC2-rg -h node2 \
    -y RG_AFFINITIES=++rac-framework-rg
    
  4. To create the RAC1-rs resource in the RAC1-rg resource group for node node1, the following command is run:


    # scrgadm -a -j RAC1-rs -g RAC1-rg \
    -t SUNW.oracle_rac_server \
    -y RESOURCE_DEPENDENCIES=rac_framework \
    -x ORACLE_SID=RAC1 \
    -x ORACLE_HOME=/oracle
    
  5. To create the RAC2-rs resource in the RAC2-rg resource group for node node2, the following command is run:


    # scrgadm -a -j RAC2-rs -g  RAC2-rg \
    -t SUNW.oracle_rac_server \
    -y RESOURCE_DEPENDENCIES=rac_framework \
    -x ORACLE_SID=RAC2 \
    -x ORACLE_HOME=/oracle
    

Where to Go From Here

Go to Registering and Configuring Oracle Listener Resources.

Registering and Configuring Oracle Listener Resources

How you configure Oracle listener resources depends on how you require Oracle listeners to serve Oracle Real Application Clusters database instances. For more information, see Resource Groups for Oracle Listener Resources.

How to Register and Configure Oracle Listener Resources

  1. On one node of the cluster, become superuser.

  2. Register the SUNW.oracle_listener resource type.


    # scrgadm -a -t SUNW.oracle_listener
    
  3. If your configuration of Oracle listeners requires a separate resource group, create a failover resource group for the listener resource.

    Create this resource group only if your configuration of Oracle listeners requires a separate resource group. When you create this resource group, create any dependencies on other resource groups that your configuration requires. For more information see Resource Groups for Oracle Listener Resources.


    # scrgadm -a -g rac-listener-rg \
    [-y RG_DEPENDENCIES=rg-list]\
    -h nodelist
    
    -g rac-listener-rg

    Specifies the name that you are assigning to the resource group.

    -y RG_DEPENDENCIES=rg-list

    Specifies a comma-separated list of resource groups that this resource group depends on. If the Oracle home directory resides on a Sun StorEdge QFS shared file system, rg-list must specify the resource group for the Sun StorEdge QFS metadata server for the file system.

    If the resource group for the listener resource depends on no other resource groups, omit this option.

    -h nodelist

    Specifies a comma-separated list of nodes where the resource group can be brought online. The list may contain more than one node only if you are configuring the listener to use a LogicalHostname resource. Otherwise, you must specify only one node.

  4. Add an instance of the SUNW.oracle_listener resource to each resource group that is to contain a SUNW.oracle_listener resource.

    When you create this resource, specify the following information about the resource:

    • The name of the Oracle listener. This name must match the corresponding entry in the listener.ora file.

    • The Oracle home directory. The Oracle home directory contains the binary files, log files, and parameter files for the Oracle software.


    # scrgadm -a -j listener-resource -g listener-rg \
    -t SUNW.oracle_listener \
    [-y RESOURCE_DEPENDENCIES=sqfs-rs-list] \
    -x LISTENER_NAME=listener \ 
    -x ORACLE_HOME=oracle-home
    
    -j listener-resource

    Specifies the name that you are assigning to the SUNW.oracle_listener resource.

    -g listener-rg

    Specifies the resource group to which you are adding the resource.

    -y RESOURCE_DEPENDENCIES=sqfs-rs-list

    Specifies a comma-separated list of Sun StorEdge QFS resources on which this Oracle listener instance depends. These resources are created when you register and configure the data service for the Sun StorEdge QFS metadata server. For more information about these resources, see Configuration Planning Questions. Create this dependency only if the Oracle home directory resides on a Sun StorEdge QFS shared file system.

    -x LISTENER_NAME=listener

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

    -x ORACLE_HOME=ora-home

    Specifies the path to the Oracle home directory. The Oracle home directory contains the binary files, log files, and parameter files for the Oracle software.

  5. Bring online each RAC server resource group that you created in How to Register and Configure Oracle RAC Server Resources.

    For each resource group, type the following command:


    # scswitch -Z -g rac-server-rg
    
    -Z

    Moves the resource group to the MANAGED state, and brings online the resource group

    -g rac-server-rg

    Specifies that a resource group that you created in How to Register and Configure Oracle RAC Server Resources is to be moved to the MANAGED state and brought online

  6. If you created Oracle listener resource groups in Step 3, bring online these resource groups.

    For each resource group that you created, type the following command:


    # scswitch -Z -g rac-listener-rg
    
    -Z

    Moves the resource group to the MANAGED state, and brings online the resource group

    -g rac-listener-rg

    Specifies that a resource group that you created in Step 3 is to be moved to the MANAGED state and brought online


Example 2–2 Registering and Configuring Oracle Listener Resources

This example shows the sequence of operations that is required to register and configure Oracle RAC listener resources for a two-node cluster.

In this example, each listener serves only one Real Application Clusters instance. The listeners cannot fail over.

The example assumes that RAC server resource groups named RAC1-rg and RAC2-rg have been created as shown in Example 2–1.

  1. To register the SUNW.oracle_listener resource type, the following command is run:


    # scrgadm -a -t SUNW.oracle_listener
    
  2. To create the LRAC1-rs resource in the RAC1-rg resource group for node node1, the following command is run:


    # scrgadm -a -j LRAC1-rs -g RAC1-rg \
    -t SUNW.oracle_listener \
    -x LISTENER_NAME=LRAC1 \
    -x ORACLE_HOME=/oracle
    
  3. To create the LRAC2-rs resource in the RAC2-rg resource group for node node2, the following command is run:


    # scrgadm -a -j LRAC2-rs -g RAC2-rg \
    -t SUNW.oracle_listener \
    -x LISTENER_NAME=LRAC2 \
    -x ORACLE_HOME=/oracle
    

Where to Go From Here

Go to Verifying the Sun Cluster Support for Oracle Real Application Clusters Installation and Configuration.