Oracle® Solaris Cluster Data Service for Oracle Database Guide

Exit Print View

Updated: September 2014, E39654–02
 
 

How to Register and Configure HA for Oracle Database With Oracle Grid Infrastructure for a Cluster (CLI)

This procedure explains the steps to register and configure HA for Oracle Database with clustered Oracle ASM instance using Oracle Solaris Cluster maintenance commands.

You can optionally use a third-party volume manager to provide candidate disks to clustered Oracle ASM disk groups. For this type of configuration, this procedure manually creates an Oracle Grid Infrastructure resource that proxies the Oracle Solaris Cluster SUNW.ScalDeviceGroup resource. In this procedure, the Oracle Grid Infrastructure resource is named sun.resource. You configure sun.resource to ensure that the corresponding Oracle ASM disk group is not mounted until sun.resource is online. The sun.resource resource comes online only if the corresponding SUNW.ScalDeviceGroup resource is online. And the SUNW.ScalDeviceGroup resource only comes online if the actual volume-manager disk set or disk group is online.

To ensure that the Oracle ASM disk group benefits from this dependency chain, after you define sun.resource, you modify the appropriate Oracle ASM disk-group resource so that the hard-start dependency includes sun.resource. Modifying the hard-start dependency of the Oracle ASM disk-group resource can only be performed by the SUNW.scalable_asm_diskgroup_proxy resource by using the VALIDATE method. Therefore, you must set an offline-restart dependency between the SUNW.scalable_asm_diskgroup_proxy and SUNW.ScalDeviceGroup resources.

