Procedure documentationTroubleshooting Using the SAP MaxDB ODBC Trace Locate this document in the navigation structure

 

The SAP MaxDB ODBC trace logs SQL statements, communication packages and method calls that the database receives and sends via the SAP MaxDB ODBC interface. To configure and control the SAP MaxDB ODBC Trace, you use the odbc_cons command line program.

Caution Caution

Traces compromise performance. Use traces only for troubleshooting and problem analysis.

End of the caution.

odbc_cons is a component of the SAP MaxDB software..

Procedure

Enter the following command on the command line:

odbc_cons [<command>] [<option>]

SQLDBC Trace and ODBC Trace: Commands

<command>

Description

CONFIG TRACE FILENAME <trace_file_name>

Specifies the name <trace_file_name> of the trace file

If you enter %p in the name, it is replaced by the process ID of the application for which the trace is written.

PROFILE FILENAME <profile_file_name>

Specifies the name <profile_file_name> of the profile file

PROFILE [COLLECT ON | COLLECT OFF | RESET]

Activates or deactivates profiling (collecting statistical information) or resets all statistics counters

SHOW ALL

Displays the configuration of the traces and current information about the traces

SHOW CONFIG

Displays the configuration of the traces

SHOW PROFILE

Displays the collected statistical information in aggregated form

SHOW TRACESETTINGS

Displays current information about the traces

TRACE API ON | OFF

Applies only to the ODBC interface:

Activates or deactivates the API trace

The API trace is similar to the Microsoft Driver Manager trace, but logs more actions.

TRACE LONG ON | OFF

Activates/deactivates the detailed LONG trace

The LONG trace logs method calls with their call parameters.

TRACE OFF

Deactivates all SQLDBC traces

TRACE PACKET ON | OFF | <size>

Activates or deactivates the PACKET trace

The PACKET trace logs communication packages.

You use the <size> option to configure the size of the logged communication packages in bytes (default value: 1000 bytes).

TRACE SHORT ON | OFF

Activates or deactivates the SHORT trace

The SHORT trace logs method calls.

TRACE SIZE <size>

Defines the size <size> of the trace file (in bytes)

The system requires at least 8192 bytes for the trace file.

TRACE SQL ON | OFF

Activates or deactivates the SQL trace

The SQL trace logs SQL statements (the most simple trace is sufficient for most analyses).

TRACE STOP ON ERROR <error_number> | OFF [COUNT <number>]

Deactivates the trace after the error with error number <error_number> has occurred the number of times configured by the <number> option

TRACE TIMESTAMP ON | OFF

Activates or deactivates the time stamp for each logged action

SQLDBC Trace and ODBC Trace: Options

<option>

Description

Note that you can enter only one trace option at a time. They cannot be combined.

-f

Forces the execution of the command

-h

Displays help

-p <pid>

Executes the command only for the process with process ID <pid>.

-v

Displays detailed information (verbose)

Result

The SAP MaxDB ODBC trace writes results in chronological order into the odbctrace-<pid>.prt trace file in the <independent_data_path>\wrk directory, with <pid> as the process ID. The trace file is overwritten cyclically.

If profiling has been switched on, the ODBC trace writes aggregated statistical information in into the odbcprofile-<pid>.prt profile file in the <independent_data_path>\wrk directory, with <pid> as the process ID.

More Information

Glossary, Directory