HP Serviceguard Toolkit for Oracle version A.05.01.
© Copyright 2012 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 Overview..................................................................................................5 Advantages.............................................................................................................................5 Prerequisites.............................................................................................................................5 Storage considerations..............................................................................................
Sample package configuration file for Oracle ASM database legacy package...............................54 D Sample package configuration file for Oracle ASM database modular package....................................................................................................56 Glossary....................................................................................................58 Index.........................................................................................................
1 Overview HP Serviceguard toolkit for Oracle on Linux enables you to configure an Oracle single instance in a Serviceguard cluster on Linux and integrate an Oracle database server with Serviceguard on Linux (SG/LX). This toolkit consists of a set of scripts that are used to start, stop, and monitor an Oracle database instance, ASM instance, and the configured listeners. The HP Serviceguard toolkit for Oracle on Linux: Annual Release, June 2012 is available for free download at http://software.hp.
2 Installing and uninstalling HP Serviceguard toolkit for Oracle To install the HP Serviceguard toolkit for Oracle on Red Hat, run the command: NOTE: The steps described here are applicable to both legacy and modular style packages. # rpm -ivh serviceguard-oracle-toolkit-.redhat.noarch.rpm The files are installed in the following directories: • ${SGCONF}/oracletoolkit • ${SGCONF}/scripts/tkit/oracle • ${SGCONF}/modules/tkit/oracle NOTE: Linux.
Table 1 Files created after HP Serviceguard toolkit for Oracle is installed File name Description Available in directory haoracle.conf The toolkit configuration file. This script ${SGCONF}/oracletoolkit contains a list of pre-defined variables that the user must customize for use with a particular database instance. This configuration file is read by the toolkit script, haoracle.sh. haoracle.
Table 1 Files created after HP Serviceguard toolkit for Oracle is installed (continued) File name Description hadbhang.mon The haoracle.sh script invokes the hadbhang.mon script to monitor the Oracle instance for possible “hung” state. hadbhang.mon script in turn uses hagetdbstatus.sh and hatimeoutdb hang.sh hagetdbstatus.sh It is used to check the database status. hatimeoutdbhang.sh This script checks whether a process with the specified PID exists.
3 Supported configuration This section explains the following supported configurations for Oracle database toolkit packages: • Without Automatic Storage Management • With Automatic Storage Management Without Automatic Storage Management This section explains how to configure a Oracle database without ASM in a Serviceguard environment.
Oracle single instance failover packages dependent on this MNP. This configuration enables the database instance to start up in the right order in relation to the ASM instance, and in the event of a failover, to relocate only to a node where an ASM instance is available. To configure Oracle database using ASM in a Serviceguard environment: 1. Configuring ASM in a Serviceguard environment and creating the ASM instance. a. Configure logical volumes or devices to be used in the ASM disk groups. b.
4 Using HP Serviceguard toolkit for Oracle After installing the HP Serviceguard toolkit for Oracle, you can use this toolkit to: • Configure legacy and modular Oracle database toolkit packages. • Manage the packages. Configuring legacy and modular Oracle database toolkit packages You can configure the legacy and modular Oracle database toolkit packages with and without ASM.
Attribute Name Description Example ASM This parameter determines whether ASM is being used to manage the storage for the database instance. no You can set the value either to yes or no. Set this parameter to yes if ASM is used, otherwise set to no. The default value is no. START_MODE This parameter defines the Oracle open database startup mode. Valid options are nomount, mount, and open. The default mode is open.
Attribute Name Description Example specified, then Oracle toolkit makes use of PFILE as the parameter file. To make use of SPFILE, in the toolkit do not configure this parameter, and remove the default PFILE from its default location. MONITOR_PROCESSES This is the list of all the critical Oracle processes for an instance that must be executing to assume that the instance is up and running. You can add more instance processes.
Attribute Name Description Example The TIME_OUT variable has no effect on package failover times. The default value is 30 seconds. KILL_ASM_FOREGROUNDS If ASM is being used, this parameter yes specifies whether any ASM foreground processes having file descriptors open on the dismounted disk group volumes must be killed or not. You can set this parameter to yes or no. The default value is yes.
Attribute Name Description Example package. It is commented by default. You can set the attribute to all or specify the DB service names that must be started and stopped by the DB package. 5. 6. 7. Generate the database package configuration file and control script using the following commands: • Database package configuration file: # cmmakepkg -p db1pkg.conf • Package control script: # cmmakepkg -s db1pkg.cntl Edit the following parameters in the package configuration file, db1pkg.conf.
8. Edit the package control script db1pkg.cntl. Attribute Name Example SERVICE_NAME oracle_service SERVICE_CMD ${SGCONF}/oracle_legacy/toolkit.sh monitor SERVICE_RESTART -r 2 If listener service is configured in the package configuration file, set the following parameters: Attribute Name Example SERVICE_NAME oracle_listener_service SERVICE_CMD ${SGCONF}/oracle_legacy/toolkit.
4. Edit the following attributes manually in the package configuration file: Attribute Description Example package_name The package name must be unique in the cluster. oracle_pkg TKIT_DIR When you apply a package using ${SGCONF}/oracle_pkg the cmapplyconf command, TKIT_DIR contains the toolkit configuration file, haoracle.conf on all the configured nodes. NOTE: The TKIT_DIR for this package must be different from the TKIT_DIR configured for other database packages.
Attribute Description Example listeners when a listener failure is detected. If the listener does not restart after LISTENER_RESTART number of consecutive attempts, the package fails over. If the listener restart is successful, then the next time listener fails, the toolkit again tries LISTENER_RESTART number of times to restart the listener. You can add more than one listener restart value by adding to the array variable LISTENER_RESTART. PFILE The Oracle database parameter file.
Attribute Description Example the toolkit to continue monitoring the database server application or the ASM instance. NOTE: If the Maintenance flag is set to no, then the maintenance feature is not available which means the toolkit cannot be brought into maintenance mode. MONITOR_INTERVAL The time interval, in seconds, this script waits between checks to ensure that Oracle instance is running. The default value is 30 seconds.
Attribute Description Example If immediate is specified, the instance is shutdown using the immediate option. The default value is abort. KILL_ASM_FOREGROUNDS If ASM is being used, this parameter yes specifies whether any ASM foreground processes having file descriptors open on the dismounted disk group volumes need to be killed or not. You can set this parameter either to yes or no. The default value is yes. DB_SERVICE 5.
• 6. To start monitoring Oracle hang detection: Attribute Name Example service_name oracle_hang_service service_cmd "${SGCONF}/scripts/tkit/oracle/ tkit_module.sh oracle_hang_monitor 30 failure" service_restart none service_fail_fast_enabled no service_halt_timeout 300 Apply the package configuration using the command: # cmapplyconf -P pkg2.conf Configuring legacy ASM database package To configure a legacy ASM Oracle database toolkit packages: 1.
Attribute Name Description Example Oracle configuration directory $ASM_HOME/dbs. When this parameter is configured, it overrides the default file location. If both PFILE and SPFILE are present and this parameter is not specified, then HP Serviceguard toolkit for Oracle makes use of PFILE as the parameter file. To make use of SPFILE in the toolkit, do not configure this parameter, and remove the default PFILE from its default location. LISTENER Set this value to no.
Attribute Name Description Example NOTE: If the Maintenance flag is set to no, then the maintenance feature is not available and toolkit cannot be brought into maintenance mode. MONITOR_INTERVAL The time interval, in seconds, this script waits between checks to ensure that Oracle instance is running. The default value is 30 seconds. TIME_OUT The time period, in seconds, this 30 toolkit waits for a completion of a normal shutdown before initiating forceful halt of the application.
Attribute Name Description Example immediate option. The default value is abort. e. f. g. h. i. j. Generate the ASM MNP package configuration file and control script using the following commands: • ASM MNP package configuration file: # cmmakepkg -p asmpkg.conf • Package control script: # cmmakepkg -s asmpkg.cntl Edit the following parameters in the package configuration file, asmpkg.conf.
c. d. cd ${SGCONF}/. Edit the configuration file, haoracle.conf. Attribute Name Description Example INSTANCE_TYPE This parameter determines whether database the instance is an ASM instance or a database instance. Set this parameter to database. ORACLE_HOME This is the base directory where Oracle is installed. ORACLE_ADMIN User name of the Oracle database oracle administrator. This is used to start and stop the database. SID_NAME The Oracle session name.
Attribute Name Description Example stop the ASM instance and mounting or dismounting the ASM disk groups. ASM_SID The ASM session name that uniquely identifies an ASM instance. +ASM NOTE: If you modify this attribute after the cmmakepkg -i -m -t command is run, you must reconfigure the MONITOR_PROCESSES attribute to reflect the same. Also, reconfigure PFILE attribute to reflect the change if PFILE is using this attribute.
Attribute Name Description Example PFILE It is the Oracle database ${ASM_HOME}/dbs/ parameter file. If this attribute is init${ASM_SID}.ora not specified, Oracle picks this up from the Oracle configuration directory $ORACLE_HOME/dbs. When this parameter is configured, it overrides the default file location. If both PFILE and SPFILE are present and this parameter left unspecified, then HP Serviceguard toolkit for Oracle makes use of PFILE as the parameter file.
Attribute Name Description Example running. The default value is 30 seconds. TIME_OUT The time period, in seconds, this 30 toolkit waits for a completion of a normal shutdown before initiating forceful halt of the application. The TIME_OUT variable is used to protect against a worst case scenario where a hung database or ASM instance prevents the halt script from completing, therefore preventing the standby node from starting the instance. The TIME_OUT variable has no effect on package failover times.
Attribute Name Description Example USER_SHUTDOWN_MODE This parameter is used to specify the instance shutdown mode only when a shutdown is initiated by the user and not because of the failure of a service. abort You can set this parameter to abort or immediate. If abort is specified, the instance is shutdown using the abort option. If immediate is specified, the instance is shutdown using the immediate option. The default value is abort.
• • h. To start monitoring Oracle listener processes: Attribute Name Example SERVICE_NAME oracle_listener_service SERVICE_FAIL_FAST_ENABLED no SERVICE_HALT_TIMEOUT 300 To start monitoring Oracle hang detection: Attribute Name Example SERVICE_NAME oracle_hang_service SERVICE_FAIL_FAST_ENABLED no SERVICE_HALT_TIMEOUT 300 Edit the package control script db1pkg.cntl. Attribute Name Example SERVICE_NAME oracle_service SERVICE_CMD ${SGCONF}/oracle_asmdb_legacy/toolkit.
j. Apply the package configuration using the following command: # cmapplyconf -P db1pkg.conf k. Run the database package using the following command: # cmrunpkg oracle_asmdb_legacy NOTE: Repeat all the above mentioned steps for each database instance. Configuring modular ASM database package To configure a modular ASM Oracle database toolkit packages: 1. Setting up and configuring ASM multi-node package. a. Create a directory in ${SGCONF}/. b. cd ${SGCONF}/. c.
Attribute Description Example ASM_VOLUME_GROUP Defines volume groups used in the vgora_asm ASM disk groups for this database instance. You can add more than one volume group by adding to this array variable. ASM_HOME The home directory where ASM is /asm_home installed. ASM_USER The user name of the Oracle ASM oracle administrator. It is used to start or stop the ASM instance and mounting or dismounting the ASM disk groups. ASM_SID The ASM session name that uniquely identifies an ASM instance.
Attribute Description Example After the maintenance work, ensure that the instance is running. Then delete the oracle.debug file in the package directory. This enables toolkit to continue monitoring the database server application or the ASM instance. NOTE: If Maintenance flag is set to no, then the maintenance feature is not available and toolkit cannot be brought into maintenance mode.
Attribute Description Example USER_SHUTDOWN_MODE This parameter is used to specify the instance shutdown mode only when a shutdown is initiated by the user and not because of the failure of a service. abort You can set this parameter to abort or immediate. If abort is specified, the instance is shutdown using the abort option. If immediate is specified, the instance is shutdown using the immediate option. The default value is abort.
Attribute Description Example haoracle.conf on all configured nodes. NOTE: The TKIT_DIR for this package must be different from the TKIT_DIR configured for the ASM MNP. INSTANCE_TYPE This parameter determines whether database the instance is an ASM instance or a database instance. Set this parameter to database. ORACLE_HOME This is the base directory where Oracle is installed. /ORACLE_TEST0 ORACLE_ADMIN The user name of the Oracle database administrator. This is used to start and stop the database.
Attribute Description Example ASM_HOME The home directory where ASM is /ASM_TEST0 installed. ASM_USER User name of the Oracle ASM oracle administrator. It is used to start or stop the ASM instance and mounting or dismounting the ASM disk groups. ASM_SID The ASM session name that uniquely identifies an ASM instance. +ASM NOTE: If you modify this attribute after the # cmmakepkg -i -m -t command is run, you must reconfigure the MONITOR_PROCESSES attribute to reflect the same.
Attribute Description Example If both PFILE and SPFILE are present and this parameter is not specified, then HP Serviceguard toolkit for Oracle makes use of PFILE as the parameter file. To make use of SPFILE in the toolkit, do not configure this parameter, and remove the default PFILE from its default location. MONITOR_PROCESSES This is the list of all the critical Oracle processes for an instance that must be executing to assume that the instance is up and running. You can add more instance processes.
Attribute Description Example scenario where a hung database or ASM instance prevents the halt script from completing, therefore preventing the standby node from starting the instance. The TIME_OUT variable has no effect on package failover times. The default value is 30 seconds. PARENT_ENVIRONMENT This parameter is used to mention yes if the Oracle or ASM user's shell must be invoked as a new shell or as a subshell that inherits the variables set in the parent shell.
Attribute Description Example KILL_ASM_FOREGROUNDS If ASM is being used, this yes parameter specifies whether any ASM foreground processes having file descriptors open on the dismounted disk group volumes need to be killed or not. You can set this parameter to yes or no. The default value is yes. If this parameter is set to yes, ASM foreground processes of the form oracle having file descriptors open will be killed.
• f. g. To start monitoring Oracle hang detection: Attribute Name Example service_name oracle_hang_service service_cmd "${SGCONF}/scripts/tkit/oracle/ tkit_module.
1. 2. To enable the maintenance mode feature in the package configuration file, set the MAINTENANCE_FLAG attribute to yes in package configuration file. To start the maintenance mode for the package, create the oracle.debug file under the package directory: # touch oracle.debug 3. To stop the maintenance mode and bring the package out of maintenance mode, remove the oracle.debug file from the package directory: # rm oracle.
5 Migrating a database package You can migrate from an existing database package that uses the older version of HP Serviceguard toolkit for Oracle to use the new Linux HP Serviceguard toolkit for Oracle scripts provided for ASM support. The new legacy or modular database package may or may not use ASM. Migrating legacy Oracle database package without ASM to modular To migrate a legacy Oracle database package without ASM to modular Oracle database package without ASM: 1. Halt the database package. 2.
6 Supporting Oracle features Support for multiple listeners This section explains support for multiple listeners with the HP Serviceguard toolkit for Oracle.
NOTE: In a single package, it is not possible to configure the services using both the approaches. You must either configure all the listeners using a single service, or use a separate service for each listener. Ensure that the elements in the LISTENER_RESTART array and the LISTENER_PASS array correspond to those in the LISTENER_NAME array in the package configuration file.
the listener name to the service command. The service_cmd in the package configuration file appears as follows: Attribute name Description service_name oracle_listener_monitor service_cmd “${SGCONF}/scripts/tkit/oracle/tkit_module.sh oracle_monitor_listener ” service_restart none service_fail_fast_enabled no service_halt_timeout 300 A separate service to monitor each listener This service is recommended if listeners are critical.
NOTE: • This feature is available only on systems running Oracle Clusterware. • If user defined DB services are configured to start with database package startup, then database must be started in open mode. Set the package configuration file attribute START_MODE to open. The attribute, DB_SERVICE is used to start and stop the database service through the database package. This attribute is commented by default.
7 Troubleshooting This section explains some of the problem scenarios that you might encounter while using the HP Serviceguard toolkit for Oracle in a Serviceguard cluster. Problem scenario Possible cause The cmcheckconf or cmapplyconf The TKIT_DIR specified in the command logs the following message: package configuration file is not created. WARNING! Directory ${SGCONF}/ is not present.
8 Support and other resources Information to collect before contacting HP Ensure that the following information is 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 Un
Ctrl+x or Ctrl-x A key sequence that indicates you must hold down the keyboard key labeled Ctrl while you press the letter x. ENVIRONMENT VARIABLE The name of an environment variable, for example, PATH. Key The name of a keyboard key. Return and Enter both refer to the same key. Term A term or phrase that is defined in the body text of the document, not in a glossary. User input Indicates commands and text that you type exactly as shown.
A Sample package configuration file for Oracle database legacy package without ASM The toolkit configuration file (haoracle.conf) INSTANCE_TYPE=database ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1 ORACLE_ADMIN=oracle SID_NAME=oranew START_MODE=open ASM=no LISTENER=yes LISTENER_NAME[0]=LISTENER PFILE=${ORACLE_HOME}/dbs/init${SID_NAME}.
SERVICE_NAME[1]="oracle_listener_service" SERVICE_CMD[1]="${SGCONF}/oracle_legacy/toolkit.sh monitor_listener" SERVICE_RESTART[1]="-r 2" SERVICE_NAME[2]="oracle_hang_service" SERVICE_CMD[2]="${SGCONF}/oracle_legacy/toolkit.sh hang_monitor 30 failure" SERVICE_RESTART[2]="-r 2" function customer_defined_run_cmds { # ADD customer defined run commands. : # do nothing instruction, because a function must contain some command. ${SGCONF}/oracle_legacy/toolkit.
B Sample package configuration file for Oracle database modular package without ASM # ********************************************************************** # ****** HIGH AVAILABILITY PACKAGE CONFIGURATION FILE (template) ******* # ********************************************************************** # ******* Note: This file MUST be edited before it can be used. ******** # * For complete details about package parameters and how to set them, * # * consult the Serviceguard manual.
C Sample package configuration file for Oracle ASM database legacy package Sample package configuration file for Oracle ASM MNP legacy package The toolkit configuration file (haoracle.conf) INSTANCE_TYPE=ASM ORACLE_ADMIN=oracle ASM=no PFILE=${ASM_HOME}/dbs/init${ASM_SID}.
function customer_defined_halt_cmds { # ADD customer defined halt commands. : # do nothing instruction, because a function must contain some command. if [ $SG_HALT_REASON = "user_halt" ]; then reason="user" else reason="auto" fi ${SGCONF}/oracle_asm_legacy/toolkit.sh stop $reason test_return 52 } Sample package configuration file for Oracle ASM database legacy package The toolkit configuration file (haoracle.conf) INSTANCE_TYPE=database ORACLE_HOME=/oracle/app/oracle/product/11.2.
SERVICE_FAIL_FAST_ENABLED SERVICE_HALT_TIMEOUT no 300 Package control script # ********************************************************************** # *HIGH AVAILABILITY PACKAGE CONTROL SCRIPT (template)* # *Note: This file MUST be edited before it can be used.* # *You must have bash version 2 installed for this script to work* # *properly. Also required is the arping utility available in the* # *iputils package.
D Sample package configuration file for Oracle ASM database modular package ASM multi-node package configuration file # ********************************************************************** # ****** HIGH AVAILABILITY PACKAGE CONFIGURATION FILE (template) ******* # ********************************************************************** # ******* Note: This file MUST be edited before it can be used.
tkit/oracle/oracle/MONITOR_PROCESSES ora_reco_${SID_NAME} tkit/oracle/oracle/MAINTENANCE_FLAG yes tkit/oracle/oracle/MONITOR_INTERVAL 30 tkit/oracle/oracle/TIME_OUT 30 tkit/oracle/oracle/PARENT_ENVIRONMENT no tkit/oracle/oracle/CLEANUP_BEFORE_STARTUP no tkit/oracle/oracle/USER_SHUTDOWN_MODE abort tkit/oracle/oracle/KILL_ASM_FOREGROUNDS yes tkit/oracle/oracle/DB_SERVICE all service_name oracle_service service_cmd "${SGCONF}/scripts/tkit/oracle/tkit_module.
Glossary ${SGCONF} /usr/local/cmcluster/conf for RHEL ADF Attribute definition file ASM Automatic Storage Management Configuration directory mode of operation It allows you to maintain your own directory and copy all the toolkits scripts in this directory.
Index Shared configuration, 9 C Configuring Configuring ASM, 11 Configuring Configuring ASM, 16 legacy ASM database package, 21 legacy Oracle database package without modular ASM database package, 31 modular Oracle database package without I Installation uninstallation, 6 M Managing a package, 40 adding the package to the cluster, 40 Managing packages deleting a package, 41 halting packages, 41 maintaining a package, 40 running packages, 40 Migrating a database package, 42 O Oracle Toolkit Advantages,