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: 25 Apr 2007 14:32:30 -0700
Message-ID: <1177536750.432125.317520@u32g2000prd.googlegroups.com>


Jomon,

Your suggestion is very tuned with what we really want to prepare.

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

We have added these ps tests into the script. With this we are sure when
DB is up. On the other hand we want to know when DB is up and is actually
working as should, that is, is open and answer queries. So we have adapted
below ideas.

>
> 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;

We are thinking about adding something as follows:

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

Then according to grep result we may know if DB is really working or is stopped.

>
> Thanks
> Jomon jcob

Thanks to everyone for the help Received on Wed Apr 25 2007 - 16:32:30 CDT

Original text of this message

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