How to run ST12 to do a performance trace

http://www.sap-perf.ca/run-sap-st12/



SAP ST12 can trace SQL, ABAP, Remote Function Call andEnqueue operation of a program/job. Trace would show time consumption ondifferent code level from program subroutine/funtion module to individual ABAPcode or SQL statement so you know where time is spent by the program, thathelps you to find improvement opportunity or direction. This is a powerfulperformance analysis transaction I use very often when other performance tools likeSTAD etc is not enough for performance trouble-shooting.


Following are general steps of run ST12trace


  1. Run SAP transactionST12

  2. Specify what to be traced.

    User/Tasks: This is to trace activitiesexecuted under a single user. Such as online user or background user etc

    Workprocess: This is to trace a running SAPwork process. You use this when business is complaining job is long running andyou would like to find out what is going on with the job.

    Current mode: This is to trace activitiesunder yourself.

    Schedule: this is to schedule system totrace a future activities when none is available to trace online.

    Comment” field – you can enter freetext related to your case like “EDI Big order creation” or your TEST-case ID etc. This helps you toremember what the trace is for.

    Server” field If your system has several servers, here youneed to put SAP instance name where the user is executing the transaction ifthe user is on the different server which you are doing the trace. You cansimply choose “ALL servers” option in the pop-up window.

    Username” In “User/Tasks” mode, specify the SAP useraccount for traced.

    Tasktype” In “User/Tasks” mode, specify type of SAP workprocess executed by the selected users

    No. trace activations” In “User/Tasks” mode,specify # of traces one trace is normally one work process. This option in lower version is notavailable.

    Transaction” In current mode, specify transaction code ofthe transaction to be traced.

  3. Choose trace options

    You can specify technical trace scope forthe job/program being traced in the following section of ST12 screen

    You can select do “ABAP trace” or/and“Performance traces”. To make it simple, I suggest that you select both.However if you are only concerned about non-database time, you can select “ABAPtrace” option only etc.

  4. Start trace

    After you specify all those info in theprevious section, and you can start your trace. There is a difference on how tostart trace. After all above input, you need to click the

    User/Tasks” mode, when user is readyto execute the transaction, you can click the button to tell system to trace activitiesunder that user. System would record all activities under the specified userwhile trace is on. After you click the trace button, following screen shows up.Please pay attention that since I did not choose “RFC” optionso RFC trace is not startedin the following screen.

    Workprocess” mode, This is to traceone of active user jobs/programs. You click the button to start the process. but actualtrace is not happening yet. Since SAP does not know which process to be traced.SAP would show SM50 process monitoring screen like below, on this screen, youcan select work process based on user ID or program by placing cursor on thedesired line, then click “activate” button to start trace as showed infollowing screen.

  5. End and collect trace

    After expected tracing duration ortransaction being traced is completed, you need to end the tracing and collectthe tracing result.

    User/Tasks” mode  – as showed in the corresponding screen instep 4, you click buttonto end and collect your traces.When you do that, following screen might show up to allow you to specify whattrace you would like to generated

    You can select all entries or specific entrybased on your need, you can enter filter as well. After you made yourselection, you can click “enter” button. you are done. However the system mighttake some time to generate trace, I waited about 1-2 minute before I can reviewthe trace data. Click “Cancellation” button if you would like to discard yourtrace data.

    Workprocess” mode  as showed in the corresponding screen in step 4, you click button in the same window you activate awork process trace to end and collect your trace. That is it.

  6.  Reviewand navigate the trace

  7. Watchout


  1. One instance of SAP or one server can have onlyone people doing trace at one time.

  2. Zombie trace can exist in the system depend onyour case. Zombie trace can impact reliabilities of your trace. So make surethat there is no “zombie trace” in the system before you start the trace. Youcan use program SAPRSATRA_MONITOR to kill zombie trace, refer to SAP OSS note1156324 for more detail.

  3. I prefer to do a short trace under half hournormally.. If a program is running long, I would normally do several shorttraces. Or you can schedule your testing case to make it sure that it is notrunning too long. Any testing case runs over 1.5 hr is too long.

    If you wonder how to interpret the trace data, I would try to cover thisin subsequent posting.

     

     

     

     




你可能感兴趣的:(SAP,BW)