Show TOC Start of Content Area

Procedure documentation Evaluating the SQL Trace  Locate the document in its SAP Library structure

Use

You can check the SQL Trace using:

      SQL Trace application

      Log Viewer

Procedure

Using SQL Trace Application

...

       1.      Launch the SQL Trace.

       2.      Choose Go To Trace Evaluation.

       3.      Select the trace you want to view.

Note

The trace files are ordered by time of creation, the most recent file being listed first. If the file is still active, it is highlighted.

       4.      Choose Evaluate Selected Trace.

       5.      Optionally, you can specify filtering criteria to reduce the number of displayed trace records.

       6.      Choose Evaluate.

The application provides a list of trace records according to your filtering criteria. Each traced method is displayed as a link, which opens a page with detailed information on the following parameters:

Attribute

Meaning

Statement

The SQL statement (or JDBC method call) that is executed

Time

The exact start time of the JDBC method call in millisecond precision

Location

The name of the JDBC method call that was traced

Duration

The duration of the method call in microseconds (10-6s)

J2EE user

The J2EE Engine user initiating the JDBC method call

J2EE Session

The J2EE Engine session identifier

J2EE Application

The name of the J2EE Engine application

DSR Transaction Id

The distributed statistical records identifier

Database Id

A string identifying the database connection used. Currently a combination of data source name (as defined in JDBC Connector Service) and database user, delimited by an ampersand (“&”).

Thread

The thread executing the JDBC method

Prepared Statement Id

Unique identifier assigned to every PreparedStatement object

ResultSetId

An identifier for the ResultSet object. It is needed to relate ResultSets to the statements they originate from.

Result

The result returned by the JDBC method call (the error code in case there was an exception)

No.

Subsequent fetches of the same ResultSet with the same return value (true or false) are summarized.

Input Parameter

The parameters given to the JDBC method

Bind Parameters

All bind parameters

Table names

All involved tables (available only in case OpenSQL was used)

DB Error Code

DB Error SQL state

In case there was an SQLException: the error code and the error state

No. of bind per addBatch call

To see how many bind variables were used with each addBatch() call; this number is written to the trace.

Program name

Line Number

SQLJ program generation time

In case the traced JDBC call was due to a SQLJ program, additional information is available, such as the name of the Java source file (Program name), the line in the source where the initiating statement occurs (Line Number), and the generation time stamp of the SQLJ program.

Backtrace information

Stack trace information (only if enabled when the trace is switched on)

Unique log record number

SQLTrace uses the general SAP Logging and Tracing mechanism. The SAP Logging API trace record number thus appears in the trace.

Number of next calls

Minimum duration of a single next call [ms]

Maximum duration of a single next call [ms]

Average next call duration [ms]

Sum duration of all next calls [ms]

Subsequent next() calls to the same result set and with the same return value are summed up in the SQLTrace Web application. The number of calls, the maximum and minimum duration of a single call, the average duration, and the sum of all durations are given.

NativeSQL statement Id

NativeSQL pooled statement Id

VendorSQL statement Id

NativeSQL Connection Id

NativeSQL Pooled Connection Id

NativeSQL Logical Pooled Connection Id

VendorSQL Connection Id

Identifiers for the various statement and connection objects that may be involved when the traced JDBC method call is executed. “Native” stands for the Native SQL layer, “Vendor” for the Vendor SQL layer.

Note

All parameters are displayed if you use the Extended list option on the filter page.

Using Log Viewer

...

       1.      Activate the SQL trace from the runtime screen of Log Configurator Service in the Visual Administrator.

       2.      Launch the Log Viewer.

       3.      The SQL trace is available as an XML file under the relevant server process. You can double-click to open each record for detailed information. You can use the search capabilities to browse the SQL trace.

Viewing SQL Trace Records Created by Single Activity Trace (SAT)

If SQL Trace records created by Single Activity Trace are available, the list of traces will contain SAT_SQLTrace entries – one trace for each server where records exist. SQL Trace SAT records of all SAT sessions are collected within these logs. Use Session Id or DSR Transaction Id filters to display the relevant records only.

End of Content Area