Thursday, 6 June 2013

How to apply SQL Trace for expensive SQL statements ( ST05 )




In ST05, click the "Activate Trace with Filter" button:



Enter your user id and the name of the report/transaction.  This is so that we can try to limit the records in the trace.  If you want to trace another user, simply enter their user id:




Click Execute to start the trace:


 

Now in a separate session (preferably) run the transaction/program with the performance problem.
Once you have experienced the problem, you can go back into ST05 and click "Disable Trace"  (by default it will remember the trace details and disable the running trace, you won't need to re-enter all the details):



Still within ST05, click "Display Trace":


 

The system remembers the last trace recorded and should automatically populate the details, but you can always enter them for date/time, user id etc:



The SQL trace records are displayed.
The poor performing SQL has it's time (duration) in microseconds (millionths of a second) highlighted in red if it exceeds 10000 microseconds, 10 milliseconds or 0.01 seconds:

(1 second = 1000 milliseconds = 1000000 microseconds)


You can settle issues related to expensive SQL statements with the help of ABAP’rs

3 comments:

  1. Great tip ! I spent $3000.- in Germany to learn These things, but the course was like "Hello world !!" !


    Thanks from Germany

    Kumar Mitra

    ReplyDelete
  2. Thanks for the great information ,was looking for this information from long.Great blog SAP Basis Training in Chennai

    ReplyDelete