Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SQLDBC Tracing and Logging

Trace Features

SQLDBC can generate trace output to support defect analysis and debugging. The trace is usually written to a file, and the size of that file can be limited (and the trace starts writing at the beginning of the file when the size is exceeded). Also, the trace is multi-thread safe, and thread changes are detected and logged.
There are several kinds of tracing some for normal users and some for experts how know the source code or the internal architecture of SQLDBC.

All trace kinds can be combined together.

The following kinds of trace can be generated:

SQL Trace
The SQL trace shows all SQL commands sends from the application to the database including the data of columns and parameters. It also traces the metadata of the query and the parameter binding of the application. The SQL trace is the normal trace for users to analyze what the application does during runtime.
Call Trace (short trace)
The call trace is a hierarchical trace that shows the names of the internal methods as they get called. Only the names are shown, not the arguments of the calls. The function names are indented to show the call nesting level.
Debug Trace (long trace)
All explicit trace statements in the SQLDBC runtime fall into this category. Thus you will see here all additional diagnostic output, to diagnose problems in using the interface runtime.
Profile Trace
In this trace, the entering and exiting of a profiling sections (which are usually, but are not necessarily required to be functions) is traced with a timestamp of high resolution. That output can be used to gather profiling data about the runtime behavior.
Packet Trace
In this trace, the content of the packets which are sent to and received from the database server is dumped. To read this trace you should be an expert of the internal order interface of MaxDB.

Controlling the Trace

The trace can be enabled by using the sqldbc_cons utility.
Trace Control using sqldb_cons
The tool sqldbc_cons is called as follows:
          
sqldbc_cons [options] [command]
where [options] are:

Option Description
-h Help. Shows usage information, and ignore all commands.
-p <pid> Execute the command only for the specified process id <pid>.
-v Verbose operation.
-f Force tool execution, even if a lock file of another instance is found.
This feature should only used in critical situation like endless loops or hanging processes.

and [commands] are:

Command Description
[CONFIG] TRACE SQL | ON|OFF Switches the SQL commando trace on or off or sets the call trace nesting level
[CONFIG] TRACE SHORT ON|OFF Switches the short call trace (only function calls) on or off
[CONFIG] TRACE LONG ON|OFF Switches the long call trace (includes function and arguments) on or off
[CONFIG] TRACE PROFILE ON|OFF Switches the profile trace on or off
[CONFIG] TRACE PACKET ON|OFF|<limit> Switches the packet trace (like vtrace) on or off or sets the packet trace size.
[CONFIG] TRACE TIMESTAMP ON|OFF Switches the time stamp prefix on or off
CONFIG TRACEFILENAME <filename> Set the trace file name to where the commands are logged.
A 'p' within the file name will be expanded to the process
id of the application. File names started with a './' are placed
relative to the run directory of the traced application
TRACE OFF Switches all trace kinds off
SHOW CONFIG Shows the trace configuration.
SHOW TRACESETTINGS Shows the current trace settings done by this tool.
SHOW ALL Shows the trace configuration and settings.

Note: