Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if Oracle is down after open a connection

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Part of our web site's home page (the top half) reads an Oracle table and dynamically displays the News items.

After trying to open an Oracle data connection, I would like to check if the Oracle server is down. If it is, I would like to have the page skip the SQL statements to display the News items and just go to display the rest of the page which is straight HTML.

Please, can anyone give me some suggestions for this. Thanks.
 
The only thing I can think of is trying to select status from v$instance. If the instance is up but the database is not open, you will get a response. However, this requires the account you are connecting as to have select privileges on the V$INSTANCE view.
 
another problem is sometimes the listener and not the database. tnsping is a fine utility for that purpose.
regards
SteenB
 

It is pretty much straite forward that if you make a conection from you application and the function or method of your application does not throgh and Exception its mean that your connection is succesful and database is Up. once you connect to Database, and dataabse is down after your Connection established, then run your SQL statement ,and I recomend to use try {} catch block to find out what is the result of your SQL query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top