Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

st05

Former Member
0 Likes
642

hi,

could u plz explain how to use this st05 t-code.

how to find out which statement is taking more time

in what bases we can find that statements

4 REPLIES 4
Read only

Former Member
0 Likes
611

Hi,

SQL Trace transaction ST05

The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.

The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on the SPFLI table in our test program is mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.

The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.

To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.

Regards

Sudheer

Read only

Former Member
0 Likes
611

Hi

SQL Trace

SQL trace(ST05) provides the developer with the ability to analyse database select statements. Simply execute ST05

to turn on SQL trace, then execute the statement/program you want to analyse. Now turn off SQL trace using ST05

and click on list trace to view the details.

You can also perform traces on other items such as authorisation objects.

Authorisation trace analysis 1. Open two sessions

2. Execute transaction ST01 in one of the sessions

3. Select the authorisation checkbox, note the other traces

you can perform (SQL, RFC, Table Buffer etc)

4. Click the 'Trace On' button

5. Within your other session execte the transaction/report

you want to trace or get the user in question to do it

6. Return to the session where you turned the trace on and

click on 'Trace Off' otherwise it will continue to record

all athorisation checks

7. Click on the 'Analysis' button

8. Enter appropriate data into selection screen such as

Username, type of trace records (i.e. Authorization check)

9. Click on the Execute button.

10. Report displaying trace results will now be displayed

http://www.sapdevelopment.co.uk/perform/perform_sqltrace.htm

Some useful transaction related to this are ..

ST01 SAP system trace

ST02 Buffer statistics.

ST03 Workload analysis.

ST04 Database performance analysis.

ST05 SQL trace .

ST06 Operating system monitor ...

From the recorded SQL trace you can deduce:

· Which SQL statements your application carries out

· Which values the system uses for specific database accesses and changes

· How the system translates ABAP OPEN SQL commands (such as

SELECT) into standard SQL commands

· Where your application positions COMMIT statements

· Where your application makes repeated database accesses

· What database accesses or changes occur in the update section of your

application

Look at the below links, you will get the idea

http://help.sap.com/saphelp_erp2005/helpdata/en/d1/801f89454211d189710000e8322d00/content.htm

http://www.sapbrain.com/TOOLS/SQLTRACE/SQL_TRACE.html

Check the following links:

http://www.sapbrainsonline.com/TOOLS/RUNTIMEanalysis/SAP_runtime_analysis.html

http://www.sapbrainsonline.com/TOOLS/SQLTRACE/SQL_TRACE.html

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
611

Use SE30 tcode for run time analysis of your program and you can alsouse st05.

In st05 click on active trace with filter then enter ur programme name.

Read only

Former Member
0 Likes
611

Hi,

Use

The Performance Trace allows you to record database access, locking activities, and remote calls of reports and transactions in a trace file and to display the performance log as a list. It also provides extensive support for analyzing individual trace records.

SQL Trace: This allows you to monitor the database access of reports and transactions.

Enqueue Trace: This allows you to monitor the locking system.

RFC Trace: This provides information about Remote Function Calls between instances.

While the trace is switched on, the SQL Trace function records all database activity by a particular user or group of users. The R/3 System takes OPEN SQL statements and converts them in to embedded SQL statements that it passes to the database. It is the embedded SQL statements, their parameters, return codes, and the number of entries retrieved, inserted, or deleted that are recorded in the SQL Trace file. The log file also contains the runtime of the statement and the place in the application program from which it was called.

The SQL trace tells you:

The SQL statements executed by your program.

The values that the system uses for particular database access and changes.

How the system converts ABAP Open SQL statements (such as SELECT) into Standard SQL statements.

Where your application executes COMMITs.

Where your application repeats the same database access.

The database accesses and changes that occur in the update part of your application.

Refer

http://help.sap.com/saphelp_erp2005vp/helpdata/en/43/cb632772cd0cd4e10000000a1553f7/frameset.htm

<b>Reward points</b>

Regarsd