Before You Begin

  1. On a cluster member, become superuser or assume a role that provides solaris.cluster.modify and solaris.cluster.admin RBAC authorizations.
  2. If you are using a third-party volume manager or NFS as candidate disks for Oracle ASM disk groups, configure Oracle Grid Infrastructure.

    Oracle ASM candidate disks can be derived from any of the following:

    • Solaris Volume Manager disk sets

    • NFS

    1. Create the Oracle Grid Infrastructure sun.storage_proxy.type resource type.
      # /Grid_home/bin/crsctl add type sun.storage_proxy.type -basetype local_resource
    2. Create an Oracle Grid Infrastructure sun.resource resource of type sun.storage_proxy.type.

      Note -  Ensure that all attribute values are enclosed in single quotes ('). Otherwise, the VALIDATE method of the SUNW.scalable_asm_diskgroup_proxy resource will fail the validation.
      # /Grid_home/bin/crsctl add res sun.scal-asmdg1-rs \
            -type sun.storage_proxy.type \
            -attr "ACTION_SCRIPT='/opt/SUNWscor/dsconfig/bin/scproxy_crs_action' \
            ACL='owner:root:rwx,pgrp:oinstall:rwx,other::r--' SCRIPT_TIMEOUT='20' RESTART_ATTEMPTS='60'"
      sun.scal-asmdg1-rs

      The SUNW.ScalDeviceGroup resource name.

      -type sun.storage_proxy.type

      Specifies the sun.storage_proxy.type resource type.

      ACTION_SCRIPT

      Specifies the /opt/SUNWscor/dsconfig/bin/scproxy_crs_action action script.

      ACL

      Sets the owner equal to root and the group equal to the ACL group entry for the Oracle ASM disk group. The following command displays the ACL group entry:

      # /Grid_home/bin/crsctl stat res ora.DATA1.dg -p | grep ACL=
      ACL=owner:oragrid:rwx,pgrp:oinstall:rwx,other::r--

      The example output shows that oinstall is the group entry.

      SCRIPT_TIMEOUT

      Set to 20.

      RESTART_ATTEMPTS

      Set to 60.

    3. Verify that sun.resource is correctly defined.

      Output is similar to the following:

      # /Grid_home/bin/crsctl stat res sun.scal-asmdg1-rs -p
            NAME=sun.scal-asmdg1-rs
            TYPE=sun.storage_proxy.type
            ACL=owner:root:rwx,pgrp:oinstall:rwx,other::r--
            ACTIONS=
            ACTION_FAILURE_TEMPLATE=
            ACTION_SCRIPT=/opt/SUNWscor/dsconfig/bin/scproxy_crs_action
            ACTION_TIMEOUT=60
            AGENT_FILENAME=%CRS_HOME%/bin/scriptagent
            ALERT_TEMPLATE=
            ALIAS_NAME=
            AUTO_START=restore
            CHECK_INTERVAL=60
            CHECK_TIMEOUT=0
            CLEAN_TIMEOUT=60
            DEBUG=1
            DEFAULT_TEMPLATE=
            DEGREE=1
            DELETE_TIMEOUT=60
            DESCRIPTION=
            ENABLED=1
            INSTANCE_FAILOVER=1
            INTERMEDIATE_TIMEOUT=-
            LOAD=1
            LOGGING_LEVEL=1
            MODIFY_TIMEOUT=60
            NOT_RESTARTING_TEMPLATE=
            OFFLINE_CHECK_INTERVAL=0
            PROFILE_CHANGE_TEMPLATE=
            RESTART_ATTEMPTS=60
            SCRIPT_TIMEOUT=20
            SERVER_CATEGORY=
            START_CONCURRENCY=0
            START_DEPENDENCIES=
            START_TIMEOUT=0
            STATE_CHANGE_TEMPLATE=
            STOP_CONCURRENCEY=0
            STOP_DEPENDENCIES=
            STOP_TIMEOUT=0
            UPTIME_THRESHOLD=1h
            USER_WORKLOAD=no
      #
    4. Display the current offline-restart dependency.
      # /Grid_home/bin/crsctl stat res ora.DATA1.dg -p | grep START_DEPENDENCIES
      START_DEPENDENCIES=hard(ora.asm) pullup(ora.asm)
      
      # clresource show -p Resource_dependencies_offline_restart asm-data1-rs
      
      === Resources ===
      
      Resource: asm-data1-rs
      Resource_dependencies_offline_restart: asm-inst-rs
      
      -- Standard and extension properties --
    5. Set the new dependency.
      • If asm-data1-rs already exists, use the following command to set the dependency.

        Note that the command includes the plus (+) symbol:

        # clresource set -p Resource_dependencies_offline_restart+=scal-asmdg1-rs asm-data1-rs
        –p Resource_dependencies_offline_restart+=resource

        (For an Oracle ASM device group only) Sets the offline restart dependency for the specified Oracle ASM storage resource.

        asm-data1–rs

        Specifies the name of the resource that you are modifying.

      • If asm-data1-rs does not yet exist, use the following command to create the resource with the offline-restart dependency:
        # clresource create -g asm-dg-rg \
        -t SUNW.scalable_asm_diskgroup_proxy \
        -p asm_diskgroups=data1 \
        -p Resource_dependencies_offline_restart=asm-inst-rs,
        scal-asmdg1-rs \
        -d asm-data1-rs
        –g asm-dg-rg

        Specifies the name of the Oracle ASM device group into which the resources are to be placed.

        –t resource-type

        Specifies the type of the resource to add.

        –p asm_diskgroups=data1

        Sets the name of the Oracle ASM disk group.

        –d

        Specifies disabling the resource that you create.

    6. Verify the configured dependency.
      # /Grid_home/bin/crsctl stat res ora.DATA1.dg -p | grep START_DEPENDENCIES
      START_DEPENDENCIES=hard(ora.asm,sun.scal-asmdg1-rs) pullup(ora.asm)
      # clresource show -p Resource_dependencies_offline_restart asm-data1-rs
      === Resources ===
      
      Resource: asm-data1-rs
      Resource_dependencies_offline_restart: asm-inst-rs scal-asmdg1-rs
      
      -- Standard and extension properties --
  3. Register the resource type for Oracle Clusterware framework.

    Note -  You can also use the clsetup utility to perform Step 3 through Step 5 in this procedure.
    # clresourcetype register SUNW.crs_framework
  4. Add a resource of type SUNW.crs_framework to the rac-fmwk-rg resource group.
    # clresource create -g rac-fmwk-rg \
    -t SUNW.crs_framework \
    -p Resource_dependencies_offline_restart=rac-fmwk-rs \
    -d crs-fmwk-rs
  5. Create a failover resource group ora-db-rg for the Oracle database.
    # clresourcegroup create ora-db-rg
  6. If you are using a Sun QFS file system, perform the following steps to register the Sun QFS file system resource type and create the resource group.
    1. Register the resource type for a Sun QFS file system.
      # clresourcetype register SUNW.qfs
    2. Create a resource group qfs-rg.
      # clresourcegroup create qfs-rg
    3. Add a resource of type SUNW.qfs to the qfs-rg resource group.
    4. Add a resource of type SUNW.qfs to the qfs-rg resource group.
      # clresource create -g qfs-rg -t SUNW.qfs -p QFSFileSystem=qfs-mp qfs-rs
      –g qfs-rg

      Specifies the name of the resource group.

      –t SUNW.qfs

      Specifies the type of the resource to add.

      –p QFSFileSystem=qfs-mp

      Specifies the Sun QFS file system mount point.

      qfs-rs

      Specifies the name of the Sun QFS file system resource that you are creating.

    5. Bring online the qfs-rg resource group in a managed state on a cluster node.
      # clresourcegroup online -eM qfs-rg
  7. Register the SUNW.HAStoragePlus resource type and create the resource group.
    1. Register the resource type for SUNW.HAStoragePlus resource type.
      # clresourcetype register SUNW.HAStoragePlus
    2. Add a resource of type SUNW.HAStoragePlus to the ora-db-rg resource group.
      # clresource create -g ora-db-rg -t SUNW.HAStoragePlus \
      -p filesystemmountpoints=mount-point-list -d hastp-rs
    3. Bring online the ora-db-rg resource group in a managed state on a cluster node.
      # clresourcegroup online -eM ora-db-rg
  8. Register the Oracle ASM resource types for the data service.
    1. Register the scalable ASM instance proxy resource type.
      # clresourcetype register SUNW.scalable_asm_instance_proxy
    2. Register the appropriate ASM disk-group resource type.
      # clresourcetype register SUNW.scalable_asm_diskgroup_proxy
  9. Create resource groups asm-inst-rg and asm-dg-rg.
    # clresourcegroup create -S asm-inst-rg asm-dg-rg
  10. Set a strong positive affinity on rac-fmwk-rg by asm-inst-rg.
    # clresourcegroup set -p Rg_affinities=++rac-fmwk-rg asm-inst-rg
  11. Set a strong positive affinity on asm-inst-rg by asm-dg-rg.
    # clresourcegroup set -p Rg_affinities=++asm-inst-rg asm-dg-rg
  12. Add a resource of type SUNW.crs_framework to the rac-fmwk-rg resource group.
    # clresource create -g rac-fmwk-rg \
    -t SUNW.crs_framework \
    -p Resource_dependencies_offline_restart=rac-fmwk-rs \
    -d crs-fmwk-rs
  13. If you configured the $ORACLE_HOME directory for Oracle ASM use on a cluster file system, configure resources to use that cluster file system.

    Add resources of type SUNW.HAStoragePlus and SUNW.scalable_asm_instance to the asm-inst-rg resource group and set the appropriate dependencies between the two resources.

    # clresource create -g asm-inst-rg -t SUNW.HAStoragePlus \ 
    -p FilesystemMountPoints=cluster-file-system \
    hastp-rs
    
    # clresource create -g asm-inst-rg -t SUNW.scalable_asm_instance_proxy \
    -p Oracle_home=Oracle_home \
    -p CRS_HOME=Grid_home
    -p Oracle_sid{node1}=instance \
    -p Oracle_sid{node2}=instance \
    -p Resource_dependencies_offline_restart=hastp-rs \
    -p Resource_dependencies_offline_restart=crs-fmwk-rs \
    asm-inst-rs
    –g asm-inst-rg

    Specifies the names of the resource groups into which the resources are to be placed.

    –p FilesystemMountPoints=cluster-file-system

    Specifies the name of the cluster file system.

    hastp-rs

    Specifies the name of the SUNW.HAStoragePlus resource to create.

    –p Oracle_home=Oracle_home

    Sets the path to the Oracle Database home directory.

    –p CRS_HOME=Grid_home

    Sets the path to the Oracle Grid Infrastructure for a Cluster home directory.

    –p "Oracle_sid{node}"=instance

    Sets the Oracle Database system identifier.

  14. Add a resource of type SUNW.scalable_asm_instance_proxy to the asm-inst-rg resource group.
    # clresource create -g asm-inst-rg \
    -t SUNW.scalable_asm_instance_proxy \
    -p Oracle_home=Oracle_home \
    -p CRS_HOME=Grid_home \
    -p "oracle_sid{node1}"=instance \
    -p "oracle_sid{node2}"=instance \
    -p Resource_dependencies_offline_restart=crs-fmwk-rs \
    -d asm-inst-rs
    –t SUNW.asm_inst_proxy

    Specifies the type of the resource to add.

    –d asm-inst-rs

    Specifies the name of the resource that you are creating.

  15. Add an ASM disk-group resource to the asm-dg-rg resource group.

    Use the SUNW.scalable_asm_diskgroup_proxy resource type.

    # clresource create -g asm-dg-rg \
    -t SUNW.scalable_asm_diskgroup_proxy \
    -p Asm_diskgroups=dg[,dg…] \
    -p Resource_dependencies_offline_restart=asm-inst-rs,asm-stor-rs \
    -d asm-dg-rs
  16. Bring online the asm-inst-rg resource group in a managed state on a cluster node.
    # clresourcegroup online -eM asm-inst-rg
  17. Bring online the asm-dg-rg resource group in a managed state on a cluster node.
    # clresourcegroup online -eM asm-dg-rg
  18. Verify the Oracle ASM installation by issuing the status command.
    # clresource status +
  19. Register the resource types for the HA for Oracle Database data service.

    You register two resource types, SUNW.oracle_server and SUNW.oracle_listener.


    Note -  Omit registration of the SUNW.oracle_listener resource type if you are using an Oracle Grid Infrastructure for Clusters Single Client Access Name (SCAN) listener.
    # clresourcetype register SUNW.oracle_server
    # clresourcetype register SUNW.oracle_listener
  20. Add a logical hostname resource to the failover resource group for Oracle Database.
    # clreslogicalhostname create -g ora-db-rg [-h logical-hostname] logical-hostname-rs
    logical-hostname

    Specifies a logical hostname. This logical hostname must be present in your name service database. If logical-hostname and logical-hostname-rs are identical, logical-hostname is optional.

    logical-hostname-rs

    Specifies the name that you are assigning to the logical hostname resource that you are creating.

  21. Bring online the failover resource group in a managed state on a cluster node.
    # clresourcegroup online -eM ora-db-rg
  22. Create an Oracle Database application server resource in the failover resource group.
    # clresource create -g ora-db-rg \
    -t SUNW.oracle_server \
    -p Db_unique_home=db-unique-home \
    -p Resource_dependencies_offline_restart=asm-dg-rs \
    -p Oracle_sid=instance \
    -d ora-db-rs
    –g ora-db-rg

    Specifies the name of the resource group into which the resources are to be placed.

    –t SUNW.oracle_server

    Specifies the type of the resource to add.

    –p Oracle_sid=instance

    Sets the Oracle Database system identifier.

    –p Db_unique_name=db-unique-name

    Sets the Oracle Database unique name.

    –d ora-db-rs

    Specifies the name of the resource that you are creating.


    Note -  Optionally, you can set additional extension properties that belong to the HA for Oracle Database data service to override their default values. See Setting HA for Oracle Database Extension Properties for a list of extension properties.
  23. Bring online the Oracle Database server resource.
    # clresource enable ora-db-rs

Next Steps

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