Single Transaction Analysis (ST12) – getting started

本文详细介绍了如何使用ST12工具在当前模式下追踪程序或事务执行过程,包括定义测量范围、设置选项以及评估跟踪结果等步骤。重点突出如何同时进行ABAP和SQL跟踪,以及如何配置跟踪参数以获取更准确的性能数据。


Using ST12 with Current Mode:

In the "Current Mode" Scenario you are going to trace the execution of a program or transaction. Before you trace, it is recommended to execute your program or transaction several times to fill the buffer and caches, as filling the buffers and caches is something that can't be optimized with ABAP or SQL tuning. Before you can start the trace you have to define the measurement scope. In ST12 this is done "on the fly", no measurement variants are saved. After starting ST12 and clicking on "Current Mode" (see nr. 1 in figure 1) you will see a screen like figure 2.

Figure 2: Current Mode

Figure 2: Current Mode

You can enter a comment to give a meaningful description for the trace. Enter your program or transaction in the corresponding field and set the appropriate radio button, see nr. 2 in figure 2. In the lower part of the screen you define the measurement scope. The left part is for the ABAP trace (SE30) and the right part for the Performance Trace (ST05), see nr. 3 in figure 2.

Note: Since ST12 uses the functionality of both transactions (SE30 and ST05) the options are similar or the same. ST12 hides some details to make the traces more easy to use.

For the ABAP trace the most important decision is if you want to trace "with internal tables". It is recommended to switch this setting on. Other options like Particular units, Filters or "Further opt." are only needed in exceptional cases and beyond the scope of this "getting started" blog.

If you click on "Further opt." (see nr. 4 in figure 2) the following screen pops up:

Figure 3: further Options

Figure 3: further Options

Increase the "Max. size of file" to 20 MB (see nr. 5 in figure 3) and the "Max. trace runtime" to 3600 seconds (see nr. 6 in figure 3) if you have long running programs. The aggregation is set to "by calling position" by default which is the recommended option. All other options only have to be changed in exceptional cases. For example, if you get strange or negative times in the ABAP traces, you should use the low resolution clock.

For the performance trace you can decide whether you want to take the SQL-, Enqueue- and / or RFC trace. In the above scenario only the SQL Trace is switched on. The SQL Trace is the most important performance trace.

This is all you have to do. You can start your program or transaction now by clicking "Execute / start trace" (see nr. 7 in figure 2). After your program or transaction has finished and you have returned to ST12 you will see your trace in the lower part of the screen.

The status column (see nr. 8 in figure 4) shows you whether your trace is ready for evaluation. There might be a red and white circle which means the ABAP trace is still being imported into the database. The yellow flash indicates a measurement error (e.g. time limit exceeded, file size to small, ...). The green tick shows that the ABAP trace has been successfully imported to the database.

Note that ST12 imports the ABAP trace files into the database, in order to make them available in the whole system and keeps them for later analysis. In SE30 the trace files are application server specific and deleted after a certain number of days. The performance trace is not imported by ST12 and therefore is only available until the trace files are overwritten.

To evaluate the trace you can click on ABAP trace (see left arrow in figure 4) in order to display the imported ABAP trace. The list on figure 3 has been sorted descending by the Net column. This means the total times for each calling position is displayed in descending order.

In order to evaluate the performance traces just click the button Performance traces, see right arrow in figure 4. This will display the basic list of the performance trace. For the SQL trace it is recommended to start with the statement summary. Therefore in the basic list click menu Trace List -> Summary by SQL Statements. In figure 3 on the right bottom you can see an example of the SQL Trace Summary.

Note: Please refer to The SQL Trace (ST05) - Quick and Easy Blog (The SQL Trace (ST05) – Quick and Easy) for further details on ST05 analysis.

 Figure 4: Trace Analysis

Figure 4: Trace Analysis

Summary:

In order to take an ABAP and SQL Trace at the same time for a program you are going to execute the following steps:

  • 1.) Call ST12, click on CURRENT MODE (Nr. 1 in figure 1)
  • 2.) Fill in the program or transaction and a meaningful comment (Nr. 2 in figure 2)
  • 3.) Define the measurement variant:
  • a. switch on ABAP and SQL Trace and use internal tables (Nr. 3 in figure 3)
  • b. increase the file size and the duration (Nr. 4 in figure 2 and Nr. 5 and 6 in figure 3)
  • 4.) Execute your program (Nr. 7 in figure 2)
  • 5.) Evaluate the trace (figure 5)

This blog demonstrated how ST12 combines the ABAP and Performance trace and how easy it is to trace a program and measure both ABAP and SQL execution. Future blogs will show advanced topics for trace taking and analysis.

More information on ST12 can be found here:

ST12 WIKI:

http://wiki.sdn.sap.com/wiki/display/ABAP/Single+Transaction+Analysis

Blogs:

ST12 - The workprocess trace

Books:

http://www.sap-press.com/product.cfm?account=&product=H3060

http://www.sap-press.de/1821

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值