Take the 2-minute tour ×
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. It's 100% free, no registration required.

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?

Thanks.

share|improve this question
2  
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

4 Answers 4

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

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

If you run the following query:

SELECT INSTANCE_NAME, STATUS, DATABASE_STATUS FROM V$INSTANCE;

It should return:

INSTANCE_NAME    STATUS       DATABASE_STATUS
---------------- ------------ -----------------
YOUR_DBASE       OPEN         ACTIVE
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

Your Answer

 
discard

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.