#!/bin/ksh # # Scriptname : $II_SYSTEM/ingres/scripts/db_status.ksh # # Description : Lists the status of all databases on a given installation # and checks the availability of the dbms servers. # # Parameters : None. # # Author : M S Ramsay 26 October 1999 # # History Date Name Reason # ---- ---- ------ # dd/mm/yy xxx xxxxxxxxxxxxxxxxxxxxxxxx # ############################################################################ # #Parameter validation and set-up. # set +A SDS_dbinfo #Array variable SDS_scriptname="`basename $0`" SDS_runtype=${1:-} if [[ $SDS_runtype != '' ]] && [[ $SDS_runtype != 'h' ]] then echo "" echo "ERROR in script $SDS_scriptname - Variable \$1 is invalid. Should not be $1." echo "" echo "Try:-" echo "" echo "h - Help" echo "" exit fi if [[ $SDS_runtype = 'h' ]] then echo echo "SCRIPT DB_STATUS.KSH." echo "=====================" echo echo echo "Description:-" echo "" echo "This script checks the status of the DBMS servers registered" echo "with the name server. It checks the number of DBMS processes" echo "with the number of NAME server registrations and it checks" echo "the availability of each database." echo "" echo "Parameters:- " echo "" echo "h - Help" echo "" exit fi clear # #Determine the number of DBMS servers running. # SDS_servers=$(iinamu </dev/null EOT if [[ $? = 0 ]] then print "Available" else print "Not Responding." echo echo echo echo "***********************************************************" echo "***** It seems that at least one DBMS server is *****" echo "***** unavailable. This could cause problems for *****" echo "***** users of this installtion. Please notify *****" echo "***** DBA immediately. Once the problem has been *****" echo "***** fixed re-run this script. *****" echo "***********************************************************" exit fi done export II_DBMS_SERVER=$SDS_old_value echo echo "Starting Database availability check...." echo # #Get a list of all databases on the current installation. # SDS_dbname=$(sql iidbdb </dev/null EOT if [[ $? = 0 ]] then print "Available" else print "Not Responding. Contact DBA." fi done