#######################################################################
## cklsnr.sh ##
#######################################################################
#!/bin/ksh
DBALIST="tyagi.ankur07@gmail.com";export DBALIST
cd $TNS_ADMIN
rm -f lsnr.exist
ps -ef | grep LISTENER_NAME | grep -v grep > lsnr.exist
if [ -s lsnr.exist ]
then
echo
else
echo "Alert" | mailx -s "Listener 'LISTENER_NAME' on `hostname` is down" $DBALIST
TNS_ADMIN=$ORACLE_HOME/network/admin/; export TNS_ADMIN
ORACLE_SID=$SID; export ORACLE_SID
ORAENV_ASK=NO; export ORAENV_ASK
PATH=$PATH:/bin:/usr/local/bin; export PATH
. oraenv
LD_LIBRARY_PATH=${ORACLE_HOME}/lib;export LD_LIBRARY_PATH
lsnrctl start LISTENER_NAME
fi
## cklsnr.sh ##
#######################################################################
#!/bin/ksh
DBALIST="tyagi.ankur07@gmail.com";export DBALIST
cd $TNS_ADMIN
rm -f lsnr.exist
ps -ef | grep LISTENER_NAME | grep -v grep > lsnr.exist
if [ -s lsnr.exist ]
then
echo
else
echo "Alert" | mailx -s "Listener 'LISTENER_NAME' on `hostname` is down" $DBALIST
TNS_ADMIN=$ORACLE_HOME/network/admin/; export TNS_ADMIN
ORACLE_SID=$SID; export ORACLE_SID
ORAENV_ASK=NO; export ORAENV_ASK
PATH=$PATH:/bin:/usr/local/bin; export PATH
. oraenv
LD_LIBRARY_PATH=${ORACLE_HOME}/lib;export LD_LIBRARY_PATH
lsnrctl start LISTENER_NAME
fi
Hi Ankur,
ReplyDeleteCan you please give any script to check the status of DB available on the servers
using ORATAB file
Thanks
A