If the database must be monitored for a 'hang' condition, then another service has to be added as shown below:

SERVICE_NAME[2]=DB_HANG_0

SERVICE_CMD[2]="/etc/cmcluster/pkg/ORACLE_TEST0/toolkit.sh hang_monitor 30 failure" SERVICE_RESTART[2]="-r 2"

The service restart counter can be reset to zero for this service by using Serviceguard command cmmodpkg. The service restart counter is incremented each time the service fails. It is used to determine when a package has exceeded its restart limit as defined by the SERVICE_RESTART parameter in the package control script.

To reset the restart counter execute the following command:cmmodpkg [-v] [-n node_name] -R -s service_name package_name

NOTE: If listener monitoring is not required, then do NOT configure a new service for listener.

Edit the customer_defined_run_cmds function to execute the toolkit.sh script with the start option. In the example below, the line /etc/cmcluster/pkg/ORACLE_TEST0/ toolkit.sh start was added, and the ":" null command line deleted.

For example:

function customer_defined_run_cmds

{

#Start the Oracle database. /etc/cmcluster/pkg/ORACLE_TEST0/toolkit.sh start

test_return 51

}

Edit the customer_defined_halt_cmds function as shown below to include the check to get the reason for package halt, that is, whether the package halt is due to a failure of a service or a user initiated shutdown. Also, execute the toolkit.sh script with the stop option.

For example:

function customer_defined_halt_cmds

{

# Stops the database with a "shutdown abort" or a#"shutdown immediate" command.if [ $SG_HALT_REASON = "user_halt" ]; then reason="user"elsereason="auto"

fi

/etc/cmcluster/pkg/ORACLE_TEST0/toolkit.sh stop $reason

test_return 52

}

The Serviceguard package configuration file (ORACLE_TEST0.conf).

The package configuration file is created with "cmmakepkg -p", and should be put in the following location:

'/etc/cmcluster/pkg/${SID_NAME}/${SID_NAME}.conf'

For example:

/etc/cmcluster/pkg/ORACLE_TEST0/ORACLE_TEST0.conf

22 Using the Oracle Toolkit in an HP Serviceguard Cluster