# @(#)22 1.3 src/43haes/usr/sbin/cluster/sa/oracle/sbin/DBInstanceMonitor.sh, hacmp.assist.oracle, 61haes_r721, 1620B_hacmp721 10/7/15 11:34:01 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # 61haes_r721 src/43haes/usr/sbin/cluster/sa/oracle/sbin/DBInstanceMonitor.sh 1.3 # # Licensed Materials - Property of IBM # # Restricted Materials of IBM # # COPYRIGHT International Business Machines Corp. 2006,2015 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG #---------------------------------------------------------------------------- # Global Definitions: #---------------------------------------------------------------------------- . /usr/es/sbin/cluster/sa/oracle/sbin/DBUtilities . /usr/es/sbin/cluster/sa/oracle/sbin/DBStatus #---------------------------------------------------------------------------- # Function: # osaDBShowStatus # # Purpose: # Shows status of a DB instance # # Arguments: # n/a # # Returns: # 0 if all components of DB instance are active # 1 otherwise # function osaDBShowStatus { [[ -z $(whence clodmget) ]] && export PATH=$PATH:/usr/es/sbin/cluster/utilities eval export $(cllsparam -n $(clodmget -f nodename HACMPcluster)) if [[ $VERBOSE_LOGGING == high ]] then PS4_TIMER=true PS4_FUNC=oraDBShowStatus set -x version='1.3' fi typeset -i stat=0 typeset -i sqlstat=0 typeset -i procstat=0 typeset -i lisnstat=0 osaSQLStatus sqlstat=$? if (( $sqlstat != 0 )) then log_msg "The SQL component of the DB instance is unavailable" fi osaProcStatus procstat=$? if (( $procstat != 0 )) then log_msg "The Proc component of the DB instance is unavailable" fi osaListenerStatus lisnstat=$? if (( $lisnstat != 0 )) then log_msg "The Listener component of the DB instance is unavailable" fi log_msg "[SQL status: "$sqlstat"], [Process status: "$procstat"], [Listener status: "$lisnstat"]" if (( $sqlstat == 0 && $procstat == 0 && $lisnstat == 0 )); then log_msg "Overall DB Instance is fully functional." return 0 fi }