To get an overview of the behavior of an R / 3 System, you can record various processes during the execution of individual objects. To analyze performance issues with database access, enable SQL tracing and buffer tracking of ST05 transactions.
SQL traces record SQL statements. There may be quite a difference between the SQL statements that are formed at the ABAP level and the SQL statements that are accepted by the database.
Buffer traces allow you to track SQL statements accessing buffered tables. An SQL statement accessing a buffered table can cause a buffer to reload, which is indicated in buffer tracing. A SQL statement accessing a buffer table can produce a completely different SQL statement if it cannot be filled by the R / 3 table buffer.
Additional tools include an enqueue trace, which logs enqueue requests or releases, shows the enqueue key and the objects involved; as well as an RFC trail, which records the RFC calls received or sent.
To access the SQL Performance Trace, use transaction ST05 or from the R / 3 home screen, select System ® Utilities ® SQL Trace.
Before enabling the SQL Performance Trace for a report or transaction, you must execute the report once to prevent the loading of buffers for R / 3 table buffers, R / 3 program buffers, and so on, from being included in subsequent traces.
Tracking can be enabled in production systems without the risk of creating errors or inconsistencies.
Tracking can be activated by any user and for any object. When enabling tracing, make sure you are not using multiple user sessions or running other processes such as background work or updating processes with the same user ID on this application server. This activity will make the SQL Performance Trace difficult to interpret.
For each application server, there is only one active trace file. Therefore, on a particular application server, only one user can enable tracing. The default trace file size is 800 KB. SAP recommends increasing the trace file size to 16 MB by setting the rstr / max_diskspace parameter to 16384000.
SQL trace overview:
The R / 3 database interface accepts SQL statements from the ABAP program and converts them into SQL statements that can be processed by the database.
For each database operation, the SQL trace measures the time taken from sending the request to the database server to receiving the request results on the application server via the R / 3 database interface (including the time spent on the network between the application server and the database server).
The data written to the tracking file includes database response times, timestamps, some data records transferred, database return code, SQL statement text, and additional administrative information for each database operation.