Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to tell if Oracle is ready?
# /***********************************************************************
# *
# * 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