SAP uses SQL trace (st05)

Source: Internet
Author: User

Sap r/3 provides standard abap SQL tracking tools. Use T-code: st05 To Go To The tracking setting screen:

 

In the trace modes area, select the scope of the trace to be performed on the sap r/3 server: SQL trace: traces the SQL statements that have been filtered by the AP server. Enqueue trace: trace the queue on the enqueue server. RFC trace: tracks the RFC behavior on the AP server. Buffer trace: tracks the behavior of the buffer on the AP server. To track SQL statements, select SQL trace. Then, in the trace requests area, click trace on with filter to filter the output. Here, we only track all SQL operations performed by the SBA account on mb03. You can also enter Program Name or even the Process Code on the AP server. You can also select the names of tables that contain/exclude data in the table name area. Click Check to start tracing. To view the tracing result, stop tracing (trace off) and Click Display trace: you need to filter the results again (because sap r/3 only has one or two log files, the system will not automatically break down the log information of the corresponding program ). Select SQL trace only for trace modes. The SQL trace period system is automatically set and does not need to be changed. User name can be set by yourself. The null value indicates any account (because only one account is filtered when tracing is started, no further filtering is required here ). Objectname is retained by the system (this can exclude the log information generated by the tracing log itself ). Duration: the time consumed to perform this operation, measured in microseconds. 1 microsecond = 1/1000000 seconds. Objectname: indicates the object of the operation. For SQL trace, it is generally table name. Op.: indicates the operation type. The corresponding open entries have great reference value for SQL Performance. Statement: indicates the SQL statement under the operation (not complete, the same as the SQL statement in the ABAP statement). Click the SQL statement to display all information about the statement, including conditional variables (replace with @ pxxx ). You can even press F5 to directly jump to the ABAP statement to facilitate modification and debugging. Note: 1. After Entering st05 tracking, you can close this interface and continue to perform other operations without affecting the execution of st05. 2. Because st05 does not end with the close of the interface, you must manually stop tracing after st05 is used. Otherwise, tracing continues until the sap db log is full. This will cause system faults. 3. the SQL statement displayed by tracing is an interpreted version of abap SQL, which may be automatically decomposed or optimized. You can refer to the ABAP code for comparison.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.