Re: Script to CHeck if the database is Up

From: John Strange <jstrange_at_imtn.dsccc.com>
Date: 1996/04/19
Message-ID: <4l80l7$ftd_at_tpd.dsccc.com>#1/1


Create an exit.sql
put an EXIT 3 as the last line.

The "at" or "cron" script could be

	sqlplus junk/junk _at_exit.sql
	if [ $? != 3 ] ; then
	  page me, page me
	else
	fi

You may have to work on the "if [" syntax

badri (badri_at_cc.gatech.edu) wrote:
:> Hi:
 

:> I would like to have a script (on UNIX) that would attempt
:> to login to the (7.2) database. If it fails, it should page
:> me. Could I invoke a sqlplus script that did "exit"
:> and then echo $? to check the return of the previous command - is
:> this reliable? I dont want to do a ps to look for the dbwriter and
:> conclude that the database is up - for some reason, the shutdown
:> could have failed and the database could be hung...(I can dream on).
 

:> How else would this be reliably done?
 

:> thanks a lot,
 

:> -Badri

--
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 Fri Apr 19 1996 - 00:00:00 CEST

Original text of this message