Using High Availability Monitors (June 2007)
Monitoring Database Resources
Rules for Using the HA Database Monitor with ServiceGuard
Chapter 3 77
PFILE=$ORACLE_HOME/dbs/init<sid>.ora
su oracle -c $ORACLE_HOME/bin/svrmgrl <<EOF
connect internal
startup pfile=${PFILE}
exit
EOF
test_run 51
}
In the section for customer-defined halt commands, type:
function customer_defined_run_cmds
{
export ORACLE_HOME=<oracle_home_directory>
export ORACLE_SID=<oracle_sid>
PFILE=$ORACLE_HOME/dbs/init<sid>.ora
su oracle -c $ORACLE_HOME/bin/svrmgrl <<EOF
connect internal
shutdown
exit
EOF
test_run 52
}
Points to consider:
• Because Oracle can take some time to shutdown, consider whether to
change shutdown to shutdown immediate in the halt portion of the
script.
• Be sure to code values for RUN_SCRIPT_TIMEOUT and HALT_SCRIPT_
TIMEOUT. This prevents the script from hanging in the event that
Oracle cannot start or stop in a timely manner.
•The RESOURCE_START value must be set to DEFERRED so that
ServiceGuard will bypass checking for the existence of the Oracle
resources until after Oracle has successfully started up.
By adding the Oracle commands into the run and halt portions of the
configuration control script, you allow ServiceGuard to start up and shut
down the Oracle instance for you.