Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to tell if Oracle is ready?

Re: How to tell if Oracle is ready?

From: John Strange <jstrange_at_imtn.dsccc.com>
Date: 1997/01/30
Message-ID: <5coprt$mpg@camelot.dsccc.com>#1/1

#       /***********************************************************************

# *
# * 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 "It did not work"
  return
fi

Chris Halioris (halioris_chris_nonlilly_at_lilly.com) wrote:

: You could always write a ksh script that used a "here document" to try 
: and log into the database and then grep the result.  If you got a SQL> 
: prompt it must be up, if not, it obviously isn't.
 

: Chris Halioris
: Tactics, Inc.

--
This posting represents the personal opinions of the author. It is not the
official opinion or policy of the author's employer. Warranty expired when you
opened this article and I will not be responsible for its contents or use.
Received on Thu Jan 30 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US