We have Oracle 9.2 on Sun 5.8. We are accessing the database through a JDBC thin client from our Web server. Application servers make multiple connections to the database and keep these connections open. Everything works fine until I come back a day later, and some of the connections to the database are invalid, and I get socket errors. Not all connections have this problem, only about 25% of them.
I tried looking into the listener.log file to see failed/dropped connections. But the listener.log tells only about successful connections. I tried to look into sqlnet.log on the server side, but I couldn't find the file. I tried to look into sqlnet.log on the client machine. But we have not loaded the Oracle client on the application server since we are accessing the database thru JDBC.
When the client disconnects from the server, where will Oracle log this action? Is there a place where Oracle logs all disconnections, like it keeps track of all successful connections on the server side?
Oracle doesn't keep track of the disconnections. So there really isn't a place to look. But I can make a few suggestions.
First, Load Oracle Client on the application server. Then, make sure that your Java (or JSP) application is using Oracle's JDBC drivers. There are different types of JDBC drivers, so experiment and see which is best for your situation.
If the problem is still not resolved, then you'll want to enable tracing on each connection. This can be done in your SQLNET.ORA file. Add the following lines to your SQLNET.ORA file:
trace_level_client=support trace_file_client=cli trace_directory_client=/somedir/trace trace_unique_client=trueYou can look up more information about the above in the Oracle documentation. Then, find trace files for your mysterious disconnections and send them to Oracle Support for advice.
For More Information
- Dozens more answers to tough Oracle questions from Brian Peasland are available.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.