Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to test if Oracle is up or down???
Feel free to port the following:
# /*********************************************************************** # * # * a korn shell script to login to oracle to see if it is up. # * # * The 6 "set pause off" are to get you through the # * request for id and passwords if the id/passwd is invalid. # * # * If you connect to oracle, a 5 will be returned as a status # * value at the shell. # * # * The <<'EOF' tells the shell to feed the following lines to # * sqlplus until the shell finds the string 'EOF' # * # ***********************************************************************/
sqlplus <<'EOF'
id/passwd
set pause off
set pause off
set pause off
set pause off
set pause off
set pause off
exit 5
EOF
if [ $? != 5 ] ; then
echo "Could not get into oracle"
return
fi
# /******************** end of scipt ***********************
william.timm_at_sap-ag.de wrote:
: How can I test if Oracle is up? We are writing a NT batch script for
: some administrative tasks and we first need to check wether Oracle is
: up or down, can this be done in a NT batch script, anyone out there
: doing somthing simular.
: Thanks in advance,
: Bill Timm
: william.timm_at_sap-ag.de
--
While DSC may claim ownership of all my ideas (on or off the job),
DSC does not claim any responsibility for them. Warranty expired when you
opened this article and I will not be responsible for its contents or use.
Received on Fri May 22 1998 - 06:55:56 CDT