|
|
|
|
Re: Script to check DB and Listiners are up also to alert when diskspace about to filled up [message #248280 is a reply to message #248074] |
Thu, 28 June 2007 09:32 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
Coustomize this script according to your requirments..
. $HOME/.profile_MYDB
# Check if listener is up
#
$ORACLE_HOME/bin/lsnrctl status > /dev/null
STATUS=$?
if test $STATUS -eq 0
then
echo "Listener for $ORACLE_SID is up and running" >> $wlogfile
else
echo "Listener for $ORACLE_SID is Down" >> $werrfile
$ORACLE_HOME/bin/lsnrctl start > /dev/null
echo "Listener Started for $ORACLE_SID " >> $werrfile
fi
ps -fu oracle | grep "ora_[a-z]*[0-9]*_${ORACLE_SID}" > /dev/null
STATUS=$?
if test $STATUS -eq 0
then
echo "Oracle up and running" >> $wlogfile
else
echo "Oracle Not Available $ORACLE_SID" >> $werrfile
$MYDB_SCRIPT/daily/dbstart > /dev/null
echo "Oracle Db Started for $ORACLE_SID " >> $werrfile
fi
#
# Check the alert log file for any errors
#
walertfile=$MYDB_ORADUMP/alert_${ORACLE_SID}.log;
#
if test -f ${walertfile}
then
if test `grep "ORA-" ${walertfile} | wc -l` -ne 0
then
grep "ORA-" ${walertfile} >> $werrfile
cat ${walertfile} >> ${walertfile}.${wdate}
rm ${walertfile}
touch ${walertfile}
else
echo "No Errors in the Alert log file" >> $wlogfile
fi
|
|
|
Re: Script to check DB and listiner are up [message #248292 is a reply to message #248071] |
Thu, 28 June 2007 09:59 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
puneetsachar wrote on Wed, 27 June 2007 23:22 | Hi guys
Could anyone pass me the script to check the DB and listiner, so that i can place the script on crontab..
Please guys!!
Thanks
Adios
Puneet
|
do not CROSS POST....
before pasting your question make sure you check your previous thread...
Go your answer is waiting in UNIX SECTIONNNNNN.
|
|
|