OpenLink UDA Wiki Web

UdaWikiWeb.GeneratingClientsideODBCTracesAllDrivers

  • Topic
  • Discussion
  • UdaWikiWeb.GeneratingClientsideODBCTracesAllDrivers(Last) -- DAVWikiAdmin? , 2008-09-21 20:31:50 Edit WebDAV System Administrator 2008-09-21 19:31:50

    Generating Clientside ODBC Traces (All Drivers)

    From the Tracing Tab of the OpenLink ODBC Administrator, the level of Tracing can be configured.

    Figure: 1. OpenLink ODBC Administrator, Tracing tab OpenLink


    When to trace

    Use this option to turn tracing off or on. For a One-time only trace, the trace is made for the duration of the next connection. Click the Apply button to make your selection active. This option corresponds to the Trace and TraceAutoStop parameters in the preference files.

    Custom trace library

    Use the Select Library button to browse the machine for a library file that contains the code to intercept the trace output. This field should generally be left blank. When setting this parameter, you may use the Browse button to locate the library, or specify it manually. If specified manually, note that the location must be specified as it would be in a Terminal session. You may use ~/ as a shortcut to your user Home directory. This option corresponds to the TraceDLL parameter in the preference files.

    Log file path

    Specify the complete location of the file to which you wish to write the trace. You may use the Browse button to locate or create the file, or specify it manually. If specified manually, note that the location must be specified as it would be in a Terminal session. You may use ~/ as a shortcut to your user Home directory. This option corresponds to the TraceFile parameter in the preference files.

    Trace Parameters in Preference Files

    When the ODBC tracing parameters are changed, they are saved in the [ODBC] section of the ODBC.preference or odbc.ini file, whichever is active on your system.

    The following example shows the settings for a one-time trace to a sql.log on the active user's Desktop.

    [ODBC]
    Trace         = 1
    TraceAutoStop = 1
    TraceDLL      =
    TraceFile     = ~/Desktop/sql.log
    


    Once the tracing of a connection is complete, the Trace and TraceAutoStop parameters will both be set to 0.

    Trace

    This parameter corresponds to the When to trace option in the Tracing tab. Set to 1, tracing is on; set to 0, tracing is off.

    TraceAutoStop

    This parameter corresponds to the One-time only option in the tracing tab. Set to 1, tracing will automatically stop after the next connection is closed; set to 0, tracing must be manually stopped. When tracing is automatically stopped, the Driver Manager will set both Trace and TraceAutoStop parameters to 0.

    TraceDLL

    This parameter corresponds to the Custom trace library option in the tracing tab. When setting this parameter, note that the file must be fully specified as it would be in a Terminal session. You may use ~/ as a shortcut to your user Home directory.

    TraceFile

    This parameter corresponds to the Log file path option in the tracing tab. When setting this parameter, note that the file must be fully specified as it would be in a Terminal session. You may use ~/ as a shortcut to your user Home directory.

    As of iODBC 3.51.0, there are now more variables that may be included in the filename:

    $P

    This is the process-id (pid) of the application invoking the driver manager - allowing for per-process log-files

    $U

    This is the user-id under which the process is currently running

    $T

    This is the timestamp in YYYYMMDDHHmmSS format

    $H

    This is the home-directory of the user as whom the process is running

    These options are case-insensitive. Hence you can specify TraceFile=/tmp/iodbc-$U-$T-$P.log if you wish.