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 check if the database is active

Re: How to check if the database is active

From: pady srinivasan <pady_at_imncorp.com>
Date: 1997/08/11
Message-ID: <33EF9178.1CCE3E49@imncorp.com>#1/1

This is a multi-part message in MIME format.

--------------43CA192990DA571A4693ECF8
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit

Gilberto Casiraghi wrote:

> I need to check if my database is active before run a particular
> job started by the unix cron daemon.
> Till now I have checked the file $ORACLE_HOME/dbs/sgadefSID.dbf
> (I have Oracle 7.2) but in my case is not a good solution.
> In fact that file can exist also during the startup phase
> when the database is not yet available. So when the cron start
> my job, it stops abnormally.
>
> Can anyone have others idea ??
> Thanks in advance.
>
> Gilberto Casiraghi.
> edipi_at_candy.it

  Since it is UNIX, why not do this:

For Sys V compatible OS,

  if [ "`ps -ef | grep ora_smon_$ORACLE_SID | grep -v grep`" = "" ]   then

            echo "Oracle ( sid : $ORACLE_SID ) not up. Exiting"
            exit 1

    fi

# Continue with script

Pady Srinivasan
pady_at_imncorp.com

--------------43CA192990DA571A4693ECF8
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for pady  Srinivasan
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             pady  Srinivasan
n:              Srinivasan;pady 
org:            Integrated Medical Networks
email;internet: pady_at_imncorp.com
title:          Oracle DBA/UNIX sysadmin
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
end: vcard

--------------43CA192990DA571A4693ECF8-- Received on Mon Aug 11 1997 - 00:00:00 CDT

Original text of this message

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