Reference Architecture: Consolidating Oracle Databases with Secure Resource Partitions in a Serviceguard Cluster Whitepaper
33
}
function db_active
{
if [ -f "$MAINTENANCE_FILE" ]; then
return 0
fi
active=`su $ORACLE_USER -c "echo 'set head off\nconn / as sysdba\n
select DATABASE_STATUS from v\\\$instance;' | ${ORACLE_HOME}/bin/sqlplus
-S /nolog"`
echo $active | grep ACTIVE >/dev/null
return $?
}
In the main block of the script add the code between the Begin/End added code comments:
################
# main routine
################
while [ 0 ]
do
sleep $SLEEP_TIME
# Begin added code
listener_up
if (($? != 0)); then
echo "ERROR: Listener not running in SRP $SRP_NAME"
exit 1
fi
db_active
if (($? != 0)); then
echo "ERROR: Database not Active in SRP $SRP_NAME"
exit 1
fi
# End added code
# loop through SRP_PIDFILE array
for pidfile in ${SRP_PIDFILE[@]}
…