The basic purpose of the sqlnet.ora file is to provide server-specific information about default locations and thresholds for network services.
This special file is created for all Oracle servers and nodes on the network and includes the following information:
- The time interval between the sending of two probes to determine whether a client/server connection is still alive
(This is called dead connection detection.)
- Optional tracing and logging parameters
- Client parameters for use with Oracle Names
- The location of the Net trace and log files
- Other optional parameters
In Oracle7, the default location of sqlnet.ora was in the $ORACLE_HOME/network/admin directory on a UNIX server, and in ORACLE_HOME\network\admin on Windows servers.
SQL*Net/Net can automatically detect and terminate connections that are no longer valid. This feature is particularly useful for environments in which the clients are PCs, because users may reboot their PCs or otherwise terminate their sessions without logging out of the database. Rebooting a PC does not in and of itself cause the corresponding database session to terminate, because the underlying transport, such as TCP/IP, does not recognize it as such. The worst-case scenario is that the user reboots his PC while he has a lock on a table. Although you can assign a profile to your users that limits connect time and idle time, you usually have to set these limits high enough to accommodate users who want to go out to lunch without logging out of the application (e.g., several hours).
You can use dead connection detection to search and destroy invalid connections every 10 minutes or so.
To do so, you must specify the optional parameter SQLNET.EXPIRE_TIME in the
sqlnet.ora file
. The number you specify is the frequency in minutes with which SQL*Net/Net probes connections to confirm their validity. Sessions that are dead or invalid are terminated. If dead connection detection is enabled, SQL*Net sends a probe periodically to determine whether there is an invalid connection that should be terminated. If it finds a dead connection, or a connection that returns an error, it causes the server to terminate the connection.
Of course, there is a certain amount of overhead associated with using dead connection detection:
- Additional network traffic for the dead connection probes every SQLNET.EXPIRE_TIME minutes.
- Potential performance degradation on the Oracle server which must distinguish between connection probing events and other events. You should perform your own analysis to determine whether your platform is adversely affected.
Some protocols have their own dead connection detection algorithms, which may obviate the need to use SQL*Net/Net's version.
In the next lesson, we will look at a this same file for an Oracle server.