Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to know Oracle Down ?
You can use the following shell script and have it email you the error message . Th eemailing is not enabled in teh script because I use it for HP OpenView monitoring which reads the text out put constantly .
One point to note is that to check the network
connectivity the script has to
Reside on the machine it is checking . Of course this
could be modified to add further
Functionality . This is just a frame work .
#!/usr/bin/sh
###################################################################################################
#
# Auther : Raj Sakthi
#
# Modification History :
# 02/23/00 : Network Connectivity Checking was added
.
#
# *** THIS SCRIPT CHECKS FOR THE AVAILABILITY OF
INSTANCE ALONG WITH THE ****
# *** NETWORK CONNECTIVITY
do
sleep 1
done
#
# If the file Doesn't exist then we check for internal
connectivity …………..
#--------------------------------------------------------------------------------
if [ ! -f $READY ]
then
print " connect internal exit " | sqlplus /nolog > $SID_connect.log egrep 'Connected' $SID_connect.log > /dev/null if [ $? = 0 ] then echo " Problem in Network connectivity of $SID " else echo " Instance $SID is not responding "
exit 86 fi
egrep 'ORA-01034|ORA-12224|ORA-12154'
$CHECK_CONNECT > /dev/null
if [[ $? = 0 ]]; then
echo "Instance '$SID' is NOT accessible, or invalid
ORACLE_SID"
rm $CHECK_CONNECT
rm $READY
#
# Here instance is not available....staight and
simple..: )
#-----------------------------------------------------------------------------
exit 86
else
#
# Check for INSTANCE availability by the specific
ORACLE error..........slick ..eh?!
#-------------------------------------------------------------------------
grep 'ORA-01017' $CHECK_CONNECT > /dev/null if [[ $? = 0 ]]; then
echo "Instance '$SID' is UP and Accessible"
else
#
#To catch any other error .....
#
echo "Instance '$SID' is HAVING UNKNOWN ERROR. \n Verify Instance internal state "
fi
fi
rm $CHECK_CONNECT
rm $READY
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Sakthi , Raj INET: rajan_sakthi_at_yahoo.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Jul 31 2001 - 10:31:48 CDT
![]() |
![]() |