HP Serviceguard Toolkit for Oracle Data Guard User Guide HP Part Number: 5900-1554 Published: April 2011 Edition: J06.03 and subsequent J-series RVUs, H06.03 and subsequent H-series RVUs, Edition: and G06.
© Copyright 2011 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice.
Contents 1 Introduction...............................................................................................4 Overview................................................................................................................................4 2 Serviceguard support for Oracle Data Guard.................................................5 Features of the Toolkit for Oracle Data Guard...............................................................................5 Dependencies....................
1 Introduction HP Serviceguard Toolkit for Oracle Data Guard (ODG) helps in easy integration of ODG with HP Serviceguard. ODG is the host-based, data-replication software for Oracle Database. It provides management, monitoring, and automation features to create and maintain one or more standby databases protecting data from failures, disasters, human error, and data corruptions.
2 Serviceguard support for Oracle Data Guard Providing high availability for ODG is essential for mission-critical businesses that require ODG to be deployed in an environment that has a wide range of applications. Integrating ODG with Serviceguard using the toolkit has the following additional advantages: 1. 2. 3. 4. Provides high availability for Data Guard processes and the Data Guard broker (if used) for both, primary and the standby databases.
. 7. The toolkit automates failover of Primary database to Standby database (in a Continentalclusters environment only) in case of a disaster at the Primary database site and when the Primary database becomes unavailable. It supports Cluster Verification to identify inconsistencies across the package nodes. NOTE: The toolkit does not support role transitions. The role transition tasks must be manually performed.
Supported configurations Single-Instance Oracle database Figure 1 Single-instance Oracle database The ODG toolkit can be implemented as a combinational package with the ECMT Oracle toolkit. A combinational package has two applications packed together by combining their respective Serviceguard modules into one package. The ODG toolkit depends on the ECMT Oracle toolkit. Hence, customers who do not already have the ECMT product must purchase it along with the ODG toolkit.
where: • 2. ◦ pkg_ascii_file is the package file of the existing ECMT Oracle package. This can be generated using the command cmgetconf –p ◦ module_file_name is the name of the module to be included in the running package. In case of Data Guard package, its value will be tkit/dataguard/ dataguard. ◦ output_file_name is the template file that gets generated with the values of the ECMT Oracle database module populated in it.
Figure 2 RAC environment In Figure 2 (page 9), the primary site contains the production database using Oracle RAC and the symmetric secondary site maintaining physical standby using ODG. In the event of any disaster at the primary site, Data Guard fails over the primary production role to secondary production database. In an RAC environment, the ODG toolkit can be implemented as a combinational Multi Node Package (MNP) with the SGeRAC toolkit.
cluster. We have taken two nodes in the above example, for better understanding. The standby database is not a part of a Serviceguard cluster. It is present outside SG cluster 1. Data Guard replication takes place between the primary RAC and the standalone standby. Each instance of the primary database transmits its redo data to an instance of the standby database. The role of the standby is to receive the redo logs from the RAC primary and apply them to the database.
Figure 5 Data Guard replication between RAC primary and RAC standby Figure 5 (page 11), shows a Data Guard configuration where both primary and standby databases are configured in two different RAC setups. The RAC primary is configured on nodes 1 and 2 of SG Cluster 1 and the RAC standby is configured on nodes 1 and 2 of SG Cluster 2. Note that these two clusters are not a part of a Continentalclusters. Data Guard replication takes place between the RAC primary and the RAC standby.
Initially, this package will be in a halted state. When the primary cluster fails, cmrecovercl command has to be run on the recovery cluster to bring up the recovery package. NOTE: Note that the package attribute "START_STANDBY_AS_PRIMARY" has to be set to "yes" in case of a recovery package. In a Continentalclusters environment, the AUTO_RUN attribute of these packages must be disabled at the time of bringing up the packages in the Recovery group.
then run the Recovery package, which will bring up the database as a primary database by doing a role failover. Note that in this case, role management is handled by ODG toolkit. The start up time of recovery package is usually double the start up time for an ordinary database package. This is because, the recovery package runs role transition commands which involve shutting down the database after the role is changed and restarting the database.
1. 2. 3. Halt the Recovery package Start the Primary package—this will bring up the database on Primary Cluster as a primary database Start the Data Receiver package—this will bring up the database on the Recovery Cluster as a standby database NOTE: In an RAC environment, the FAST_START_FAILOVER feature of ODG Broker must not enabled when using the ODG toolkit in Continentalclusters environment.
Figure 8 Single-instance Data Guard configuration in Metrocluster with standby database residing outside Metrocluster NOTE: This configuration is supported both in single-instance and RAC environments. For better understanding, the packages in the Figure 8 (page 15) are shown for a single-instance database. In Figure 8 (page 15), Metrocluster is configured with two data centers; one as the primary site, and the other as the recovery site.
primary database instance comes up at Data Center 2, it will continue to send the archived logs to the standby database located at the third location. A configuration in which another Primary instance of Oracle is running at the second site, and replicates to a third location is also possible.
NOTE: This configuration is supported both in single-instance and RAC environments. For better understanding, the packages in the Figure 9 (page 16) are shown for a single-instance database. Three data center configuration Figure 10 Single-instance Data Guard setup in a Continentalclusters environment where the primary cluster is configured as a Metrocluster Figure 10 (page 17), describes a Continentalclusters setup with two clusters spread over three different sites.
NOTE: This configuration is supported both in single-instance and RAC environments. For better understanding, the packages in the Figure 10 (page 17) are shown for a single-instance database. Configuring multiple instances of Oracle Data Guard To support configuring Multiple instances of ODG single-instance/RAC databases, in one Serviceguard cluster, all the instances must be configured in such a way that they function independently.
NOTE: These configurations hold good both in single-instance and RAC environment. High Availability for Data Guard Broker High availability for Data Guard Broker will be supported only on RAC but not on single-instance database. This is because Oracle does not support high availability for Data Guard Broker with vendor clusterware for single-instance Oracle database.
3 Setting Up Oracle Data Guard ODG provides the management, monitoring, and automation software to create and maintain one or more standby databases. These databases protect Oracle data from failures, disasters, human error, and data corruption. ODG is included with the Enterprise Edition and Personal Edition of the Oracle database software. A Data Guard configuration consists of one production database and up to nine standby databases.
4 Installation and configuration of the toolkit Setting up the toolkit This toolkit has to be used in combination with the ECMT Oracle module for a single-instance Oracle database. In this case, ensure that the ECMT B.06.00 has been installed. Similarly, in an RAC environment, this toolkit has to be used in combination with the SGeRAC toolkit RAC Database module. In this case, ensure that SGeRAC toolkit has been installed. After installing the ODG toolkit, four scripts (hadg.sh, hadg_rac.sh, hadg_rac_cc.
Table 2 Files created on installation of the HP Serviceguard toolkit for Oracle Data Guard File Name Description Available in Directory SGAlert.sh Alert Mail generation script /opt/cmcluster/toolkit/ dataguard Main Script in Single Instance This script contains a list of internally used variables and functions that Environment (hadg.sh) support the starting, stopping, and monitoring of an ODG instance. This script will be called by tkit_module.
Table 4 Module scripts of the HP Serviceguard toolkit for Oracle Data Guard File Name Description Available in Directory Toolkit Module This script is called by the Master Control Script /etc/cmcluster/scripts/tkit/ and acts as an interface between the Master dataguard Script (tkit_module.sh) Control Script and the toolkit interface script (hadg.sh/hadg_rac.sh). It is also responsible for calling the toolkit Configuration File Generator Script (described below).
Table 5 Package attributes (continued) Variable Name Description START_STANDBY_AS_PRIMARY This parameter specifies whether the standby database has to be started as the primary database or not. It has to be set to "yes" in the "Recovery package" of the Continentalclusters' Recovery Group. When primary package goes down, the user has to run the command cmrecovercl to bring up the recovery package on the recovery cluster.
The example illustrates the creation of a package for ODG in a single-instance environment. 1. Creating a package configuration • Create two packages: one for the primary database on the Primary Cluster and the other for the standby database on the Standby Cluster. • Create a directory in /etc/cmcluster, for example, “dataguard.” This directory will eventually become TKIT_DIR and “cd” to this directory. • Run the following commands to create the package configuration file templates.
NOTE: The following attributes are specific to the Oracle toolkit in ECMT: # # “package_name” is the name that is used to identify the package. # Package names must be unique within a cluster. # package_name dgpkg -----------------------------------------------------------------------# # “package_description” specifies the application that the package runs.
# # Define oracle session name # ecmt/oracle/oracle/SID_NAME ORCL -----------------------------------------------------------------------# # Define Oracle database startup mode # ecmt/oracle/oracle/START_MODE mount -----------------------------------------------------------------------# # Define whether the database instance is using ASM or not # ecmt/oracle/oracle/ASM no -----------------------------------------------------------------------# # Define ASM disk groups used by the database instance # #ecmt/o
# # Define the listener password(s) # #ecmt/oracle/oracle/LISTENER_PASS -----------------------------------------------------------------------# #ecmt/oracle/oracle/LISTENER_RESTART # #ecmt/oracle/oracle/LISTENER_RESTART ------------------------------------------------------------------------ 28 Installation and configuration of the toolkit
NOTE: The following are the service commands for the combinational package: service_name oracle_service_test service_cmd “$SGCONF/scripts/ecmt/oracle/tkit_module.sh oracle_monitor” service_restart none service_fail_fast_enabled no service_halt_timeout 300 service_name oracle_listener_service_test service_cmd “$SGCONF/scripts/ecmt/oracle/tkit_module.
NOTE: The following attributes are specific to the ODG toolkit: -----------------------------------------------------------------------# # Define ACTIVE_STANDBY # tkit/dataguard/dataguard/ACTIVE_STANDBY no -----------------------------------------------------------------------# Define MONITOR_DG_BROKER # tkit/dataguard/dataguard/MONITOR_DG_BROKER no -----------------------------------------------------------------------# # Define REAL_TIME_APPLY # tkit/dataguard/dataguard/REAL_TIME_APPLY no ------
a. b. c. Create two packages one for the Primary RAC database on the Primary cluster and the other for the Standby RAC database on the Standby cluster. Create a directory in /etc/cmcluster, for example "dataguard". This directory will eventually become TKIT_DIR and "cd" to this directory. Run the following commands to create the Package configuration file Templates. Note that the ODG toolkit has to be used in combination with the SGeRAC toolkit (in case of RAC Environment).
-----------------------------------------------------------------------# # Define Oracle user # sgerac/erac_tk_rac/ORACLE_USER oracle -----------------------------------------------------------------------# # Define Oracle start up mode # mount sgerac/erac_tk_rac/START_MODE # # The package dependency parameters are "dependency_name", # "dependency_condition" and "dependency_location".
Single-instance environment NOTE: The example assumes that the package name is dgpkg, and the package directory is /etc/cmcluster/pkg/dgpkg, and the ORACLE_HOME is configured as /orahome. 1. Disable the failover of the package through cmmodpkg command. $ cmmodpkg -d dgpkg 2. Pause the monitor script. Create an empty file /etc/cmcluster/pkg/dgpkg/dataguard.debug as shown below: $ touch /etc/cmcluster/pkg/dgpkg/dataguard.
5 Cluster verification for Oracle Data Guard toolkit Cluster verification is a proactive mechanism for identifying cluster inconsistencies that adversely affect toolkit package failover to a node. It checks for ODG toolkit and Oracle database versions on all the package nodes of the cluster. Cluster verification does not fail package validation (during package apply or package check) if there are any inconsistencies but appropriate warning messages will be logged.
6 Troubleshooting • Package Log file The user can look into the Package log file for Package start/stop/monitor log messages. • Oracle alert message log Looking into Oracle’s Alert Log file also will help troubleshoot Oracle database related issues. The location of Oracle’s Alert log file is: /admin//bdump/alert_.
7 Limitations/Restrictions 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 36 Both the primary database and the standby database cannot be part of the same Metrocluster. Configuring standby in the same Metrocluster will make it a redundant configuration because the primary database is already being replicated (hardware replication) between the sites of the Metrocluster. ODG toolkit does not support legacy style configuration.
8 Support and other resources Information to collect before contacting HP Be sure to have the following information available before you contact HP: • Software product name • Hardware product model number • Operating system type and version • Applicable error message • Third-party hardware or software • Technical support registration number (if applicable) How to contact HP Use the following methods to contact HP technical support: • In the United States, see the Customer Service / Contact HP U
HP authorized resellers For the name of the nearest HP authorized reseller, see the following sources: • In the United States, see the HP U.S. service locator website: http://www.hp.com/service_locator • In other locations, see the Contact HP worldwide website: http://welcome.hp.com/country/us/en/wwcontact.html Documentation feedback HP welcomes your feedback. To make comments and suggestions about product documentation, send a message to: docsfeedback@hp.
Replaceable The name of a placeholder that you replace with an actual value. [] In command syntax statements, these characters enclose optional content. {} In command syntax statements, these characters enclose required content. | The character that separates items in a linear list of choices. ... Indicates that the preceding element can be repeated one or more times. WARNING An alert that calls attention to important information that, if not understood or followed, results in personal injury.