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: easy ways to know oracle is up

Re: easy ways to know oracle is up

From: betelge87 <betelge87_at_yahoo.com>
Date: 24 Apr 2007 13:57:46 -0700
Message-ID: <1177448266.134138.168690@r3g2000prh.googlegroups.com>


Jomon,

your suggestions are perfectly tuned with what we want to do.

See below.

On Apr 24, 2:46 pm, Jomon P Jacob <jacob.jo..._at_gmail.com> wrote:
> You can use the following commans in unix :
>
> PROCS='ps -ef | grep <DB_SID> | wc -l`
>
> if [ ${PROCS} -ge 4 ]
> then
> echo " Database is up and running"
> else
> DBRUN="Database is down"
> fi
>
> Or even You can use the following command to check whether any of the
> mandaatory process is running :
> % ps -ef | grep pmon
>
> This will list you the whether the pmon process for the particular DB
> is up and runing
> eg :
> pmon_mydb
>

Your ps command searching for the main process is perfect what we need and we have added these checks on our script. With this we think that we assure if DB is up and running.

> In windows you may
> 1 ) Set the ORACLE_SID
> 2 ) Start the SQLPLUS as " sqlplus "/ as sysdba" <===
> provided you have rights ( or use sys/passwd)
> 3) It dispaly " connnected to an idle instance" if the db
> is down
>
> or else Query :
> SQL> select status from v$database;

With this other part we would like to check when the DB is up and running
but something is stuck and DB is not really working or DB is closed. By using your idea
we could implement something as follows:

sqlplus "/ as sysdba" << EOF
select status from v$database;
EOF | grep "idle"

and then check if grep was successful or not and take a decision in each case.
Any suggestion is appreciated.

>
> Thanks
> Jomon jcob

Thanks again everyone for your help. Received on Tue Apr 24 2007 - 15:57:46 CDT

Original text of this message

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