Go to main content

Oracle® Solaris Cluster Data Service for Oracle Database Guide

Exit Print View

Updated: September 2019
 
 

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 a 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 supported volume manager or hardware RAID devices 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

    • Hardware RAID storage devices, for example, /dev/did/rdsk/dNsX

    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-svmdg-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-svmdg-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-svmdg-rs -p
            NAME=sun.scal-svmdg-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 resource dependency.
      # /Grid_home/bin/crsctl stat res ora.DATA1.dg -p | grep START_DEPENDENCIES
      START_DEPENDENCIES=pullup:always(ora.asm) hard(ora.asm,sun.svmdg-rs)
  3. Register the resource type for Oracle Clusterware framework.

    Note -  You can also use the clsetup utility to perform Step 3 through Step 14 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. 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
  6. Create resource groups asm-inst-rg and asm-dg-rg.
    # clresourcegroup create -S asm-inst-rg asm-dg-rg
  7. Set a strong positive affinity on rac-fmwk-rg by asm-inst-rg.
    # clresourcegroup set -p Rg_affinities=++rac-fmwk-rg asm-inst-rg
  8. Set a strong positive affinity on asm-inst-rg by asm-dg-rg.
    # clresourcegroup set -p Rg_affinities=++asm-inst-rg asm-dg-rg
  9. 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
    –g asm-inst-rg

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

    –t SUNW.asm_instance_proxy

    Specifies the type of the resource to add.

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

    –d asm-inst-rs

    Specifies the name of the resource that you are creating.

  10. 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,scal-svmdg-rs \
    -d asm-dg-rs
  11. Bring online the asm-inst-rg resource group in a managed state on a cluster node.
    # clresourcegroup online -eM asm-inst-rg
  12. Bring online the asm-dg-rg resource group in a managed state on a cluster node.
    # clresourcegroup online -eM asm-dg-rg
  13. Verify the Oracle ASM installation by issuing the status command.
    # clresource status +
  14. Create a failover resource group ora-db-rg for the Oracle database.
    # clresourcegroup create ora-db-rg
  15. 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, which the Oracle Database remote_listener uses instead.
    # clresourcetype register SUNW.oracle_server
    # clresourcetype register SUNW.oracle_listener
  16. Add a logical hostname resource to the failover resource group for Oracle Database.

    Note -  If you use an Oracle Grid Infrastructure SCAN listener, specify a logical hostname whose IP address will be on the same subnet as the SCAN listener IP address.
    # 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.

  17. Bring online the failover resource group in a managed state on a cluster node.
    # clresourcegroup online -eM ora-db-rg
  18. Create an Oracle Database application server resource in the failover resource group.

    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.

    For a far sync resource, omit Db_unique_name and Resource_dependencies_offline_restart. However, you must specify Dataguard_role=FAR_SYNC.

    # clresource create -g ora-db-rg \
    -t SUNW.oracle_server \
    -p Db_unique_name=db-unique-name \
    -p Resource_dependencies_offline_restart=asm-dg-rs \
    -p Oracle_home=Oracle_home \
    -p Oracle_sid=instance \
    -d ora-db-rs
    -pRestart_type=entity-to-restart \
    -pDataguard_role=role] \
    -pStandby_mode=mode] \
    -p Resource_dependencies_offline_restart=storageplus-resource \
    resource
    
    –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_home=Oracle_home

    Sets the path to the Oracle Database home directory.

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

    –p Restart_type=entity-to-restart

    Specifies the entity that the server fault monitor restarts when the response to a fault is restart. Set entity-to-restart as follows:

    • To specify that only this resource is restarted, set entity-to-restart to RESOURCE_RESTART. By default, only this resource is restarted.

    • To specify that all resources in the resource group that contains this resource are restarted, set entity-to-restart to RESOURCE_GROUP_RESTART.

      If you set entity-to-restart to RESOURCE_GROUP_RESTART, all other resources (such as Apache or DNS) in the resource group are restarted, even if they are not faulty. Therefore, include in the resource group only the resources that you require to be restarted when the Oracle Database server resource is restarted.

    –p Dataguard_role=role

    Specifies the role of the database instance. Change role as follows:

    • To create a resource for a primary database instance that does not have standby instances configured, change role to NONE. This value is the default value.

    • To create a resource for a primary database instance that has standby database instances configured, change role to PRIMARY.

    • To create a resource for a standby database instance, change role to STANDBY.

    • To create a resource for a far sync database instance, change role to FAR_SYNC.

    –p Standby_mode=mode

    Specifies the mode for the standby database instance. If you change Dataguard_role to NONE or PRIMARY, the value of the Standby_mode is ignored.

    • To specify a logical standby database, change mode to LOGICAL. This value is the default value.

    • To specify a physical standby database, change mode to PHYSICAL.

    • To specify a snapshot standby database, change mode to SNAPSHOT.

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