| Lesson 7 | The sqlnet.ora File |
| Objective | Locate the Oracle Net profile used by a client or database process and distinguish its settings from connection aliases and listener configuration. |
sqlnet.ora is an Oracle Net profile used by clients and database servers. For Oracle AI Database 26ai, check the directory named by TNS_ADMIN first, followed by ORACLE_BASE_HOME/network/admin and ORACLE_HOME/network/admin. With a read-only Oracle home, the default configuration belongs under ORACLE_BASE_HOME. Instant Client also supports a network/admin subdirectory in its installation.
The practical question is not simply whether a file exists: which Oracle installation and environment does the failing application use? A working command-line connection and a failing background service can use different profiles on the same computer.
TNS_ADMIN identifies a directory, not the path to an individual file. For example, if its value is /opt/company/oracle-net, inspect /opt/company/oracle-net/sqlnet.ora. The corresponding Windows example is C:\Oracle\network\admin\sqlnet.ora when the directory setting is C:\Oracle\network\admin.
Run these read-only checks in the environment from which you start the client:
printf 'TNS_ADMIN=%s\n' "$TNS_ADMIN"
printf 'ORACLE_HOME=%s\n' "$ORACLE_HOME"
command -v sqlplus
# Inspect this location only when TNS_ADMIN is set:
if [ -n "$TNS_ADMIN" ]; then
ls -l "$TNS_ADMIN/sqlnet.ora"
fi
$env:TNS_ADMIN
$env:ORACLE_HOME
Get-Command sqlplus -ErrorAction SilentlyContinue
if ($env:TNS_ADMIN) {
Get-Item -LiteralPath (Join-Path $env:TNS_ADMIN 'sqlnet.ora')
}
An empty environment-variable result does not prove that Oracle Net has no configuration. Continue with the relevant Oracle home and its documented defaults. Conversely, the presence of an old ORACLE_HOME variable does not prove that the executable selected through PATH belongs to that home.
For a Windows service, application pool, container, or scheduled job, inspect that process's configuration and account. Your interactive terminal shows its own environment. Changing a variable in a terminal does not update an already running service. Also check the documentation for the actual driver: do not assume that a JDBC Thin or managed client consumes every setting supported by an OCI client.
When an application cannot resolve a service alias, checking only the listener file misses the client-side problem. First establish which profile and alias file the application is using; then investigate the host, port, and service it requests.
This example selects local aliases before Easy Connect. It illustrates file syntax, not a complete security policy:
# Try a local alias before Easy Connect.
NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
Keep comments on their own lines when preparing a teaching example. These entries are configuration settings, not SQL statements: do not paste them into a SQL worksheet or append SQL semicolons.
Other settings require deliberate choices. Encryption negotiation is not the same as requiring encryption, and Windows native authentication settings are not portable Linux defaults. Copy only parameters documented for your installed client and server versions.
SQLNET.EXPIRE_TIME concerns dead-connection detection, not a general idle-session logout policy. Modern implementations can use enhanced detection with TCP keepalive where supported. Diagnostic directory parameters also depend on whether Automatic Diagnostic Repository (ADR) diagnostics are enabled. Use the parameter reference before assuming an older trace-directory example still applies.
For example, a user who leaves a healthy connection idle is different from a client whose network connection has failed. Write down which behavior you intend to control before changing timeouts. Record the original configuration and reproduce the symptom with a fresh connection after a controlled change.
TNS_ADMIN value and distinguish Oracle home from Oracle base home.sqlnet.ora.txt. On case-sensitive file systems, case matters.If an old example mentions ENCRYPTION_WALLET_LOCATION, note that it is desupported in Oracle AI Database 26ai; TDE wallet configuration uses WALLET_ROOT. Do not reuse historical wallet or PKCS#11 snippets without checking the release-specific security documentation.
Locate the effective configuration before editing it, then test one intended change at a time. The next lesson examines sqlnet.ora file characteristics.
Reference: Oracle AI Database 26ai: parameters for sqlnet.ora files.
Related reading: Cloud DBA Oracle.