Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For our application we have configuration file for connection to the Oracle Databese (url, user, pass).

Application start for 2-5 minutes. If some wrong with databese i see this in logs, but i must wait this 2-5 minutes... it is lost of time...

So I try find most quickly and simply way to determine that with database all ok and database online.

Do you have any idea how can I do it?


share|improve this question
Do you mean manually check the database is up? How about seeing if you can connect with SQL*Plus? – Jack Douglas Aug 17 '11 at 9:42

You should use/write a script that will connect to the server and see if your database is online. Here the Oracle guys will help. Just execute it from a batch/shell script (see Running Scripts From SQL Command Line) and see it's output. If everything is alright than you have your answer.

Or just try with SQL*Plus client.

share|improve this answer

If you run the following query:


It should return:

---------------- ------------ -----------------
share|improve this answer

ps -ef | grep pmon

PMON (process monitor) process checks all other background processes. Then you must check alert log for further investigation.

share|improve this answer

First thing first: you need to know the username and password to connect to database for step 2 1. check the oracle process runs: On Un*x:

ps -ef|grep pmon

On Windows:

tasklist|findstr /i oracle

if the command in any case return output i.e. if the pmon/oracle process is running in your environment the database is running.

  1. Go to ORACLE_HOME/bin and run

    ./sqlplus /nolog

If after login you get errors, then the database does not run:

SQL*Plus: Release Production on Sat Feb 31 21:61:61 2014

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter user-name: oracle
Enter password: 
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
share|improve this answer

It might be wise to run an actual query against the database as well. This just ensures that you can both connect and query. I would make it something very simple and fast, such as:

SELECT pk_column 
  FROM sometable
WHERE rownum <= 1
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.