Home » RDBMS Server » Server Administration » Script to check DB and listiner are up (merged)
Script to check DB and listiner are up (merged) [message #248071] Thu, 28 June 2007 00:22 Go to next message
puneetsachar
Messages: 97
Registered: March 2005
Location: New Delhi, India
Member

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
Script to check DB and Listiners are up also to alert when diskspace about to filled up [message #248074 is a reply to message #248071] Thu, 28 June 2007 00:27 Go to previous messageGo to next message
puneetsachar
Messages: 97
Registered: March 2005
Location: New Delhi, India
Member

Hi guys

Could anyone please forward me script to check,

DB, listiner, are up... also script to send alert when diskspace is about to get full..


Thanks
Re: Script to check DB and listiner are up [message #248076 is a reply to message #248071] Thu, 28 June 2007 00:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68686
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Could you search before posting?

Regards
Michel
Re: Script to check DB and listiner are up [message #248092 is a reply to message #248071] Thu, 28 June 2007 01:13 Go to previous messageGo to next message
puneetsachar
Messages: 97
Registered: March 2005
Location: New Delhi, India
Member

I'm sorry...

I did but could not find...

Please help..


Thanks
Puneet
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 Go to previous messageGo to next message
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 Go to previous message
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.
Previous Topic: Oracle Jar Cache
Next Topic: Converting from Informix to Oracle
Goto Forum:
  


Current Time: Thu Sep 19 16:09:55 CDT 2024