Expensive SQL Statements of the day?

Hi...
How can i find out Expensive SQL Statements of the day please.?
Our SAP Version is ECC 6.0 on Oracle 10.2.0.4.0
Rgds

Hi Srinivas,
On ECC 6.0, go to ST04 t-code --> performance --> SQL Cache --> You see SQL Statements where you need to sort by SQL Statements by Total Execution Time(ms).
I have tried on one of my R/3 4.7EE system, ST04n --> Resource COnsumption --> Top SQL Statements --> you will see 50 Top most expensive SQL Statements interms of wait time.
also Read: [Re: Diagnosis of the expensive ABAP programs having database time > 90%;
                  [Please Read before Posting in the Performance and Tuning Forum;
Regards,
Kanthi Kiran

Similar Messages

  • EarlyWatch - Expensive SQL Statements help

    Hi all,
    i need to analyze an EWA report and i don't know how exactly can i identify an "expensive SQL statement".
    The report says:
    During this session, the following expensive SQL statements were identified as causing a database load of at least 1%.
    The corresponding stored procedure names are referenced in the table below.
    And in the table with stored procedure names, a row looks like this:
    ID     Stored Procedure Name
    1     ##Y4DCWWES7EHY100000053960000254832042037
    What does it mean and how can i identify the name of program and the exact statement (probably select) that is causing this problem?
    Thank you,
    Ondrej

    Hi Ondrej,
    you're running on SQL Server. SAP creates stored procedures for each and every statement run against the database. The name you get seems to be a temporary stored procedure which (if I'm not wrong) is marked by the two # characters at the beginning. You may be still find it in the stored procedures of your system.
    Open the Enterprise Manager and open your database, then the stored procedure link (you should run the Enterprise Manager on the server or on a PC with enough RAM). The search for the procedure and double click on it. I think that should show you the SQL statement. There should also the report name is a comment.
    Regards
    Ralph

  • Expensive SQL statements in GTS

    Hi,
    Recently EWA has been run for the GTS system.There are expensive SQL statements that were causing the Performance issue.It would be a great help if anyone can advise on how these expensive SQL statments can be fine tuned. As all these statements were in standard SAP programs is it that we had the only option to create secondary indices ?
    Moderator message - Please respect the 5,000 character maximum when posting. Post only the relevant portions of code
    Please see Please Read before Posting in the Performance and Tuning Forum before posting
    Any suggestion on performance improvement is appreciated.
    Thanks in advance!!
    Regards,
    Sharon.
    Edited by: Rob Burbank on Nov 15, 2010 9:08 AM

    please ask specific questions.
    Otherwise there are services by SAP, either training or support, but they are not for free.
    Siegfried

  • Expensive SQL statements in EWA

    Hi experts,
    how can I add expensive SQL statements to Early watch alert reports? In my IDES system this is generated automatically but not for different other systems. Can this be activated by specific settings?
    Thanks and best regards, Basti

    Hi bd,
    Please check these points:
    What database are you using?
    What is the version of the ST-SER in your solution manager?
    Is the service preparation finished in the managed system(run se38 -> RTCCTOOL to check)?
    Have you checked note 1564508?
    Besides that, do you see any issue in the SDCCN collection logs for the EWA?
    Regards,
    Daniel.

  • Expensive SQL statements & no proper indexing INCLUDE LPSSTU03-PSST FuncGrp

    Hi there forum
    During a recent upgrade we have implemented EhP4 with relevant Support Packs.
    Our Early Watch Report nows highlights INCLUDE LPSSTU03 in Function Module Group PSST as having expensive SQL statements along with improper indexing.
    Although I have seached through OSS and Forums I can find nothing of help.
    Is there an EXPERT out there who can help because SAP tells me that is the way it works!
    Thanks.
    Carl Cavendish-Davies

    Herewith the latest results from the Early Watch report on this issue:
    Object Type     Total Executions Disk Reads     Elapsed Time     Buffer Gets     Records Processed
    TABLE     242481         1873373     12035981     36237218     34390383
    SELECT
    "MANDT" , "OBJNR" , "STAT" , "CHGNR" , "USNAM" , "UDATE" , "UTIME" , "TCODE" , "CDTCODE" , "INACT" , "CHIND"
    FROM
    "JCDS"
    WHERE
    "MANDT" = :A0 AND "OBJNR" IN ( :A1 , :A2 , :A3 , :A4 , :A5 )&
    Execution Plan
    V$SQL_PLAN addr= C000000774FF4038 hash= 3408408745 sql_id 4w93fuv5khc59
    SELECT STATEMENT Estimated Costs= 6 Estimated Rows= 0 Optimizer: ALL_ROWS
    3 INLIST ITERATOR
    2 TABLE ACCESS BY INDEX ROWID JCDS
    Estimated Costs= 5 Estimated Rows= 28 Estim. Bytes: 1,848
    Estim. CPU-Costs = 41,426 Estim. IO-Costs = 5
    1 INDEX RANGE SCAN JCDS~0
    Estimated Costs= 1 Estimated Rows= 28 Access predicates:
    "MANDT"=:A0 AND (("OBJNR"=:A1 OR "OBJNR"=:A2 OR "OBJNR"=:A3 OR "OBJNR"=:A4
    OR "OBJNR"=:A5)) Search Columns: 2 Estim. CPU-Costs = 6,777 Estim. IO-Costs = 1
    Program Data:
    Origin of ABAP coding
    Program Name Line  Created By Last Changed By Last Changed On
    LPSSTU03      44     SAP          SAP               25.03.2003
    000044 SELECT * FROM JCDS
    000045 APPENDING CORRESPONDING FIELDS OF TABLE T_JCDS
    000046 FOR ALL ENTRIES IN R_OBJNR
    000047 WHERE OBJNR = R_OBJNR-OBJNR.

  • Expensive SQL Statements

    Hi all,
             Am a new bee to this group I'll be greateful if any one help me in understanding about the Expensive SQL Statements.why n where thy r used
    Thanks..
    Mohammed

    Hi shankaran,
    1. Is there any way in finding out the expensive sql statements been used in a program.
      There is no direct way to find out.
    2. Only when the program is run,  
       and thru basis tcodes/performance testing tcodss,
      can we know whether some sqls are very heavy !
    3. PERFORMANCE TUNING IS VERY SENSITIVE TOPIC
    4. There are some basic recommendatations.
       a) don't use select *, just use select fied1,field2
       b) Incrase the fileter criteria (ie. more where conditions to narrow down the search cretierai)
       c) Create secondar indexes on columns 
        of tables, which are frequently
       used in programs.
    regards,
    amit m.

  • Expensive SQL statements & no proper indexing INCLUDE LBSVAU14-BSVA FuncGrp

    Expensive SQL statements & no proper indexing INCLUDE LBSVAU14 - Function Group BSVA (Status management)
    Hi there Forum
    During a recent upgrade we have implemented EhP4 with relevant Support Packs.
    Our Early Watch Report nows highlights INCLUDE LBSVAU14 as having expensive SQL statements along with improper indexing.
    Although I have seached through OSS and Forums I can find nothing of help.
    Is there an EXPERT out there who can help because SAP tell me that is the way it works!
    Thanks.
    Carl Cavendish-Davies

    Herewith the latest results from the Early Watch report on this:
    Object Type     Total Executions         Disk Reads   Elapsed Time   Buffer Gets    Records Processed
    TABLE     457663                 3282704       21081305        28310151       20031340
    SELECT
    FROM
    "JEST"
    WHERE
    "MANDT" = :A0 AND "OBJNR" IN ( :A1 , :A2 , :A3 , :A4 , :A5 )&
    Execution Plan
    V$SQL_PLAN addr= C000000774FF4038 hash= 3408408745 sql_id 4w93fuv5khc59
    SELECT STATEMENT Estimated Costs= 3 Estimated Rows= 0 Optimizer: ALL_ROWS
    3 INLIST ITERATOR
    2 TABLE ACCESS BY INDEX ROWID JEST
    Estimated Costs= 3 Estimated Rows= 10 Estim. Bytes: 330
    Estim. CPU-Costs = 20,886 Estim. IO-Costs = 3
    1 INDEX RANGE SCAN JEST~0
    Estimated Costs= 1 Estimated Rows= 10 Access predicates:
    "MANDT"=:A0 AND (("OBJNR"=:A1 OR "OBJNR"=:A2 OR "OBJNR"=:A3 OR "OBJNR"=:A4
    OR "OBJNR"=:A5)) Search Columns: 2 Estim. CPU-Costs = 6,137 Estim. IO-Costs = 1
    Program Data:
    Origin of ABAP coding
    Program Name       Line     Created By     Last Changed By    Last Changed On
    LBSVAU14            110     SAP     SAP              08.04.2007
    000110 SELECT * FROM JEST CLIENT SPECIFIED
    000111 APPENDING TABLE JEST_BUF
    000112 FOR ALL ENTRIES IN OBJNR_TAB
    000113 WHERE MANDT EQ CLIENT
    000114 AND OBJNR = OBJNR_TAB-OBJNR.

  • Expensive SQL statements & no proper indexing INCLUDE LBSVAF14-BSVA FuncGrp

    Expensive SQL statements & no proper indexing INCLUDE LBSVAF14 - Function Group BSVA (Status management)
    Hi there Forum
    During a recent upgrade we have implemented EhP4 with relevant Support Packs.
    Our Early Watch Report nows highlights INCLUDE LBSVAF14 as having expensive SQL statements along with improper indexing.
    Although I have seached through OSS and Forums I can find nothing of help.
    Is there an EXPERT out there who can help because SAP tell me that is the way it works!
    Thanks.
    Carl Cavendish-Davies

    Herewith the latest results from the Early Watch report on this:
    Cache Statistics
    Object Type     Total Executions     Disk Reads     Elapsed Time     Buffer Gets     Records Processed
    TABLE     1716707                            1854501     13325961     25580720     19606427
    SELECT
    FROM
    "JEST"
    WHERE
    "MANDT" = :A0 AND "OBJNR" = :A1&
    Execution Plan
    V$SQL_PLAN addr= C000000774FF4038 hash= 3408408745 sql_id 4w93fuv5khc59
    SELECT STATEMENT Estimated Costs= 2 Estimated Rows= 0 Optimizer: ALL_ROWS
    2 TABLE ACCESS BY INDEX ROWID JEST
    Estimated Costs= 1 Estimated Rows= 2 Estim. Bytes: 66
    Estim. CPU-Costs = 8,804 Estim. IO-Costs = 1
    1 INDEX RANGE SCAN JEST~0
    Estimated Costs= 1 Estimated Rows= 2
    Access predicates: "MANDT"=:A0 AND "OBJNR"=:A1 Search Columns: 2
    Estim. CPU-Costs = 5,817 Estim. IO-Costs = 1
    Program Data:
    Origin of ABAP coding
    Program Name       Line     Created By     Last Changed By   Last Changed On
    LBSVAF14           81     SAP     SAP             08.04.2007
    000080 * Einzelstatus von DB lesen in interne Tabelle
    000081 SELECT * FROM JEST CLIENT SPECIFIED
    000082 APPENDING TABLE JEST_TAB
    000083 WHERE MANDT = MANDT
    000084 AND OBJNR = OBJNR.

  • Expensive SQL statements & no proper indexing in INCLUDE LV70AF01-SAPLV70A

    Hi there forum
    During a recent upgrade we have implemented EhP4 with relevant Suppoert Packs.
    Our Early Watch Report nows highlights INCLUDE LV70AF01 in Module SAPLV70A as havinf a multitude of expensive SQL statements along with improper indexing.
    Although I have seached through OSS and Forums I can find nothing of help.
    Is there an EXPERt out there who can help because SAP tell me that is the way it works!
    Thanks.
    Carl Cavendish-Davies

    Herewith the results of our latest Early Watch report on this issue:
    Statement Data:
    Cache Statistics
    Object Type     Total Executions Disk Reads     Elapsed Time     Buffer Gets     Records Processed
    TABLE     261         1107862     11465343     170865092     4
    SELECT
    FROM
    "NAST"
    WHERE
    "MANDT" = :A0 AND "KAPPL" = :A1 AND "KSCHL" = :A2 AND "NACHA" = :A3 AND "VSTAT" = :A4 AND "VSZTP" = :A5 AND "AKTIV" = :A6&
    Execution Plan
    V$SQL_PLAN addr= C000000774FF4038 hash= 3408408745 sql_id 4w93fuv5khc59
    SELECT STATEMENT Estimated Costs= 1,338 Estimated Rows= 0 Optimizer: ALL_ROWS
    2 TABLE ACCESS BY INDEX ROWID NAST
    Estimated Costs= 1,338 Estimated Rows= 150
    Filter predicates: ("NACHA"=:A3 AND "VSTAT"=:A4 AND "VSZTP"=:A5)
    Estim. Bytes: 41,700 Estim. CPU-Costs = 13,539,142 Estim. IO-Costs = 1,336
    1 INDEX RANGE SCAN NAST~I
    Estimated Costs= 19 Estimated Rows= 8,093 Filter predicates: "AKTIV"=:A6
    Access predicates: "MANDT"=:A0 AND "KAPPL"=:A1 AND "KSCHL"=:A2 AND "AKTIV"=:A6
    Search Columns: 4 Estim. CPU-Costs = 988,073 Estim. IO-Costs = 19
    Program Data:
    Origin of ABAP coding
    Program Name Line Created By Last Changed By Last Changed On
    LV70AF01      930  SAP         SAP               07.06.2001
    000930 SELECT * FROM nast INTO TABLE ct_messages
    000931 WHERE kappl IN irt_application
    000932 AND kschl IN irt_type
    000933 AND nacha IN irt_medium
    000934 AND vstat IN irt_status
    000935 AND vsztp IN irt_timing
    000936 AND aktiv EQ space.

  • High Database server load from expensive SQL statements

    Dear all,
    I am facing problem in the production  sever there is high Database server load from expensive SQL statements as per EVA report
    Buffer Load [%]     Disk Load [%]     CPU Load [%]
    55     69     0
    Analysis of DB SQL CACHE
    EXPENSIVE SQL STATEMENTS OVERVIEW
    Object Name     CPU Load [%]     I/O Load [%]     Elapsed Time [%]     Executions     Records Processed
    BSIS        1     9     0     22     90462
    CDEF$     6     6     0     2131113     2575694
    BSAD     1     3     0     21     408576
    MKPF     1     32     0     180     3899
    ICOL$     9     1     0     2575694     8703798
    OBJ$     6     1     0     3405254     3400023
    COL$     12     0     0     2138793     22919657
    MKPF     1     13     0     75     396
    MCHB     7     0     0     366543     41708
    Please suggest the step by step to reduce  the  expensive SQL  from these table.
    Regards

    Hi,
    In tx code ST05 i have find the following deatails.
    Duration |Obj. name |Op.    |Recs.|RC    |Statement  
         4 TSP03A     REOPEN             0 SELECT WHERE "NAME" = 'LOCL' AND "P" = 'S_CLIENTS'                                                                                344 TSP03A     FETCH       1      0                                                                                42 ZRIN    DECLARE            0 SELECT WHERE "MANDT" = :A0 AND "BCQ" = :A1                                                                                442 ZRIN    PREPARE            0 SELECT WHERE "MANDT" = :A0 AND "BCQ" = :A1                                                                                3 ZRIN    OPEN               0 SELECT WHERE "MANDT" = '600' AND "BCQ" = 'BCQ'                                                                               
    2,181,565 ZRIN  FETCH       4   1403                                                                               
    706,267 DBA_SEGME FETCH      99      0                                                                                8,248 DBA_SEGME FETCH      99      0                                                                                44,994 DBA_SEGME FETCH      99      0                                                                                67,713 DBA_SEGME FETCH      99      0   
    1,367,923 DBA_SEGME FETCH      99      0
      16,735|TADIR     |FETCH  |    1|  1403|                                                                                |
    5
    TADIR
    REOPEN
    0
    SELECT WHERE "PGMID" = 'R3TR' AND "OBJECT" = 'TABL' AND "OBJ_NAME" = 'CME__TEXT'
    22,415
    TADIR
    FETCH
    1
    1403
    4
    TADIR
    REOPEN
    0
    SELECT WHERE "PGMID" = 'R3TR' AND "OBJECT" = 'TABL' AND "OBJ_NAME" = 'CME_PATTERN_SIGN'
    232
    TADIR
    FETCH
    1
    1403
    4
    TADIR
    REOPEN
    0
    SELECT WHERE "PGMID" = 'R3TR' AND "OBJECT" = 'TABL' AND "OBJ_NAME" = 'CML_ARC_DEADLINE'
    19,189
    TADIR
    FETCH
    1
    1403
    4
    TADIR
    REOPEN
    706,267
    DBA_SEGME
    FETCH
    99
    0
    |
    44,994
    DBA_SEGME
    FETCH
    99
    0
    67,713
    DBA_SEGME
    FETCH
    99
    0
    Please suggest how to  reduce it.
    Regards,

  • Expensive SQL Statement

    Hi Guys,
    I have just received an email from our basis team where they said I am using an expensive SQL statement.
    There is a loop on a table of people with the following statement
        SELECT * FROM catsdb INTO TABLE w_cats
          WHERE arbid EQ i_data-arbid
          AND   raufpl EQ i_data-aufpl
          AND   raplzl EQ i_data-aplzl
          AND   workdate IN s_wdate
          AND   status EQ '30'.
    Is it me or is this the quickest way possible??
    Can anyone think of a better way to do this??
    Thanks Experts

    First of all, did you ever hear about indices? Please check whether there is an index (SE11) with has fields of your WHERE-condition.
    => if this is not the case the it will be slow, until an index is created.
    Second, change the LOOP into a FOR ALL ENTRIES, don't forget to check whether the itab is initial.

  • How to pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • Can the format of a SQL Statement modify the execution time of an SQL ....

    Can the format of a SQL Statement modify the execution time of an SQL statement?
    Thanks in advance

    It depends on:
    1) What oracle version are you using
    2) What do you mean for "format"
    For example: if you're on Oracle9i and changing format means changing the order of the tables in the FROM clause and you're using Rule Based Optimizer then the execution plan and the execution time can be very different...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • XML Publisher - can we specify multiple SQL statements in the report?

    Hi there,
    can we specify multiple SQL statements in the report with XML Publisher?
    Regards,
    Liviu

    Could we eventually generate with the Wizards available in XML Publisher desktop 5.6.2 an xml file with a structure like the one given below? The reason is to facilitate creation of the two rowsets. Thanks, Liviu.
    <?xml version="1.0" encoding="UTF-8"?>
    <DATA>
         <ROWSET2>
              <ROW2>
                   <FIELD1>Query1</FIELD1>
                   <FIELD2>field2</FIELD2>
                   <FIELD3>field3</FIELD3>
              </ROW2>
         </ROWSET2>
         <ROWSET>
              <ROW>
                   <FIELD1>Query2</FIELD1>
                   <FIELD2>field2</FIELD2>
                   <FIELD3>field3</FIELD3>
              </ROW>
         </ROWSET>
    </DATA>

  • Custom SQL statement on the fly

    Is it possible to construct dynamic SQL statement in DB adapter on the fly?

    One Solution is pass your sql statement to the procedure and fire it from the procedure.
    stmt_str := 'INSERT INTO ' || tablename || ' VALUES
    (:deptno, :dname, :loc)';
    EXECUTE IMMEDIATE stmt_str
    USING deptnumber, deptname, location;
    refer this thread Dynamic database adapter
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • How do you determine what shows are in free video on demand?

    How do you determine what to include in the free on-demand shows?  The Mentalist was always there before but is no longer.  This is especially important for shows like the Mentalist and The Good Wife which come on Sunday nights after sports events.  

  • Connecting two WRE54G to on WTR54G

    Hi! One customer asked me if I could make wireless network to building across the road on the same internet. My case is as follow: WRT54G Router i placed in building 1 in the basement with thick walls, roof in wood. Network supposed to be wireless ex

  • Optimizer Hint

    When I set the Optimizer Hint property to something like /*+ INDEX(Fin_Budgets Bud_PK)*/ at design time and query the form then the default query does not include the hint I passed. But when I set it programmatically via Set_Block_Property it does in

  • Is it possible to add data link at runtime

    Hi, I would like to get the data from a temporary table and needs to create a data link with an existing group at run time to display the temporary data in the same frequecy of the other groups.....thanks Bcj

  • AS3 + Captivate 3

    Hi, I'm working on a project which is composed  with a core made in AS3 and animations made in captivate 3. The application seems to correctly load and display the swf files made with captivate 3 (export settings : flash player 9), but only the first