16.6.2 Understanding Error Stack Messages

Although the application displays only a one-line error message, an error stack that is much more informative is recorded in the log file by the network layer.

Suppose that a user of a client application tries to establish a connection with the database server using Oracle Net and TCP/IP, by entering the following commands:

SQLPLUS scott@example.com
Enter password: password

When the commands are entered, the following error appears:

ORA-12543: TNS:Unable to connect to destination

This message indicates that the connection to the server failed because the database could not be contacted.

On the client side, the sqlnet.log file contains an error stack corresponding to the ORA-12543 error. As shown in the following example logs, the messages can appear in a concise format (default setting) or in a more detailed long format:

  • Concise format: This format displays all the relevant information in a single line. This helps in reducing the size of the log file and makes it easier to understand.

    The sqlnet.ora setting ENABLE_CONCISE_LOGS=TRUE enables logging in a concise format.

  • Long format: This is the regular longer format that includes multiple lines, with additional details such as Version information.

    The sqlnet.ora setting ENABLE_CONCISE_LOGS=FALSE disables concise logging and prints the message in a long format.

Example 16-3 sqlnet.log File: Concise Format

This log file uses the default, concise format to display the message:

Fatal NI connect error 12514 [Time : 06-AUG-2024 06:33:17] [NS errors [12564:TNS-12564: TNS:connection refused] 0] [NT errors [0 0] 0] [Oracle errors [0 ] 0] [Connecting to: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales-sever)(PORT=6513))(CONNECT_DATA=(service_name=sales.example.com)(CID=(PROGRAM=oracle)(HOST=sales-server)(USER=scott))(CONNECTION_ID=1abcAB1+ABcabAB1aBCabl2A==)))] [PID: 1122110]

Example 16-4 sqlnet.log File: Long Format

This sample log file uses a longer, detailed format to display the message:

Fatal NI connect error 12514, connecting to:
 (DESCRIPTION=
  (ADDRESS=(PROTOCOL=TCP)(HOST=sales-server)(PORT=6513))
  (CONNECT_DATA=
    (service_name=sales.oracle,.com)
    (CID=(PROGRAM=ora cle)(HOST=sales-server)(USER=scott))
    (CONNECTION_ID=945VpOeGXR/gU0tBRmTdxw==)))
VERSION INFORMATION:
 TNS for Linux: Version 23.4.0.0.0 - Development
 Oracle Bequeath NT Protocol Adapter for Linux: Version 23.4.0.0.0 - Development
 TCP/IP NT Protocol Adapter for Linux: Version 23.4.0.0.0 - Development
 Version 23.4.0.0.0
 Time: 23-AUG-2024 08:48:02
 Tracing not turned on. Process Id = 2317599
 Tns error struct:
    ns main err code: 12564
    TNS-12564: TNS:connection refused
    ns secondary err code: 0
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0