ST05: different ways to analyze SQL trace, different authority checks

Hi there,
Here is the issue I faced.
I need to analyze SQL statement for example. I can do it two ways:
1) run ST05> Enter SQL statement> Explain
or via trace itself:
2) run ST05> Display trace> Explain
The thing is that when doing it the second way it requires additional authorizations that are not required when going the first route.
Additional authorizations which way 2) requires are:
S_TCODE SM69, SM49
S_DBCON with ACTVT=36
I was able to remove check for S_TCODE using transaction SE97, so that S_TCODE is not checked for SM69 and SM49 now for ST05 transaction. As for the S_DBCON - as SAP says:
"36  Extended Maintenance
Permission to execute all kinds of SQL statements on the database. This authorization is
extremely powerful and should not be granted on a routine basis.
Extended Maintenance, which should be restricted from use. This authorization allows a user
to execute any SQL statements on the database it is granted for. Improper use of this
feature can do significant damage."
So this object with ACTVT=36 cannot be given to a basic developer or basis, only to superuser, right?
My question is,
Is there way to go the second way (as it is more convinient to analyze SQL statement when viewing trace) and not to give the authorization above?
P.S.
ECC6.0, MSSQL, SAP_BASIS 700, SP 18
Thanks,
Igor
Edited by: Igor Kustov on Sep 21, 2010 8:10 AM

Julius, thanks.
Well, yes, when in Trace List there is a button "Editor for Changing SQL Statement" which brings you to the Enter SQL statement screen (first option in my original post) with the statement you clicked on and ability to change it. You click "Explain" and analysis appears with no additional checks there.
It is strange why S_DBCON with ACTVT=36 is required to just push "Explain" button within Trace list. From my experience the ability to execute any SQL code (natively to RDMS) from either ST05 or ST04 was revoked with basis SP12 when DBACOCKPIT was introduced.
OK, it looks like there is a workaround to analyze a statement from trace with two clicks and not just one. May be I should open a message with SAP then.
But still, since you cannot execute SQLs anymore what this S_DBCON with Extended maintenance acitivity is intended for?
Thanks,
Igor

