Linux and Unix Client-side ODBC Traces and Driver Debug Logs Creation

Linux and Unix OS’es Client-side ODBC Traces and Driver Debug Logs Creation

ODBC Tracing on Linux and Unix OS’es

To create ODBC Traces for the iODBC Driver Manager and OpenLink ODBC Driver on Unix-like OS, edit the active odbc.ini file, typically specified by the $ODBCINI environment variable and found in the /bin/ subdirectory of your OpenLink installation, and add an [ODBC] section like the following –

[ODBC]
Trace         = 1
TraceFile     = <iodbc-trace-filename>
TraceAutoStop = 0
;TraceDLL      =

– where iodbc-filename is the full path to the file where the iODBC Driver Manager trace should be written. Tracing can be disabled by commenting out these parameters with a semi-colon (;), or setting Trace = 0.

Driver Debug logging on Linux and Unix OS’es

To create OpenLink Driver Debug logs for, edit the active odbc.ini file, typically specified by the $ODBCINI environment variable and found in the /bin/ subdirectory of your OpenLink installation, and add an [ODBC] section like the following –

[ODBC]
Debug         = 1
DebugFile     = <driver-log-filename>

– where iodbc-filename is the full path to the file where the Driver Debug log should be written. Tracing can be disabled by commenting out these parameters with a semi-colon (;), or (with the most recent driver builds) by setting Debug = 0.

  • Debug — This parameter corresponds to the checkbox in the DSN configuration. Set to 1 , logging is on; set to 0 , logging is off.

  • DebugFile — This parameter corresponds to the text-entry box in the DSN configuration. When setting this parameter, note that the file must be fully specified as it would be in a Terminal session, but without shell-escaping (i.e., spaces and other shell-reserved characters do not need to be escaped; it is as if the path were entered within double-quotes in a shell session). You may use ~/ as a shortcut to your user Home directory.

  • Note: There is no Auto-Stop for Driver Debug Logging – you must manually stop this logging.

Extra Driver Debug Logging for Single-Tier “Lite” Edition ODBC-to-JDBC Bridge or Multi-Tier “Enterprise” Edition JDBC Bridge Agent on Unix-like OS

Sometimes, troubleshooting requires looking into the Java calls made by our “Lite” Edition ODBC Driver for JDBC Data Sources, or our “Enterprise” Edition Bridge Agent for JDBC Data Sources, and the responses from the JDBC Driver. These calls are logged within the Driver or Agent Debug Log by setting an environment variable –

LOG_JAVA_CALLS = YES

When Java-level troubleshooting is complete, you can set LOG_JAVA_CALLS = NO, or just leave it as-is if you disable Driver and Agent Debug Logging. (The LOG_JAVA_CALLS setting has no effect when Driver and Agent Debug Logging are inactive.)

Filename tokens, valid for all platforms

In iODBC 3.51.0 and later, and UDA Release 5.2 and later, there are some tokens that may be included in the target file names to make them more easily identified when prolonged tracing, or tracing of multiple connections and/or applications, is required:

Token Expands to
$T a timestamp in YYYYMMDD-hhmmss format
$H the home-directory of the user as whom the process is running
$P the process-id (pid) of the application which invokes the driver manager, allowing for per-process log-files
$U the user-id under which the process is currently running

These options are case-insensitive, so, for instance, $p has the same effect as $P.

Hence you can specify, for example:

[ODBC]
Trace         = 1
TraceFile     = iodbc.$U.$p.$T.log
TraceAutoStop = 0
;TraceDLL      =
Debug         = 1
DebugFile     = openlink.$u.$P.$t.log

This would produce separate iODBC trace files and OpenLink driver debug logs with names based on the userid, timestamp, and processid of each connection made.

Note that these tokens have no effect on MDAC (Windows driver manager) trace files, but they do have effect on driver debug logs produced on Windows.

Related