How to clean up all abnormally terminated sessions between client and database server?
GOAL

All abnormally terminated sessions between a database server and a client must be cleaned up automatically.

SOLUTION

Dead Connection Detection DCD is intended primarily for environments in which clients power down their systems or client machines crash unexpectedly without disconnecting from Oracle Database sessions.

This feature is configured on an Oracle Database server-side and it is controlled/enabled by using parameter SQLNET.EXPIRE_TIME in sqlnet.ora file

Purpose
To specify a time interval, in minutes, to send a check to verify that client/server connections are active.

Usage Notes
Setting a value greater than 0 ensures that connections are not left open indefinitely, due to an abnormal client termination. If the system supports TCP keepalive tuning, then Oracle Net Services automatically uses the enhanced detection model, and tunes the TCP keepalive parameters

If the probe finds a terminated connection, or a connection that is no longer in use, then it returns an error, causing the server process to exit.

This parameter is primarily intended for the database server, which typically handles multiple connections at any one time.

Limitations on using this terminated connection detection feature are:

  • It is not allowed on bequeathed connections.
  • Though very small, a probe packet generates additional traffic that may downgrade network performance.
  • Depending on which operating system is in use, the server may need to perform additional processing to distinguish the connection probing event from other events that occur. This can also result in degraded network performance.

 
Default
0

Minimum Value
0

Recommended Value
10

Example
SQLNET.EXPIRE_TIME=10

For instance, This will test every 10 minutes whether existing connected users sessions are still alive.

oracle@dbpilot~:<tst19c> cat $ORACLE_HOME/network/admin/sqlnet.ora
SQLNET.EXPIRE_TIME=10

Written At
08 JAN 202218:30
Database Release
All Releases