Reference Architecture: Consolidating Oracle Databases with Secure Resource Partitions in a Serviceguard Cluster Whitepaper
32
mktprd.rose.hp.com)(PORT = 1521))(CONNECT_DATA = (SERVER =
DEDICATED)(SERVICE_NAME = MKTPRD)))"
EMPNO ENAME JOB MGR HIREDATE SAL
COMM
---------- ---------- --------- ---------- --------- ---------- ---------
-
DEPTNO
----------
7902 FORD ANALYST 7566 03-DEC-81 3000
20
Step 5: Extending Serviceguard monitor script (only use for
Serviceguard integration)
SRP provides a basic Serviceguard monitor script (srp_monitor_script) that can monitor critical
application functionality. The included monitor script will monitor the SSH Server (sshd) by verifying if
the PID listed in the /var/hpsrp/$SRP_NAME/opt/ssh/sshd.pid is still running in the compartment. If
the PID is not running, then the monitor script exits and causes a package failover. Failing over the
package because the sshd has failed or has been inadvertently stopped is provided as an example
and is generally not implemented for production use.
If the monitored process or processes create a PID file when started, then those files can be added to
the list of PID files the srp_monitor_script monitors by modifying the srp_script.incl file in the
package configuration directory. The following is an example of adding additional PID files to be
monitored:
# grep ^SRP_PIDFILE /etc/cmcluster/MKTPRD/srp_script.incl
SRP_PIDFILE[1]="/var/hpsrp/$SRP_NAME/tmp/app1.pid"
SRP_PIDFILE[2]="/var/hpsrp/$SRP_NAME/tmp/app2.pid"
If this does not meet your requirements, then modify the monitor script.
The following example adds basic availability testing to the sample monitor script. This is provided as
an example only. You can add additional capabilities based on the deployment requirements.
In the SRP monitor script /etc/cmcluster/MKTPRD/srp_monitor_script), add the following functions to
check the status of the database and listener.
###################################################################
#
# Functions
#
###################################################################
export ORACLE_HOME=/var/hpsrp/MKTPRD/u01/app/product/11.1.0/db_1
export ORACLE_SID=MKTPRD
export ORACLE_USER=ora_mkt
export MAINTENANCE_FILE=`dirname $0`/oracle.debug
function listener_up
{
if [ -f "$MAINTENANCE_FILE" ]; then
return 0
fi
$ORACLE_HOME/bin/tnsping $ORACLE_SID >/dev/null 2>&1
return $?