Re: SQL*Net Status Check Script
Date: 1996/10/29
Message-ID: <555akq$65r_at_login.freenet.columbus.oh.us>#1/1
Jay Mehta (jvmehta_at_mra.ffx.mobil.com) wrote:
: We would like to automate SQL*Net 1 and SQL*Net 2 status check on HP/UX boxes every 15
: minutes. For example, have a shell script, scheduled via cron, check the status of SQL*Net
: 1 and SQL*Net 2 every 15 minutes. If SQL*Net is down or not responding, then maybe try to
: restart it.
: I think many DBAs might be using an automated SQL*Net status check script. And if
: possible, I don't want to reinvent the wheel. Would anybody like to share this kind of
: shell script?
Can't help u much with sql*net1(we quit using it), but here is what i use for checking whether the listener(sqlnet v2) is still up and running
#!/bin/ksh # # Program: check_listener.sh # Written by: Joseph S. Testa # Date: mar 25, 1996. # #
if [ $# -ne 0 ]
then
echo "usage:$0 "
exit 1
fi
ORACLE_SID=EPA1;export ORACLE_SID ORACLE_HOME=`grep $ORACLE_SID /etc/oratab | cut -d: -f2`;export ORACLE_HOME ORAENV_ASK=NO; export ORAENV_ASK
. /usr/local/bin/ipora
. /usr/local/bin/oraenv
COUNT=`ps -ef | grep "tnslsnr" | grep "LISTENER" | wc -l`
if [ $COUNT -lt 1 ]
then
# _at_(#) 0020 - check_listener.sh - LISTENER NOT UP AND RUNNING
echo "NO LISTENER found at `date`"
call_pager blahm blah, blah, (codes)(didn't want to post my pager# :)
fi
exit 0
#end of check_listener.sh
feel free to use is (yes, all of you) ;) joe
PS this is for the unix world, particularly HPUX
-- Joseph S. Testa, Database Administrator, Ohio EPA N8XCT, Emergency Coordinator (EC) & Local Govt Liaison (LGL) Pickaway County, OH and Official Relay Station (ORS), message content are MY views and NOT my current employer.Received on Tue Oct 29 1996 - 00:00:00 CET