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:

<installation_path>/bin/odbc_cons [<command>] [<option>]

Note Note

You can display the installation path using the dbm_getpath DBM command:

dbmcli dbm_getpath InstallationPath

For more information, see Database Manager CLI, dbm_getpath.

End of the note.
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>.

-u <domain>\<os_user>

For Microsoft Windows only

To use this option, you need administration privileges on your computer.

With this option, you write the trace for the operating system user <os_user> of the <domain>. If you do not specify this option, the trace is written for the operating system user who is logged on.

You need this option, for example, to activate the trace in an SAP system where you cannot logon with the user SAPservice<SID>.

-v

Displays detailed information (verbose)

Result

The SAP MaxDB ODBC trace writes its results in chronological order into the odbctrace-<pid>.prt trace file in the <data_path>\wrk (Microsoft Windows) or <user_home>\.sdb\<computer_name> (Unix/Linux) directory.

If profiling has been activated, the ODBC trace writes aggregated statistical information to the odbcprofile-<pid>.prt file.

<pid> = process ID

The trace file is overwritten cyclically.

More Information

Glossary, Directory