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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Perl script to verify DB is up.

RE: Perl script to verify DB is up.

From: Jesse, Rich <Rich.Jesse_at_qtiworld.com>
Date: Wed, 21 Jun 2000 16:32:28 -0500
Message-Id: <10535.110078@fatcity.com>


I've done the same, except there's no need to add tables. I've created a "dummy" user with only the CREATE SESSION priv, no object privs, and no TS quota. Then, I can run this shell script:

	DBOpen=`sqlplus -s dumbuser/dumbpass@$ORACLE_SID <<EOD
	set pagesize 0 feedback off verify off heading off echo off
	select count(*) from dual;
	exit;
	EOD`

	if [ ${#DBOpen} -ne 3 ]; then
	        echo "`date '+%m/%d/%y %H:%M:%S'`  Database $ORACLE_SID is
not currently available."
	        exit 1
	fi

This works for me under Korn on HP/UX 10.20 and Oracle 8.0.5.

Rich Jesse                          System/Database Administrator
Rich.Jesse_at_qtiworld.com             QTI -- Sussex, WI USA


> -----Original Message-----
> From: Smith, Ron L. [mailto:rlsmith_at_kmg.com]
> Sent: Wednesday, June 21, 2000 11:22
> To: Multiple recipients of list ORACLE-L
> Subject: RE: Perl script to verify DB is up.
>
>
> We have unix/sqlplus scripts that check to see if pmon is
> running and the
> listener is running. But we have found that that isn't
> enough. We are in
> the process of adding a dummy user and table to each instance. The
> monitoring script will actually do an sql query to the
> instance as the dummy
> user to retreive a record from the table. If it works it
> means the server,
> instance and listener are all up and working. We have the
> scripts scheduled
> through cron to run every 15 minutes.
>
> Ron Smith
> Database Administration
> rlsmith_at_kmg.com


This message has been scanned for viruses with Trend Micro's Interscan VirusWall. Received on Wed Jun 21 2000 - 16:32:28 CDT

Original text of this message

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