Please explain execution of select statement after parsing.

Can any body explain me what happen when a "select * from emp where ename='sanjay' " statement parsed information is found in shared sql area in library cache.
Where does the execution phase takes place. Is it in private SQLAREA or shared sql area. Please consider that it is MTS(shared server connection) and also UGA is present in Large Pool.
Please explain step by step.
Thank you

You did not indicate a version number and this is important information especially since the term MTS has been replaced by the term "Shared Servers."
Perhaps this will help you:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2588723819082

Similar Messages

  • System memory isn't available afer the execution of select statement.

    hi experts, i have written the following query.
         SELECT BUKRS BLART BUDAT BLDAT MONAT
                 FROM BKPF INTO CORRESPONDING FIELDS OF TABLE IT_BKPF
                     WHERE BUKRS IN BKRS AND BUDAT IN DATE.
           IF SY-SUBRC EQ 0.
           SELECT BUKRS BELNR GJAHR DMBTR PSWSL ZUONR SGTXT AUFNR ALTKT SHKZG HKONT
              FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG FOR ALL ENTRIES IN IT_BKPF
                 WHERE BUKRS = IT_BKPF-BUKRS AND BELNR IN DOC AND HKONT IN GLE.
             IF SY-SUBRC EQ 0.
               SELECT BUKRS KTEXT FROM AUFK INTO CORRESPONDING FIELDS OF TABLE IT_AUFK
                  FOR ALL ENTRIES IN IT_BKPF WHERE BUKRS = IT_BKPF-BUKRS.
                 SELECT TXT50 TXT20 FROM SKAT INTO CORRESPONDING FIELDS OF TABLE IT_SKAT
                 FOR ALL ENTRIES IN IT_BSEG WHERE SAKNR = IT_BSEG-ALTKT.
                   ENDIF.
                   ENDIF.
    and transfering tha data into final table like this
    IT_FINAL[] = IT_BKPF[].
    LOOP AT IT_FINAL.
       READ TABLE IT_BSEG WITH KEY BUKRS = IT_FINAL-BUKRS.
       IF SY-SUBRC EQ 0.
      MOVE-CORRESPONDING IT_BSEG TO IT_FINAL.
       IT_FINAL-BELNR = IT_BSEG-BELNR.
       IT_FINAL-GJAHR = IT_BSEG-GJAHR.
       IT_FINAL-DMBTR = IT_BSEG-DMBTR.
       IT_FINAL-PSWSL = IT_BSEG-PSWSL.
       IT_FINAL-ZUONR = IT_BSEG-ZUONR.
       IT_FINAL-SGTXT = IT_BSEG-SGTXT.
       IT_FINAL-AUFNR = IT_BSEG-AUFNR.
       IT_FINAL-SHKZG = IT_BSEG-SHKZG.
       IT_FINAL-HKONT = IT_BSEG-HKONT.
       IT_FINAL-ALTKT = IT_BSEG-ALTKT.
         ENDIF.
         APPEND IT_FINAL.
       ENDLOOP.
       LOOP AT IT_FINAL.
         READ TABLE IT_AUFK WITH KEY BUKRS = IT_FINAL-BUKRS.
             IF SY-SUBRC EQ 0.
               IT_FINAL-KTEXT = IT_AUFK-KTEXT.
               ENDIF.
               APPEND IT_FINAL.
      ENDLOOP.
      LOOP AT IT_FINAL.
        READ TABLE IT_SKAT WITH KEY SAKNR = IT_FINAL-ALTKT.
         IF SY-SUBRC EQ 0.
           IT_FINAL-TXT50 = IT_SKAT-TXT50.
           IT_FINAL-TXT20 = IT_SKAT-TXT20.
           ENDIF.
           APPEND IT_FINAL.
      ENDLOOP.
    i am getting an runtime error'the system is configured incorrectly' even for the value of bukrs between 0001& 0005 and for budat 28.08.2006 & 28.05.2009.
    what happened?
    the current program had to be terminated because of an error when installing the R/3 system.
    the program had already reuested 399201216 bytes from the operating system with 'malloc' when the OS reported after a further memory request that there was no more memory space available.
    plz help....is there any problem in my query or do i need to change something from logic?
    thnks n regards,
    Ashmita

    Hi Ashmita,
    1. Whenever we use FOR ALL ENTRIES, we should check the content of the main table.
       BCOS if it empty, then ALL records will be fetched (in this case, from BSEG).
    2. When just put a IF condition
    if  IT_BKPF[] is not initial.
    select..... from BSEG... for all entries.....
    endif.
    3. This error may be coming because many many records are getting selected from BSEG and the memory on server is not available. Hence, one option is you may restrict your search. But before that please make sure the above check is in place.
    (You have already used if sy-subrc = 0, that may also work, but better to use the above)
    regards,
    amit m.

  • Select statement after Update statement under autocommit with RAC

    Hi,
    I've met a problem when developing my application with 10g RAC (3 machines). I am using open jdk 1.6.0 on linux platform with kernel release 2.6.18-128.e15PAE, my app using spring with oracledatasource to establish the database connection with autocommit. The situation as below:
    my application sends SMPP requests and receives SMPP responses, when receiving SMPP responses, my app update the response details to related record in DB. For some concatenated messages, my app need to check whether all responses of the related concatenated message are received, if all received, my app update the final status of the message.
    it is found that for some concatenated messages, all responses are received successfully, i.e. can be found in the database that the details of the responses are updated, however the final status of the message is not updated as expected. After further investigations to the database records and application logs, those cannot be updated with response returning almost at the same second, however they are manipulated one by one, not multi-thread. From the log of my app, it shown the dealing of the second response is started in the same second when the dealing of the first response is completed. It seems like when dealing the second response, it cannot "see" the first response is updated such that both responses find the message is not completed.
    Wonder under what condition would this happen? my db config as below:
    <bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close">
    <property name="driverType" value="oracle.jdbc.driver.OracleDriver" />
    <property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost2)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost3)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVICE_NAME=ha_bss)(SERVER=DEDICATED)))" />
    <property name="user" value="dbuser" />
    <property name="password" value="dbpassword" />
    <property name="connectionCachingEnabled" value="true" />
    <property name="connectionCacheProperties">
    <props merge="default">
    <prop key="InitialLimit">10</prop>
    <prop key="MinLimit">10</prop>
    <prop key="MaxLimit">2000</prop>
    <prop key="AbandonedConnectionTimeout">0</prop>
    <prop key="ConnectionWaitTimeout">120</prop>
    <prop key="validate-connection">true</prop>
    <prop key="validate-connection-statement">SELECT SYSDATE FROM DUAL</prop>
    <prop key="factory-class">oracle.jdbc.pool.OracleDataSourceFactory</prop>
    </props>
    </property>
    <property name="ONSConfiguration" value="nodes=dbhost1:6200,dbhost2:6200,dbhost3:6200"/>
    <property name="fastConnectionFailoverEnabled" value="true"/>
    </bean>
    thanks

    This is not likely to be a JDBC issue at all. It is likely that separate connections are being used
    for the separate threads, and they may be to different RAC nodes. You must configure your
    DBMS so there is zero latency between the nodes, else there may be some delay between
    when one node changes data and another can see it.
    HTH,
    Joe

  • Anyone please explain these two router stats.

    Having a (hopefully) minor glitch at the moment with what seems like a stuck IP profile, main thread here.
    A couple of other questions though.
     http://community.bt.com/t5/BB-in-Home/How-often-do-BT-reset-the-HH-remotely-and-should-it-effect-IP/...
    In the advanced stats are two connection times.
    1. Internet connection time and ADSL connection time.
        I was under the impression ADSL time is the time the hub has been on since the last reset... either by BT or by me pulling the plug. That was showing 6 days... I suspect my problems started when the HH was remotely reset. Am I correct in what this time measures ?
    2. I see there is also an "Internet connection" time... what's that ?
        It shows 1 day 14 hours. What is this figure measuring and what is it's significance ?     
    thanks

    This seems to be a common issue on this forum.
    Please take a look at this if you're trying to install via
    Terminal Services:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;320185

  • Can you please help with this select statement.

    The following code has a result, I need to modify the select somehow which only gives me the rows which are common between all PLSTS.
    Any suggestions?
    Thank you
    SELECT DISTINCT P.PLST, P.MENU, I,PNL, P.ACCESS
    FROM AUTHITEM P, I.MENUITEM
    WHERE P.MENU = I.MENU
    AND P.PNL = I.PNL
    AND P.MENU IN ('MSN, CPP')
    AND P.ACESS >= 8
    GROUP BY P.PLST, PMENU, I.PNL, P.ACCESS
    HAVING COUNT (*) >=2
    ORDER BY 2,3,4,1
    This is the result with having count > = 1, and if I add having count > =1 I get the following result
    PLST     MENU     PNL     ACCESS
    C001     MSN     LNAME     14
    C002     MSN     LNAME     14
    B008     MSN     LNAME     14
    B005     MSN     FNAME     14
    M009     MSN     LNAME     14
    C001     MSN     GNAME     14
    C002     MSN     GNAME     14
    B008     MSN     LNAME     14
    C001     MSN     FNAME     14
    C002     MSN     FNAME     14
    k008     CPP     MNAME     14
    I need this result
    PLST     MENU     PNL     ACCESS
    C001     MSN     LNAME     14
    C002     MSN     LNAME     14
    C001     MSN     GNAME     14
    C002     MSN     GNAME     14
    C001     MSN     FNAME     14
    C002     MSN     FNAME     14

    why bother with DISTINCT ?
    have a look at the results of :
    SELECT P.PLST, P.MENU, I.PNL, P.ACCESS , COUNT(*) ZCOUNT
      FROM AUTHITEM P, I.MENUITEM
    WHERE P.MENU    = I.MENU
       AND P.PNL     = I.PNL
       AND P.MENU  IN ('MSN, CPP')
       AND P.ACCESS >= 8
    GROUP BY P.PLST, P.PMENU, I.PNL, P.ACCESS
    ORDER BY 2,3,4,1
    ;and then apply HAVING COUNT(*) >= ...

  • Tuning Select Statement . field sequence and where clause

    Hi All
    Are there any general guidelines how to write select < field sequence >where clause < field sequence ? Is that shuld be in order of the field sequence in tables?
    And how to use this when we have a view or a inner - join . Is that separate from normal select statement that is using FOR ALL ENTRIES.
    Please let me know any general guidelines available on this,
    Amol

    Hello Amol,
    I have another hint:
    The statement FOR ALL ENTRIES will package the select statements for every five entries in the internal table. So in comparison to the following code sequence...
    LOOP AT itab.
       SELECT * FROM table WHERE key = itab-key.
    ENDLOOP
    the number of select statements is reduced to 20% with
    SELECT * FROM table INTO TABLE ...
         FOR ALL ENTRIES IN itab
         WHERE key = itab-key
    If I'm expecting a <i>huge</i>  amount of data a go a step further and create my own packages by building a range table with around 100-500 entries and execute a select there...
    LOOP AT itab.
       IF counter < 500.
          APPEND itab-key TO range-tab.   " just code example
       ENDIF.
       IF count >= 500.
          SELECT * FROM table APPENDING TABLE ...
             WHERE key IN range_tab
       ENDIF.
       " adjust and calculate counter
    ENDLOOP.
    * Don't forget last select statement after loop
    Best wishes,
    Florin

  • Reg  select statement

    hi i have a problem.
    i want to extract  records from three fields in a table using select statement.after extraction.
    if there is no records in the three fields i had to give another condition.can any body provide code for this

    HI,
    try with this
    select field1 field1 field 1
              from <tablename>
              into itab1
              where
              condition1...
    now u check for
    if sy-subrc ne 0. OR itab1[] is initial.
    select field1 field1 field 1
              from <tablename>
              into itab1
              where
              condition1...
              condition2...
    endif.
    If i am not clear ... reply back
    Santhosh

  • Select statement performance improvement.

    HI Guru's,
    I am new to ABAP.
    I have the below select stement
    000304         SELECT mandt msgguid pid exetimest
    000305           INTO TABLE lt_key
    000306           UP TO lv_del_rows ROWS
    000307           FROM (gv_master)
    000308           WHERE
    000309 *          msgstate   IN rt_msgstate
    000310 *          AND   ( adapt_stat =  cl_xms_persist=>co_stat_adap_processed
    000311 *          OR      adapt_stat =  cl_xms_persist=>co_stat_adap_undefined )
    000312 *          AND     itfaction  =  ls_itfaction
    000313 *          AND     msgtype    =  cl_xms_persist=>co_async
    000314 *          AND
    000315           exetimest  LE lv_timestamp
    000316           AND     exetimest  GE last_ts
    000317           AND     reorg      =  cl_xms_persist=>co_reorg_ini
    000318           ORDER BY mandt itfaction reorg exetimest.
    Can anyone help me how i can improve the performance of this statement?
    Here is the sql trace for the statement:
    SELECT
    /*+
      FIRST_ROWS (100)
      "MANDT" , "MSGGUID" , "PID" , "EXETIMEST"
    FROM
      "SXMSPMAST"
    WHERE
      "MANDT" = :A0 AND "EXETIMEST" <= :A1 AND "EXETIMEST" >= :A2 AND "REORG" = :A3
    ORDER BY
      "MANDT" , "ITFACTION" , "REORG" , "EXETIMEST"
    Execution Plan
    SELECT STATEMENT ( Estimated Costs = 3 , Estimated #Rows = 544 )
            4 SORT ORDER BY
              ( Estim. Costs = 2 , Estim. #Rows = 544 )
              Estim. CPU-Costs = 15.671.852 Estim. IO-Costs = 1
                3 FILTER
                    2 TABLE ACCESS BY INDEX ROWID SXMSPMAST
                      ( Estim. Costs = 1 , Estim. #Rows = 544 )
                      Estim. CPU-Costs = 11.130 Estim. IO-Costs = 1
                        1 INDEX RANGE SCAN SXMSPMAST~TST
                          Search Columns: 2
                          Estim. CPU-Costs = 3.329 Estim. IO-Costs = 0
    Do I need to create any new index ? Do i need to remove the Order By clause?
    Thanks in advance.

    why is there an
    UP TO lv_del_rows ROWS
    together with an ORDER BY?
    The database will find all rows fulfilling the condition but returns only the largest Top lv_del_rows.
    Therefore it can take a while.
    Your index, always put the client field at first position.
    actually I am not really convinced by your logic:
    itfaction reorg exetimest.
    itfaction is the first in the sort order, so all records with the smallest itfactio will come first, but itfaction is not specified, is this really what you want?
    Change the index to mandt reorg exetimest reorg
    and change the ORDER BY to mandt reorg exetimest
    then it will become fast.
    * AND ( adapt_stat = cl_xms_persist=>co_stat_adap_processed
    000311 * OR adapt_stat = cl_xms_persist=>co_stat_adap_undefined )
    000312 * AND itfaction = ls_itfaction
    000313 * AND msgtype = cl_xms_persist=>co_async
    000314 * AND
    000315 exetimest LE lv_timestamp
    000316 AND exetimest GE last_ts
    000317 AND reorg = cl_xms_persist=>co_reorg_ini
    000318 ORDER BY mandt itfaction reorg exetimest.

  • How a select statement generates redo logs

    Can some one explain how a select statement generates redo logs
    Naveen

    Redo with a select statement happens when dirty blocks get written to the database, and are then "cleaned up" when next read of that data block. This could happen when a large DML statement does not commit before the DB Writer needs to write modified blocks to disk. The next time the blocks are read by a select statement they get modified, hence REDO is generated by the select statement.
    Read the following for more and better understandings.
    http://www.dbspecialists.com/specialists/specialist2003-10.htm
    Jaffar

  • Outer Join (select) statement

    hI
    Im BW-Consultant. I have two tables with some fileds.
    ZTABLE1 ---> MATNR, PRCTR, BUKRS, LIGNG, MATGR.And this table has 5-materials
    ZTABLE2 --> MATNR, PRCTR, BUKRS, FKMNG, VERID. And this table has 10-materials.
    These two tables(ZTABLE1, ZTABLE2) has 3-materials are common.
    But i want all 15-materials in an another table ZTABLE3. So how can i write an <b>outer join statement.</b> .
    Please give the OuterJoinCode(select statement) to get all 15-materials
    regards
    kumar

    Example
    SELECT KNA1~KUNNR KNA1~ADRNR ADR6~SMTP_ADDR
    INTO (A, B, C)
    FROM KNA1 LEFT OUTER JOIN ADR6
    ON KNA1~ADRNR = ADR6~ADDRNUMBER
    WHERE KUNNR BETWEEN '0000000000' AND '0000500000'.
    DATA: BEGIN OF wa,
            carrid   TYPE scarr-carrid,
            carrname TYPE scarr-carrname,
            connid   TYPE spfli-connid,
          END OF wa,
          itab LIKE SORTED TABLE OF wa
                    WITH NON-UNIQUE KEY carrid.
    SELECT s~carrid s~carrname p~connid
      INTO CORRESPONDING FIELDS OF TABLE itab
      FROM scarr AS s
           LEFT OUTER JOIN spfli AS p ON s~carrid   =  p~carrid AND
                                         p~cityfrom = 'FRANKFURT'.
    LOOP AT itab INTO wa.
      WRITE: / wa-carrid, wa-carrname, wa-connid.
    ENDLOOP.
    A

  • Please explain on what does these select statements get from these tables..

    Hello Experts,
    What does these select statements get?and what are these tables CDHDR and CDPOS used for?
    The program that I am currently modifying lets users post documents and the ones that are not posted
    are saved in a custom table. Now, we had a scenario in PROD server wherein certain items are not being
    fetched as bypassed but we saved it in the bypassed table. Anyway, below is the select statements:
    get all change document header within the selected dates
      SELECT * INTO CORRESPONDING FIELDS OF TABLE it_cdhdr
        FROM cdhdr
       WHERE udate IN s_udate
         AND objectclas EQ 'CHARGE'
         AND tcode IN (lc_tcode_msc1,
                       lc_tcode_msc2,
                       lc_tcode_msc1n,
                       lc_tcode_msc2n,
                       lv_tcode_vl33n,
                       'SE38',
                       'ZGENE').
    IF NOT it_cdhdr[] IS INITIAL.
    SELECT objectid changenr value_new
          FROM cdpos
          INTO TABLE it_cdpos
          FOR ALL ENTRIES IN it_cdhdr
         WHERE objectclas EQ it_cdhdr-objectclas
           AND objectid   = it_cdhdr-objectid
           AND changenr   = it_cdhdr-changenr
           AND tabname    = lc_tabname_mcha
           AND fname     IN (lc_fname_zustd,'LWEDT').
    DELETE it_cdpos WHERE value_new+00(01) = 'X'.
      LOOP AT it_cdpos ASSIGNING <fs_cdpos>.
        l_matnr = <fs_cdpos>-objectid+00(18).
        l_charg = <fs_cdpos>-objectid+22(10).
        l_zustd = <fs_cdpos>-value_new+00(01).
        READ TABLE it_batch INTO wa_batch
             WITH KEY matnr = l_matnr
                      charg = l_charg.
        IF sy-subrc EQ 0.
          l_tabix = sy-tabix.
          wa_batch-zustd = l_zustd.
          MODIFY it_batch FROM wa_batch INDEX l_tabix
                 TRANSPORTING zustd.
        ELSE.
          wa_batch-matnr = l_matnr.
          wa_batch-charg = l_charg.
          wa_batch-zustd = l_zustd.
          wa_batch-code  = 'A'.              "selected within period
          APPEND wa_batch TO it_batch.
        ENDIF.
      ENDLOOP.
      ENDIF.

    Hi,
                            The first select statement is for Change document header.CDHDR table contains this object class in your case if you change any batch number for any material number  from the transaction for example (MB01) you can trace this .
    From CDPOS you can trace which tables affected (EX : MCHA) and the new value(l_zustd ).
    Regds,
    Vinsa.R

  • Getting a dumb after writing a SELECT statement at TABLE level of SMART

    hi all,
    i have created a RATE COMPARISON REPORT.In that Report i have to display Rate Price against  RFQ No.For this purpose i have write a code at SMART FORMS in TABLE.Following are the code:
    SELECT SINGLE netpr
      INTO it_detail
      FROM ekpo
      INNER JOIN ekko ON
      ekko~ebeln = ekpo~ebeln
      WHERE ekko~BSTYP EQ 'F'
      AND   ekko~spras eq 'E'
    AND   ekpo~ebeln eq IT_DETAIL-EBELN
    This code is assign with TEXT FILED  at TABLE level.when i execute it i get the following dump.
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CXSY_OPEN_SQL_DB', was not caught in procedure "%CO2" "(FORM)"_,
    nor was it propagated by a RAISING clause.Since the caller of the procedure could not have anticipated that the exception would occur, the current program is terminated.
    The reason for the exception is:
    In a SELECT access, the read file could not be placed in the target field provided. Either the conversion is not supported for   the type of the target field, the target field is too small to include the value, or the data does not have the format required for the target field.
    could any body tell me what is problem in my SELECT query statement after executing giving me a dump.
    Thanks,
    sappk25

    Hi
    The select query is wrong, as you should not move the single field into a table (it_detail)....
    Change the query as follows...
    data: v_netwr type netwr.
    SELECT SINGLE netpr
      INTO v_netwr
      FROM ekpo
      INNER JOIN ekko ON
      ekkoebeln = ekpoebeln
      WHERE ekko~BSTYP EQ 'F'
      AND   ekko~spras eq 'E'
    AND   ekpo~ebeln eq IT_DETAIL-EBEL
    if sy-subrc eq 0.
      move v_netwr to it_detail.
    endif.
    Hope this helps....

  • Explain plan: "Select statement"

    Hi,
    I'm using the explain plan command to retrieve information about query execution. In particular I want to estimate query execution time.
    Let's consider the following example:
    "| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |"
    "| 0 | SELECT STATEMENT | | 4775 | 484K| 98886 (1)| 00:19:47 |"
    "| 1 | HASH GROUP BY | | 4775 | 484K| 98886 (1)| 00:19:47 |"
    "|* 2 | MAT_VIEW ACCESS FULL| Materialized_view1 | 4775 | 484K| 98884 (1)| 00:19:47 |"
    In the calculation of total execution time should i consider the "select statement" operation?
    The total execution time can be calculated like this: Time(Select statement) + Time(hash group by) + Time(access full)=19.47*3=58.41. Is it right?
    Thanks

    No, the expected time is 00:19:47. No time is expected to be spent in steps 0 and 1.

  • Within Music Library can anyone please explain why when I select the option to sort 'Album by Artist' a number of tracks are being treated as separate albums?  How can I correct this?  I have tried to 'drag and drop' but that doesn't work.

    Within music Library can anyone please explain why after I select the option to sort 'Album by Artist' a number of tracks are being treated as separate albums?  How can I fix this?  I have tried to manually correct by 'drag and drop' individual tracks but that doesn't work.  My music library includes a number of repeat album artwork images simply because not all tracks are being listed under the one album making my library more difficult to use than it should.  Any advise would be appreciated.

    See Grouping tracks into albums.
    tt2

  • Select Statement -- Where Clause Execution Order

    What is the order of execution of the "AND" and "OR" in the WHERE clause of a Select statement?
    Are the "AND"'s executed from the top down, left to right? Is it the same for the "OR"'s execution?
    Thanks for any help...

    Not clear why you care. There is an order in which the optimizer parses the SQL (which may change from ver to ver), but this is a fairly quick operation. The order in which tables are visited and predicates evaluated is dependent on what the op[timizer does with the SQL.
    Ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for