Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to check whether the Oracle database is up?
Sri wrote:
> Using a script, I want to check whether my database instance has been
> started and mounted or not.
> What is the best way to do this?
Platform?
On Unix, you can do a ps and grep for all processes for the Oracle user and all processes for the applicable SID.
Or you can try a SQL*Plus connection and check STDERR/STDOUT to see if the
connection fails, something like:
# sqlplus xxx/xxx < /dev/null | grep ORA
If the result is not a ORA-01017 (invalid username/password) then the database is likely down, in restricted mode, hanging because archive logs are full, busy with a shutdown, or whatever. Whatever it is, it is definately not publicly available for client connections.
Or you can pipe the output of (ex-)server manager to log when the db start is done and then inspech the log with a few well places awk's and grep's.
-- BillyReceived on Fri Aug 30 2002 - 05:29:57 CDT