Problem solve Get help with specific problems with your technologies, process and projects.

Does Oracle log disconnections?

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:

You 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

Dig Deeper on Oracle database design and architecture