#!/bin/ksh # Program: heartbeat_db # Purpose: This script verifies the database is running # Author: Adam Backman # Date Written: 03/09/98 # # Setup the environment SCRIPTS=${SCRIPTS-/u3/users/adamb/scripts} export SCRIPTS # Setup database specific variables . $SCRIPTS/live/read_registry $1 case $? in 2) echo "Database $1 is not in database registry" exit 1 ;; 3) echo "Database $1 is on $HOST not on this host" exit 1 ;; esac # Check to see if the database is up or down proutil $DB_DIR/$DB -C busy 2>/dev/null >/dev/null if [ $? = 0 ] then MESG="Database $DB_DIR/$DB has gone down - Please Check" echo $MESG exit 1 fi