Similar Messages

  • How to set SQL trace in OCI session ?

    Hello,
    In a SQL*Plus session, I can use the SQL statement "alter session set sql_trace=true;" to set SQL trace in that session only. I assume I could execute the same SQL statement from C code in an OCI client and achieve the same goal.
    However, if I cannot change the code of this OCI client, is there a way to set SQL trace for that single session alone, without changing the C code? Say, through an environment variable, configuration file, etc.?
    Thanks.

    I am not aware of a way to selectively enable the server-side tracing without modifying the client code.
    There is client tracing available by setting the environment variable EVENT_10842 as follows:
    "server=<>;user=<>;stmt=<>;level=<>;interval=<>"
    e.g.
    setenv EVENT_10842 "server=inst1,inst2;user=scott,system;stmt=all;level=15"
    Where:
    "server" is a comma separated list or "all"
    "user" is a comma separated list or "all"
    "stmt" can be INSERT,UPDATE,DELETE,SELECT or "all"
    The following levels are supported:
    1 - Trace all server attach and server detach calls for servers listed in "server" attribute of the environment variable.
    2 - Trace all session begin, logon, session end, logoff calls for the users listed in "user" attribute of the environment variable.
    3 - Trace all prepare, execute, fetch calls for the specified statement types listed in "stmt" attribute of environment variable.
    4 - Trace all Bind, Define, Describe calls.
    5 - Trace all OCI LOB calls
    7 - Get statistical info on all connection pooling /connection related calls
    8 - Get statistical info on all session info
    9 - Get statistical info on all handle info
    10 - Get statistical info on time taken in execute and fetch calls
    11 - Get statistical info on transaction related calls
    15 - Trace all calls with statistical info.

  • Sql trace file

    hi,
    when i am analyzing sql trace file it is showing like 1 sql statement in sql trace file, 1 user sql statements are traced
    enabling sql_trace=true as a sys user only.
    is there any problem it is not gathering all the users sql statements.

    user8647245 wrote:
    yes, your right,
    Sort options: default
    1 session in tracefile.
    1 user sql statements in trace file
    0 internal sql statements in trace file
    1 sql statements in trace file
    like this.
    user1 and scott users are connected to database.SQL session can be traced at a time for only one user i.e. one session. It you enable sql trace, During this time if you run any SQL or programs, It will gather all trace of your queries.
    Your output depends on Your input i.e. which transactions/queries you have executed.
    For ex:
    execute dbms_system.set_sql_trace_in_session(<sid>, <serial>, true);

  • Difference between Runtime Anlaysis & SQL Tracer

    What is the difference between Runtime Analyasis * SQL Tracer, and what is special use of individual Tools

    Runtime analysis and  SQL trace ar both used for an  Performance tunning  of an   ABAP programs (any) ...
    because when you run huge reports  it will take some  time  ..... and   it will cause other  customer users those  whoare   making transcation to the  same tables .... so  for that      the proragms are tunned  ....by   using some   process  which was    standardly given by sap  ...
    ST05  -> SQL Trace .
    SE30  ->  RUNTIME ANALYSIS
    in  runtime analysis  you   see the   time taken by the system  and the data   utilised ,  database tables  accesses and its time...etc .
    in sql trace you can swithc  off/on the trace of any   running programs   so that you can se the specific  of any ABAP porgrams   ... which has taken time  for which table ... which SQL query....etc ...
    so  basicaly  in the SQL trace it was    checking of the  sequesnce of the table  query  for  SELECT,
         UPDATE
        MODIFY
       INSERT
      DELETE
      REFRESH ....etc ....
    Girish

  • Trace of Authorization checks on recursive called functions

    Hi all,
    I need to search all authority checks that one standard report make on recursive calls to reports/functions. Does somebody knows how I can do it?
    Thanks a lot.

    Hello,
    Start transaction st01 and enable the trace for "authority check".
    Start your programm and when it is done disable the trace.
    Then choose analysis and all the checks will be displayed.
    Hope this help,
    Walter
    Please reward all participants

  • Diff b/w Run time Analyizer(se30),Sql Trace (st05) and Performance Analyzie

    Can any one tell me the Diff b/w Run time Analyizer(se30),Sql Trace (st05) and Performance Analyzie(al21) ?

    Hi
    these all are doing t he same thing that is checking the program for better performance
    Tools for Performance Analysis
    Run time analysis transaction SE30
    SQL Trace transaction ST05
    Extended Program Check (SLIN)
    Code Inspector ( SCI)
    Run time analysis transaction SE30 :This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing. 
    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 a particular database table of the ABAP program would be 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.
    Extended Program Check
    This can be called in through transaction SE38 or through transaction SLIN. This indicates possible problems that may cause performance problems.
    Code Inspector (SCI)
    You can call the Code Inspector from the ABAP Editor (SE38), the Function Builder (SE37), the Class Builder (SE24), or as a separate transaction (SCI).
    The Code Inspector indicates possible problems. However, note that, especially with performance issues: There is no rule without exception. If a program passes an inspection, it does not necessarily mean that this program will have no performance problems.
    reward if usefull

  • SQL Trace(ST05) and Run Time Analysys(SE30)

    Hi ABAP Experts,
    Can any one explain what is the use of
    1) ST05 and
    2) SE30
    ponits will be given for clear cut explanation
    Thanks and Regards
    Vijaya

    Hi,
    The SQL Trace part of the Performance Trace tool allows you to see how the OPEN SQL statements that you use in ABAP programs are converted to standard SQL statements (see Embedded SQL) and the parameters with which the embedded SQL statements are passed to the database system.
    Overview
    From the time you turn on the trace function to the time you turn it off again, all database activity occurring either for a specific user or for an entire system is recorded. The SAP System takes OPEN SQL statements and converts them in to embedded SQL statements that it passes to the database and makes the results available. The embedded SQL statement and its parameters are recorded in the SQL Trace file. The results of the SQL statement, like return code, number of entries retrieved, inserted, or deleted by the database are recorded in the SQL Trace file as well. The log file also contains the runtime of the statement and the place in the application program, respectively transaction, from which it was called which enables additional analyses (supported by the SQL Trace function).
    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
    Create a Trace (SQL Server Profiler)
    To create a trace
    On the File menu, click New Trace, and connect to an instance of SQL Server.
    The Trace Properties dialog box appears.
    Note: 
    The Trace Properties dialog box fails to appear, and the trace begins instead, if Start tracing immediately after making connection is selected. To turn off this setting, on the Tools menu, click Options, and clear the Start tracing immediately after making connection check box.
    In the Trace name box, type a name for the trace.
    In the Use the template list, select a trace template on which to base the trace, or select Blank if you do not want to use a template.
    To save the trace results, do one of the following:
    Click Save to file to capture the trace to a file. Specify a value for Set maximum file size. The default value is 5 megabytes (MB).
    Optionally, select Enable file rollover to automatically create new files when the maximum file size is reached. You can also optionally select Server processes trace data, which causes the service that is running the trace to process trace data instead of the client application. When the server processes trace data, no events are skipped even under stress conditions, but server performance may be affected.
    Click Save to table to capture the trace to a database table.
    Optionally, click Set maximum rows, and specify a value.
    Caution: 
    When you do not save the trace results to a file or table, you can view the trace while SQL Server Profiler is open. However, you lose the trace results after you stop the trace and close SQL Server Profiler. To avoid losing the trace results in this way, click Save on the File menu to save the results before you close SQL Server Profiler.
    Optionally, select the Enable trace stop time check box, and specify a stop date and time.
    To add or remove events, data columns or filters, click the Events Selection tab. For more information, see: How to: Specify Events and Data Columns for a Trace File (SQL Server Profiler)
    Click Run to start the trace.
    Runtime analysis:
    se30 is the tcode for run time analysis, is a tool it
    display report based on lps for abap pragram execution
    time , data base load, system load. these are all will
    display in micro seconds.this tool will use for Transaction
    code, function modules , abap progrmes
    In Transaction SE30, fill in the transaction name or the program name which needs to be analyzed for performance tuning.
    For our case, let this be “ZABAP_PERF_TUNING”
    After giving the required inputs to the program, execute it. After the final output list has been displayed, PRESS the “BACK” button.
    On the original SE30 screen, now click on “ANALYZE” button.
    The percentage across each of the areas ABAP/ Database/System shows the percentage of total time used for those areas and load on these areas while running the program . The lesser the database load faster the program runs.
    SQL trace:
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    SE30
    /people/siegfried.boes/blog/2007/11/13/the-abap-runtime-trace-se30--quick-and-easy
    regards,
    vasavi.
    kindly reward if helpful.

  • No insert Statements for EKKO EKPO in ST05 sql trace for transaction me21n

    No insert Statements for EKKO EKPO in ST05 sql trace for transaction me21n.
    IN ST05 I set a filter for ME21N and executed transaction to create a Purchase Order and then checked
    ST05 but there is  NO insert for EKKO or EKPO??
    How Do I find in which columns of EKKO and EKPO data is inserted in ST05?
    Edited by: DeepakNandikanti on Apr 28, 2010 8:27 AM

    Hi,
    I tried in my system and I can see INSERT statement on EKKO and EKPO tables. What exactly you are looking for? Some one else might have switched on the trace at the same time. Can you try again and see.
    ST05=>Switch on trace
    ME21N=>Create PO.
    ST05=>Switch off and display trace.
    In trace list search for EKKO and EKPO.
    Column names are not shown in the trace list. It is the SQL trace and column list is generated dynamically like :A0, :A1....
    @ Suhas,
    That might be because the tables are updated via BAPIs ... Do you think SAP uses direct update statements on the DB tables ??
    I didn't get above statement. Is there any other way of updation that happens when using BAPI? I believe that, even in case of BAPI there will be update task FMs called during database update. Please correct if i got it wrong.
    Thanks,
    Vinod.

  • Sql trace (st05)

    hi friends
    .pls tell in detail how to evaluate  the performance of one select querry by using sql trace.( pls tell all traces )

    Kumar,
      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
    Don't forget to reward if useful...

  • Starting SQL-Trace Automatically - Transaction Code: ST05

    Good Morning Experts!
    I have got a problem with my "SAP - Business Warehouse (BW) System".
    We have very much Traffic on this System every night (between 03:00 and 04:00 a.m.).
    Because nobody is at work so early in the morning, I wanted to ask you, if there is a possibility to start the SQL-Trace (which you can call by transaction code: ST05) automatically.....?
    Is there a possibility to write a short ABAP Code to start the SQL-Trace automatically?
    Thank's and best regards.

    Hello Rob.
    Thank you for replying.
    I tried to create a job with the "Job Wizard" with SM36.
    Now i realized, that i have to wirte my own ABAP-Report (Programme), which uses the ST05 SQL-Trace function.
    I am not an ABAP-Professional, so would you be so kind and give me the code-lines of this programme?
    I can not imagine if you have to write only 5-10 lines or if the code is much longer...
    Thank you and best regards.

  • Regarding SQL trace

    Hi all,
    I want to run a SQL trace for processing of CREMAS IDOC's ( custom Functional module)  and i want to see which all tables or SQL statement is taking more time .
    Can you tell me procedure to run SQL trace.

    HI,
    Here are the 2 good links
    http://publib.boulder.ibm.com/tividd/td/ITMAN/SC32-9195-00/en_US/HTML/sap_add06.htm
    http://help.sap.com/saphelp_webas610/helpdata/en/d1/8022e5454211d189710000e8322d00/content.htm
    Well using SQL trace
    like as follows:
    Goto transaction ST05. Press TRACE ON.
    Execute your transaction .
    Come back to this screen and click TRACE OFF.
    Then check the trace details.
    You end up getting unnecessary details
    Lets say you have to analyze your particular SQL query,
    1. put a breakpoint at the select statement and execute the transaction , as it stops at your breakpoint , run SQL trace in seperate session.
    2. Trace ON
    3. Execute the select statement.
    4. Trace OFF
    5. Analyze.
    In this way you can analyze your particular select query
    Pls check links like:
    http://help.sap.com/saphelp_nw04/helpdata/en/17/358df9c9fee2469105731e10756921/frameset.htm
    http://help.sap.com/saphelp_bw30b/helpdata/en/d1/801f89454211d189710000e8322d00/frameset.htm
    http://www.sapbrain.com/TOOLS/SQLTRACE/SQL_TRACE.html
    SQL Trace
    SQL trace (ST05) provides the developer with the ability to analyze database select statements. Simply execute ST05 to turn on SQL trace, then execute the statement/program you want to analyze. Now turn off SQL trace using ST05
    And click on list trace to view the details.
    Authorization trace analysis
    1. Open two sessions
    2. Execute transaction ST01 in one of the sessions
    3. Select the authorization checkbox, note the other traces
    you can perform (SQL, RFC, Table Buffer etc)
    4. Click the 'Trace On' button
    5. Within your other session execute 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 authorization 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
    GO THROUGH THIS
    Tools provided for Performance Analysis
    Following are the different tools provided by SAP for performance analysis of an ABAP object
    Cheers,
    Simha.

  • What is SQL Trace and How to Use it .

    Dear Experts .
    1.) May You Please tell me What is the Purpose of SQL-Trace and How to use it ?
    2.) What is purpose of T-codes SE30 and ST22 ?
    Please it is urgent ...
    Regards :  Rajneesh

    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 a particular database table of the ABAP program would be 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.
    Run time analysis transaction SE30 :This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing. 
    STEPS
    Run time analysis transaction SE30
    In Transaction SE30, fill in the transaction name or the program name which needs to be analyzed for performance tuning.
    For our case, let this be “ZABAP_PERF_TUNING”
    After giving the required inputs to the program, execute it. After the final output list has been displayed, PRESS the “BACK” button.
    On the original SE30 screen, now click on “ANALYZE” button.
    The percentage across each of the areas ABAP/ Database/System shows the percentage of total time used for those areas and load on these areas while running the program . The lesser the database load faster the program runs.
    SQL Trace – ST05
    Starting the Trace:
    To analyze a trace file, do the following:
    Choose the menu path Test  Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    If you want to switch on the trace under your user name, choose Trace on. If you want to pass on values for one or several filter criteria, choose Trace with Filter.
    Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    Now run the program to be analyzed.
    Stopping the Trace:
    To deactivate the trace:
    Choose Test Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    Select the trace functions that you want to switch off.
    Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Analyzing a Sample trace data: PREPARE: Prepares the OPEN statement for use and determines the access method.
    OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
    FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area.

  • BDC,ALV,SQL trace

    1.How can we change the language setting while uploading BDC?
    2.How can we add a push button to the ALV report?
    3. What is SQL Trace, how would you carried out performance analysis of ABAP code Using SQL Trace? Give the steps?

    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 a particular database table of the ABAP program would be 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.
    SQL Trace – ST05
    Starting the Trace:
    To analyze a trace file, do the following:
    Choose the menu path Test &#61614; Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    If you want to switch on the trace under your user name, choose Trace on. If you want to pass on values for one or several filter criteria, choose Trace with Filter. Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    Now run the program to be analyzed.
    Stopping the Trace:
    To deactivate the trace:
    Choose Test &#61614;Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    Select the trace functions that you want to switch off.
    Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Analyzing a Sample trace data:
    PREPARE: Prepares the OPEN statement for use and determines the access method.
    OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
    FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area.

  • About SQL tracer

    Hi, I want to know about SQL tracer i.e. how can we perform SQL tracer on our program specifically.
    Please do this needful
    Thanks
    Suren

    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 a particular database table of the ABAP program would be 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.
    Starting the Trace:
    To analyze a trace file, do the following:
    Choose the menu path Test &#61614; Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the
    Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    If you want to switch on the trace under your user name, choose Trace on.  If you want to pass on values for one or several filter criteria, choose Trace with Filter.  Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    Now run the program to be analyzed.
    Stopping the Trace:
    To deactivate the trace:
    Choose Test &#61614;Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    Select the trace functions that you want to switch off.
    Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Analyzing a Sample trace data:
    PREPARE: Prepares the OPEN statement for use and determines the access method.
    OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
    FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area.

  • How to use the transaction STO5 (SQL Trace)

    Hi,
        I want to check the performance of program using the ST05 transaction. Please send me the step by step procedure to trace my program.
    Thanks & Regards,
    Santhosh Kumar.R

    Hi,
    following explanation clearly you abt ST05
    Hi,
    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.
    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.
    Performance Tuning is useful mainly reducing load on database. It is very important aspect while writing the programs/FM etc.....
    SQL Trace
    Use
    The SQL Trace function is an on-demand log of selected SQL statements that are issued against the database through the Open SQL Engine. The SQL Trace can be switched on or off dynamically. The log format is database independent. Besides the SQL statement text, each log record contains information about the point in time when the statement was executed, its duration, its input parameters and results (where applicable) as well as context information.
    Features
    The SQL Trace is especially useful for:
    Development:
    SQL Trace can help JDO, enterprise beans, servlet and JSP developers to learn which kind of database accesses their code produces.
    &#61489;&#61486; Performance analysis
    Typically, performance issues are caused by inefficient database accesses. In this case SQL Trace can be used to show the issued SQL statements and their duration, thus helping to identify inefficient SQL statements.
    Functions
    <b>The following functions are available on the initial screen</b>:
    Select trace:
    • Select the trace mode SQL Trace, Enqueue Trace, RFC Trace, or Table Buffer Trace. You can select mutliple trace modes simultaneously.
    Select trace function:
    • Start the trace recording.
    • Stop the trace recording.
    • Branch to trace list, detailed list, or time-sorted list.
    • Branch to Explain SQL to analyze an SQL statement without an explicit trace file.
    Trace files are managed by the system. Thus they can be saved, like any other object;
    saved trace files can be displayed and deleted.
    Trace Status
    A trace can only be activated once on any application server. The Trace Status display informs you whether another user in the system has already activated a particular trace.
    Starting the Trace
    Prerequisites
    <b>You can only switch on the Performance Trace for a single instance</b>. You should already have decided the scope and targets of your performance analysis.
    Procedure
    <b>To analyze a trace file, do the following</b>:
    ... 1. Choose the menu path Test &#61614; Performance Trace in the ABAP Workbench.
    The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
    2. Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
    3. If you want to switch on the trace under your user name, choose Trace on.
    If you want to pass on values for one or several filter criteria, choose Trace with Filter.
    Typical filter criteria are: the name of the user, transaction name, process name, and program name.
    4. Now run the program to be analyzed.
    You will normally analyze the performance trace file immediately. In this case, it is a good idea to use a separate session to start, stop, and analyze the Performance Trace
    If you are shown trace kernel errors on the initial screen (for example, not enough storage space available), you must first remove the errors or have them removed by your system administrator.
    The selected trace types can be changed as required during a performance trace interval (time between switching on and off the trace). The user (user group) must remain unchanged.
    Result
    The results of the trace recording are written to a trace file. If trace records are overwritten during the trace interval, the system displays a message to inform you when you analyze the trace file.
    The results of the trace recording are stored to ten trace files. Overwriting trace records, however, cannot be entirely excluded in this case either.
    The Performance Trace records all database access calls, table buffer calls, remote calls, or calls for user lock activity. These measurements can affect the performance of the application server where the trace is running. To preserve system performance, you should therefore turn off the trace as soon as you finish recording your application.
    Stopping the Trace
    Prerequisites
    You have started the trace and finished running the program that you want to analyze.
    <b>For performance reasons, you should switch off the traces as soon as you have finished recording.</b>
    Procedure
    <b>To deactivate the trace:</b>
    ... 1. Choose Test &#61614;Performance Trace in the ABAP Workbench.
    The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
    2. Select the trace functions that you want to switch off.
    3. Choose Deactivate Trace.
    If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
    Result
    The results of the trace are stored in one or more trace files. You can then analyze the performance data stored in the trace file. See also, Analyzing Performance Data.
    Look at the below link
    http://www.sapbrainsonline.com/TOOLS/SQLTRACE/SQL_TRACE.html
    <b>Reward with points if helpful.</b>
    Regards,
    Vijay

Maybe you are looking for

  • My MBP experience

    I bought a MBP about 2 weeks ago after being a Windows user for many years. I have been building my own PCs for almost 10 years and my main use of them is for video editing. For the benefit of those in a similar situation, I'd like to share my experi

  • Create a summary based on a response to a given question

    Hi. I use this to collect data on my students. I have 2 sections of students, M and R (Monday and Thursday) and they all answer the same questions (one of which is to indicate their section.) While I do want to see a report summary that has data on a

  • Regarding Date format in output text file

    Hi Frnds, i am taking the data from vbak table into one internal table T_vbak, in that i am having vdatu field also, and after that using GUI_Download function module i am downloading that internal table data to one text file into presentation server

  • Autoplay idvd - how to make it work?

    I tried following the directions as to make an autoplay dvd but when I hit play the theme was still there and the dvd didn't just start like it said it would - any suggestions?

  • Parse/Read APK file Adobe Air Android

    Hi Guys! I have problem uploading my apk file on google play, since it's bigger than 50MB and I want to upload a simple loader file and then download the expansion APK and open its swf file. Any ideas on how to parse the APK and reach the swf file? C