Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to check if the database is active
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
# 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 sysadminx-mozilla-cpt: ;0
--------------43CA192990DA571A4693ECF8-- Received on Mon Aug 11 1997 - 00:00:00 CDT
![]() |
![]() |