Page tree
Skip to end of metadata
Go to start of metadata

SQLDBC trace

This page explains when the SQLDBC trace is used and how it can be activated and deactivated.

What is SQLDBC?
Which applications already use SQLDBC?
What is the content of the SQLDBC trace?
For which user is the SQLDBC trace written?
Where are the trace files located?
How can the SQLDBC trace settings be changed on operating system level?
How can the SQLDBC trace settings be changed in the SAP system?
Further information


What is SQLDBC?

SQL Database Connectivity (SQLDBC) is a runtime library for the development of applications for SAP MaxDB. Using SQLDBC applications can connect to SAP MaxDB databases, execute SQL statements and process data.

back to top

Which applications already use SQLDBC?

SAP applications as of version 7.00 use SQLDBC.

back to top

What is the content of the SQLDBC trace?

The SQLDBC trace contains SQL statements sent by the application to the database, their parameters and results.

back to top

For which user is the SQLDBC trace written?

The SQLDBC trace is written for the operating system user who switches the trace on. However, you can change this behaviour by using sqldbc_cons option -u. This is necessary if you would like to activate the SQLDBC trace using sqldbc_cons for an SAP system running on Microsoft Windows. It is not possible to logon with user SAPservice<SID> - so you need to specify this user with option -u.

back to top

Where are the trace files located?

The trace files are written in directory <indep_data>\wrk (Microsoft Windows) respectively <user_home>/.sdb (Unix/Linux). They are named sqldbctrace-<pid>.prt.
Name and location of the files can be changed.
The actual name and the location of the trace files can be determined using command:
sqldbc_cons SHOW ALL

back to top

How can the SQLDBC trace settings be changed on operating system level?

To configure the SQLDBC trace settings - e.g. to start or stop the trace - you can use sqldbc_cons.
Syntax: sqldbc_cons [options] command

options: Possible options:
-h
help; shows all options and commands
-v
detailed information (verbose)
-p <pid>
the following command is executed only for the specified process ID
-f
force tool execution, even if a lock file of another instance is found
-u <user>
the following command is executed for the specified user

All options need to be specified separately - you cannot combine several options in one command.

command: Most important commands:
TRACE LONG ON|OFF
Enables/disables method argument and detail debug trace.
TRACE SQL ON|OFF
Enables/disables high level api trace.
TRACE TIMESTAMP ON|OFF
Enables/disables a timestamp prefix on each line that is traced.
TRACE SIZE <size>
Limits the size of the trace file to <size> bytes, at least 8192 bytes are required.
TRACE STOP ON ERROR <error>|OFF [COUNT <number>]
Stops tracing after the error <error> has happened <number> times (default is 1), or switches the trace stop feature off.
CONFIG TRACE FILENAME <filename>
Sets the name of the trace file name. A '%p' in the name is
replaced by the process id.
TRACE OFF
Switches all traces off.
SHOW ALL
Displays configuration and dynamic trace options.

To start the SQLDBC trace for all processes using SQLDBC, use the following command:
sqldbc_cons TRACE SQL ON

Example: How to trace all work processes in an ABAP environment catching the error -8006 and setting a trace file size limit of 4 MB for each trace file. 

  1. You need to start the trace as SAP user (same user that runs the work processes) or use the '-u' switch
    On Microsoft Windows use -u SAPService<SID> to switch on the trace on an application server.
  2. sqldbc_cons TRACE SIZE 5024000
    sqldbc_cons TRACE SQL ON
    sqldbc_cons TRACE STOP ON ERROR -8006

back to top

How can the SQLDBC trace settings be changed in the SAP system?

To activate the SQLDBC trace in transaction DB50/LC10 or DBACOCKPIT you need SAP Basis release 7.00.
In menu Tools -> SQLDBC trace you can change the trace settings and view the trace files.
To activate the trace for a specific work process, mark this process and choose the required trace (long, sql, ...).
To deactivate the trace for a specific work process, mark this process and choose Switch off.
It is neither possible to [de]activate the trace for all processes here nor to use option Stop on Error.
The trace size, location and name of the trace files can be specified in menu Goto.

In transaction SM49 sqldbc_cons can be executed. You can use the same options/commands as on operating system level.

back to top

Further information

See also: SAP note 822239, SAP MaxDB database trace

back to top

Relevant SAP Notes

822239 FAQ: SAP MaxDB Interfaces