Help performance tune insert as select of lobs

I am using Oracle 11.2.0.3 Enterprise edition.
I am looking at means to improve following insert. Any suggestion would be highly appreciated.
Below is tkprof report. tab1 is created as nologging. The insert is geting blob(book_file) over a db link. Lob column is also declared nocache nologging.
Also please help me understand the tkprof report. As per the report elasped time - cpu time = 12.31 -2.90 = 9.41. However, sum of wait evens is well over 9.41s.
Thanks for you time.
INSERT /*+ APPEND */ INTO tab1
     SELECT   B.book_file_ID,
         bv.file_NB,
         bv.archvd_fl,
         bv.flng_pk,
         bv.book_id,
         bv.x_insrt_dtm,
         bv.x_updt_dtm,
         BV.book_FILE
  FROM   tab1_MV B, tab1@db_link1 BV
WHERE   B.book_file_ID = BV.book_file_ID
         AND NOT EXISTS (SELECT   1
                           FROM   tab1 i
                          WHERE   I.book_file_ID = B.book_file_ID)
call     count       cpu    elapsed       disk      query    current        rows
Parse        1      0.02       0.68          0          7          1           0
Execute      1      2.88      11.63       1342      82297      49123          99
Fetch        0      0.00       0.00          0          0          0           0
total        2      2.90      12.31       1342      82304      49124          99
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 49 
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max)  Row Source Operation
         0          0          0  LOAD AS SELECT  (cr=82297 pr=1342 pw=2381 time=11632815 us)
        99         99         99   FILTER  (cr=60811 pr=86 pw=0 time=24355 us)
     60240      60240      60240    MERGE JOIN  (cr=50 pr=0 pw=0 time=582671 us cost=325 size=10963680 card=60240)
    102207     102207     102207     REMOTE  tab1 (cr=0 pr=0 pw=0 time=477887 us cost=186 size=18079665 card=102145)
     60240      60240      60240     SORT JOIN (cr=50 pr=0 pw=0 time=72327 us cost=139 size=301200 card=60240)
     60240      60240      60240      MAT_VIEW ACCESS FULL tab1_MV (cr=50 pr=0 pw=0 time=7201 us cost=21 size=301200 card=60240)
     60141      60141      60141    INDEX UNIQUE SCAN PKCBV_book_file_ID (cr=60761 pr=86 pw=0 time=495753 us cost=1 size=5 card=1)(object id 1634074)
Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  single-task message                             1        0.05          0.05
  SQL*Net message from dblink                   181        0.07          0.49
  SQL*Net message to dblink                     179        0.00          0.00
  SQL*Net more data from dblink                6878        0.01          0.19
  db file sequential read                      1342        0.03          1.57
  log file sync                                   1        0.02          0.02
  Disk file operations I/O                        9        0.00          0.00
  direct path write                            1790        0.01          0.19
  direct path sync                                5        0.01          0.05
  control file sequential read                 7337        0.00          0.07
  control file parallel write                  4888        0.01          7.48
  asynch descriptor resize                     1492        0.00          0.00
  enq: CF - contention                            1        0.01          0.01
  SQL*Net message to client                       1        0.00          0.00
  SQL*Net message from client                     1        6.86          6.86
SQL ID: gb9krpvpav4p5 Plan Hash: 0

spur230 wrote:
Tubby wrote:
Since the table with the blob you need is on a remote database you may be best served by processing the query on the remote site instead of the local one.
http://jonathanlewis.wordpress.com/2010/10/07/distributed-pipelines/
Would be something i'd look in to implementing for this.
Cheers,Thanks Tubby.
I did read about this option . However, I found driving_site hint is not applicable for DML operations.
http://jonathanlewis.wordpress.com/2008/12/05/distributed-dml/
A distributed DML statement must execute on the database where the DML target resides. The DRIVING_SITE hint cannot override this.
True, unless you slap it inside a pipelined function as demonstrated in the link i sent (which actually links to the link you are quoting from) :)
One other thing, i didn't understand the purpose of joining to tab1_MV B in your query. Just another existence test?
Cheers,

Similar Messages

  • Need help for performance tunning

    Hello,
    I have 16K records return by query, it takes long time to proceed for 7K it takes 7.5 sec.
    Note: I used all seeded tables only.
    If possible please help me to tune it.
    SELECT       msi.inventory_item_id,msi.segment1,msi.rimary_uom_code , msi.primary_unit_of_measure
    FROM  mtl_system_items_b msi, qp_list_lines qpll,qp_pricing_attributes qppr,
              mtl_category_sets_tl mcs,mtl_category_sets_b mcsb,
              mtl_categories_b mc, mtl_item_categories mcb
    WHERE     msi.enabled_flag = 'Y'
         AND qpll.list_line_id = qppr.list_line_id
         AND qppr.product_attr_value = TO_CHAR (msi.inventory_item_id(+))
         AND qppr.product_uom_code = msi.primary_uom_code
         AND mc.category_id = mcb.category_id
         AND msi.inventory_item_id = mcb.inventory_item_id
         AND msi.organization_id = mcb.organization_id
         AND TRUNC (SYSDATE) BETWEEN NVL (qpll.start_date_active,TRUNC (SYSDATE)) AND NVL (qpll.end_date_active,TRUNC (SYSDATE))
         AND mcs.category_set_name = 'LSS SALES CATEGORY'
         AND mcs.language = 'US'
         AND mcs.category_set_id = mcsb.category_set_id
         AND mcsb.structure_id = mc.structure_id
         AND msi.organization_id = :p_organization_id
         AND qpll.list_header_id = :p_price_list_id
         AND mcb.category_id = :p_category_id;
    Thanks and regards
    Akil.

    Thanks Helios ,
    here is answers
    Databse version
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit  
    PL/SQL Release 11.1.0.7.0
    explain plan
    | Id  | Operation                       | Name                     | Rows  | Bytes | Cost (%CPU)|

    0 | SELECT STATEMENT              
    |                          |   
    1 |   149 |  9439 
    (1)|

    1 |  NESTED LOOPS                   |                          |     1 | 
    149 |  9439   (1)|
    |*
    2 |   HASH JOIN OUTER               |                          |     1 | 
    135 |  9437   (1)|
    |*
    3 |    HASH JOIN                    |                          |     1 |  
    71 |  9432   (1)|

    4 |     NESTED LOOPS                |                          |     2 |  
    76 |    53   (0)|
    |*
    5 |      TABLE ACCESS BY INDEX
    ROWID| QP_LIST_LINES            |     2 |  
    44 |    49   (0)|
    |*
    6 |       INDEX SKIP SCAN           | QP_LIST_LINES_N2         | 
    702 |       |    20 
    (0)|
    |*
    7 |      INDEX RANGE SCAN           | QP_PRICING_ATTRIBUTES_N3 |     1 |  
    16 |     2   (0)|
    |*
    8 |     TABLE ACCESS BY INDEX
    ROWID | MTL_SYSTEM_ITEMS_B       | 46254
    |  1490K|
    9378   (1)|
    |*
    9 |      INDEX RANGE SCAN           | MTL_SYSTEM_ITEMS_B_N9    | 46254 |       | 
    174   (1)|
    |
    10 |    TABLE ACCESS FULL            | XX_WEB_ITEM_IMAGE_TBL    | 
    277 | 17728 |     5   (0)|
    |* 11 |   INDEX RANGE SCAN              | MTL_ITEM_CATEGORIES_U1   |   
    1 |    14 |     2 
    (0)|
    Predicate Information (identified
    by operation id):
    2 -
    access("XWIIT"."IMAGE_CODE"(+)="MSI"."SEGMENT1")
    3 -
    access("QPPR"."PRODUCT_ATTR_VALUE"=TO_CHAR("MSI"."INVENTORY_ITEM_ID")
    AND
    "QPPR"."PRODUCT_UOM_CODE"="MSI"."PRIMARY_UOM_CODE")
    5 - filter(NVL("QPLL"."START_DATE_ACTIVE",TRUNC(SYSDATE@!))<=TRUNC(SYSDATE@!)
    AND
    NVL("QPLL"."END_DATE_ACTIVE",TRUNC(SYSDATE@!))>=TRUNC(SYSDATE@!))
    6 -
    access("QPLL"."LIST_HEADER_ID"=TO_NUMBER(:P_PRICE_LIST_ID))
    filter("QPLL"."LIST_HEADER_ID"=TO_NUMBER(:P_PRICE_LIST_ID))
    7 -
    access("QPLL"."LIST_LINE_ID"="QPPR"."LIST_LINE_ID")
    filter("QPPR"."PRODUCT_UOM_CODE" IS NOT NULL)
    8 - filter("MSI"."ENABLED_FLAG"='Y')
    9 - access("MSI"."ORGANIZATION_ID"=TO_NUMBER(:P_ORGANIZATION_ID))
    11 -
    access("MCB"."ORGANIZATION_ID"=TO_NUMBER(:P_ORGANIZATION_ID)
    AND
    "MSI"."INVENTORY_ITEM_ID"="MCB"."INVENTORY_ITEM_ID"
    AND
    "MCB"."CATEGORY_ID"=TO_NUMBER(:P_CATEGORY_ID))
           filter("MCB"."CATEGORY_ID"=TO_NUMBER(:P_CATEGORY_ID))
    Note
    - 'PLAN_TABLE' is old version
    TKprof Plan
    TKPROF: Release 11.1.0.7.0 - Production on Fri Nov 15 06:12:26 2013
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: LSSD_ora_19760.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    SELECT msi.inventory_item_id,
           msi.segment1,
           primary_uom_code,
           primary_unit_of_measure,
           xwiit.image_url
      FROM mtl_system_items_b msi,
           qp_list_lines qpll,
           qp_pricing_attributes qppr,
           mtl_item_categories mcb,
           xx_web_item_image_tbl xwiit
    WHERE     msi.enabled_flag = 'Y'
           AND qpll.list_line_id = qppr.list_line_id
           AND qppr.product_attr_value = TO_CHAR (msi.inventory_item_id)
           AND qppr.product_uom_code = msi.primary_uom_code
           AND msi.inventory_item_id = mcb.inventory_item_id
           AND msi.organization_id = mcb.organization_id
           AND TRUNC (SYSDATE) BETWEEN NVL (qpll.start_date_active,
                                            TRUNC (SYSDATE))
                                   AND NVL (qpll.end_date_active,
                                            TRUNC (SYSDATE))
           AND xwiit.image_code(+) = msi.segment1
           AND msi.organization_id = :p_organization_id
           AND qpll.list_header_id = :p_price_list_id
           AND mcb.category_id = :p_category_id
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        2      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.00          0          0          0           0
    Fetch        2      3.84       3.85          0     432560          0        1002
    total        6      3.84       3.85          0     432560          0        1002
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 173 
    Rows     Row Source Operation
        501  NESTED LOOPS  (cr=216280 pr=0 pw=0 time=115 us cost=9439 size=149 card=1)
       2616   HASH JOIN OUTER (cr=211012 pr=0 pw=0 time=39 us cost=9437 size=135 card=1)
      78568    HASH JOIN  (cr=210997 pr=0 pw=0 time=3786 us cost=9432 size=71 card=1)
      78571     NESTED LOOPS  (cr=29229 pr=0 pw=0 time=35533 us cost=53 size=76 card=2)
      78571      TABLE ACCESS BY INDEX ROWID QP_LIST_LINES (cr=9943 pr=0 pw=0 time=27533 us cost=49 size=44 card=2)
    226733       INDEX SKIP SCAN QP_LIST_LINES_N2 (cr=865 pr=0 pw=0 time=4122 us cost=20 size=0 card=702)(object id 99730)
      78571      INDEX RANGE SCAN QP_PRICING_ATTRIBUTES_N3 (cr=19286 pr=0 pw=0 time=0 us cost=2 size=16 card=1)(object id 99733)
    128857     TABLE ACCESS BY INDEX ROWID MTL_SYSTEM_ITEMS_B (cr=181768 pr=0 pw=0 time=9580 us cost=9378 size=1526382 card=46254)
    128857      INDEX RANGE SCAN MTL_SYSTEM_ITEMS_B_N9 (cr=450 pr=0 pw=0 time=1657 us cost=174 size=0 card=46254)(object id 199728)
        277    TABLE ACCESS FULL XX_WEB_ITEM_IMAGE_TBL (cr=15 pr=0 pw=0 time=22 us cost=5 size=17728 card=277)
        501   INDEX RANGE SCAN MTL_ITEM_CATEGORIES_U1 (cr=5268 pr=0 pw=0 time=0 us cost=2 size=14 card=1)(object id 99557)
    Note: I modified query and it gives good result, now it takes 3 to 4 sec for 16000 records.
    If possible can you plz explain what we have to take care while doing performance tunning
    I am a fresher so don't have that much idea.
    and also Thanks Hussein for your replay

  • Urgent : Performance Issue DELETE , INSERT INTO SELECT, UPDATE

    Hi,
    NEED ASSISTANCE TO OPTIMIZE THE INSERT STATEMENT (insert into select):
    =================================================
    We have a report.
    As per current design following steps are used to populate the custom table whcih is used for reporting purpose:
    1) DELETE all the recods from the custom table XXX_TEMP_REP.
    2) INSERT records in custom table XXX_TEMP_REP (Assume all the records related to type A)
    using
    INSERT..... INTO..... SELECT.....
    statement.
    3) Update records in XXX_TEMP_REP
    using some custom logic for the records populated .
    4) INSERT records in custom table XXX_TEMP_REP (Records related to type B)
    using
    INSERT..... INTO..... SELECT.....
    statement.
    Stats gathered related to Insert statement are:
    Event Wait Information
    SID 460 is waiting on event : db file sequential read
    P1 Text : file#
    P1 Value : 20
    P2 Text : block#
    P2 Value : 435039
    P3 Text : blocks
    P3 Value : 1
    Session Statistics
    redo size : 293.84 M
    parse count (hard) : 34
    parse count (total) : 1217
    user commits : 3
    Transaction and Rollback Information
    Rollback Used : 35.1796875 M
    Rollback Records : 355886
    Rollback Segment Number : 12
    Rollback Segment Name : _SYSSMU12$
    Logical IOs : 1627182
    Physical IOs : 136409
    RBS Startng Extent ID : 14
    Transaction Start Time : 09/29/10 04:22:11
    Transaction_Status : ACTIVE
    Please suggest how this can be optimized.
    Regards,
    Narender

    Hello,
    Is there any relation with the Oracle Forms tool ?
    Francois

  • Commit for every 1000 records in  Insert into select statment

    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
       from emp e , dept d
      where e.deptno = d.deptno       ------ how to use commit for every 1000 records .Thanks

    Smile wrote:
    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.Does the another table already have records or its empty?
    If its empty then you can drop it and create it as
    create your_another_table
    as
    <your select statement that return 60000000 records>
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .That is not the best way. Frequent commit may lead to ORA-1555 error
    [url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:275215756923]A nice artical from ASKTOM on this one
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
    from emp e , dept d
    where e.deptno = d.deptno       ------ how to use commit for every 1000 records .
    It depends on the reason behind you wanting to split your transaction into small chunks. Most of the time there is no good reason for that.
    If you are tying to imporve performance by doing so then you are wrong it will only degrade the performance.
    To improve the performance you can use APPEND hint in insert, you can try PARALLEL DML and If you are in 11g and above you can use [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_parallel_ex.htm#CHDIJACH]DBMS_PARALLEL_EXECUTE to break your insert into chunks and run it in parallel.
    So if you can tell the actual objective we could offer some help.

  • How to improve performance of insert statement

    Hi all,
    How to improve performance of insert statement
    I am inserting 1lac records into table it takes around 20 min..
    Plz help.
    Thanx In Advance.

    I tried :
    SQL> create table test as select * from dba_objects;
    Table created.
    SQL> delete from test;
    3635 rows deleted.
    SQL> commit;
    Commit complete.
    SQL> select count(*) from dba_extents where segment_name='TEST';
    COUNT(*)
    4
    SQL> insert /*+ APPEND */ into test select * from dba_objects;
    3635 rows created.
    SQL> commit;
    Commit complete.
    SQL> select count(*) from dba_extents where segment_name='TEST';
    COUNT(*)
    6
    Cheers, Bhupinder

  • How to do performance tunning

    Hi,
    Can any one help me how to do performance tunning.I was given two scripts which contains more UNION clauses.

    Hi,
    What version of Oracle are you on? If you have Oracle 22S (the S is for "Sentient"), there's one way:
    SCOTT@ORA22S> set autotrace traceonly explain
    SCOTT@ORA22S> ed
    Wrote file afiedt.buf
      1  select *
      2  from test
      3* where test_date > date '2001-01-01'
    SCOTT@ORA22S> /
    Execution Plan
    0    SELECT STATEMENT Optimizer=ALL_ROWS (Cost=40656 Card=1071132 Bytes=163883196)
    1  0   TABLE ACCESS (BY INDEX ROWID) OF 'TEST' (TABLE) (Cost=40656 Card=1071132 Bytes=163883196)
    2  1     INDEX (FULL SCAN) OF 'TST_CUSTOM_03' (INDEX) (Cost=6785 Card=1071132)
    SCOTT@ORA22S> alter session set sql_go_fast = true;
    Session altered.
    SCOTT@ORA22S> /
    Execution Plan
    0    SELECT STATEMENT Optimizer=ALL_ROWS (Cost=9979 Card=1071132 Bytes=163883196)
    1  0   TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=9979 Card=1071132 Bytes=163883196)Unfortunately Oracle 22S may not be available for a while. Until then you may have to listen to Billy ;-)
    cheers,
    Anthony

  • Help with last insert id

    i have create 2 preparedstatement and it is like this,
    PreparedStatement pstmt = con.prepareStatement("insert into placemark(userid, date, time,longtitude,latitude) values(?,?,?,?, ?) ");
    after that i have pstmt.executedUpdate()
    and i have created another preparedStatement for the last_insert_id
    PreparedStatement pstmt1 = con.prepareStatement("SELECT LAST_INSERT_ID(placemarkid)");
    can anybody tell me is my syntext for the last insert id correct?

    hmm, allow me to explain my logic to all of you again. This is my first time using last_insert_id and have no idea how to implement. But i have found out it is performed an insert query into a table that contains an AUTO_INCREMENT field. And my placemarkid is a primary key which is auto_increment.
    Here is my code
    public boolean add(Placemark pm){
            boolean result = false;
            try {
                PreparedStatement pstmt = con.prepareStatement("insert into placemark(placemarkid, userid, date, time,longtitude,latitude) values(?,?,?,?,?,?)");
                pstmt.setInt(1, pm.getPlacemarkid());
                pstmt.setInt(2, pm.getUserid());
                pstmt.setDate(3, pm.getDate());
                pstmt.setTime(4, pm.getTime());
                pstmt.setDouble(5, pm.getLongtitude());
                pstmt.setDouble(6, pm.getLatitude());
                int num = pstmt.executeUpdate();
                if(num==1)
                    result = true;
                //  PreparedStatement pstmt1 = con.prepareStatement("SELECT LAST_INSERT_ID FROM placemark WHERE placemarkid = ?");
                //pstmt1.setInt(1, pm.getPlacemarkid());
                // ResultSet rs = pstmt1.executeQuery();
                pstmt.close();
                // pstmt1.close();
            } catch(SQLException e){
                e.printStackTrace();
                result = false;
            return result;
        }ok, i need to query out the last insert id and set it into the placemark object using the "setPlacemarkId" method.Also, the sql statement to get the last inserted id is "SELECT LAST_INSERT_ID()".Can anyone please help me of the last_insert_id. I;m quite confused to the previous post that u all have send me as this is my first time using.

  • HELP TO TUNE THIS QUERY

    Hi,
    I'm using below query in procedure.It's taking more more time can some one help to tune this query or advice to rewrite the query.
    Databse :10.1
    SELECT   'Reading Comprehension' TEST_NAME,T.TEST_END_DATE TEST_SESSION_DATE,
            C.POOL_VERSION_ID, I.CREATED_ON POOL_CREATED_DT,
            C.ITEM_ID, C.ITEM_RESPONSE_ID, S.STUDENT_ID_PK, C.RESPONSE_KEY, C.IS_CORRECT RESPONSE_IS_CORRECT,
            T.SCORE SCALE_SCORE, C.RESPONSE_DURATION, P.ITEM_KEY,
            T.TEST_SESSION_DETAIL_ID, SYSDATE CREATED_ON
           -- BULK COLLECT INTO TV_PSYCHO_DET
            FROM
            CAT_ITEM_PARAMETER P, CAT_ITEM_USER_RESPONSE C, TEST_SESSION_DETAIL T,
            TEST_SESSION S, ITEM_POOL_VERSION I, TEST_DETAIL D
            ,INSTITUTION E
            WHERE  TRUNC(T.TEST_END_DATE) BETWEEN TO_DATE('01-11-09','dd-mm-yy') AND TO_DATE('30-11-09','dd-mm-yy')
            AND D.TEST_NAME =  'Reading Comprehension'
            AND T.TEST_SESSION_STATUS_ID = 3
            AND I.POOL_AVAILABILITY='Y'
            AND P.PRETEST=0 AND C.RESTART_FLAG=0
            AND T.TEST_DETAIL_ID = D.TEST_DETAIL_ID
            AND S.TEST_SESSION_ID = T.TEST_SESSION_ID
            AND C.TEST_SESSION_DETAIL_ID = T.TEST_SESSION_DETAIL_ID
            AND S.INSTITUTION_ID=E.INSTITUTION_ID
            AND SUBSTR(E.INSTITUTION_ID_DISPLAY,8,3) <> '000'
            AND I.ITEM_ID = C.ITEM_ID
            AND P.ITEM_ID = I.ITEM_ID;expln plan
    Plan hash value: 3712814491                                                                                                      
    | Id  | Operation                                 | Name                        | Rows  | Bytes | Cost (%CPU)| Time     | Pstart|
    Pstop |                                                                                                                          
    |   0 | SELECT STATEMENT                          |                             | 50857 |  7151K| 93382   (1)| 00:18:41 |       |
          |                                                                                                                          
    |*  1 |  FILTER                                   |                             |       |       |            |          |       |
          |                                                                                                                          
    |*  2 |   HASH JOIN                               |                             | 50857 |  7151K| 93382   (1)| 00:18:41 |       |
          |                                                                                                                          
    |   3 |    PARTITION HASH ALL                     |                             |  2312 | 23120 |    25   (0)| 00:00:01 |     1 |
        5 |                                                                                                                          
    |*  4 |     TABLE ACCESS FULL                     | CAT_ITEM_PARAMETER          |  2312 | 23120 |    25   (0)| 00:00:01 |     1 |
        5 |                                                                                                                          
    |*  5 |    HASH JOIN                              |                             | 94938 |    12M| 93356   (1)| 00:18:41 |       |
          |                                                                                                                          
    |*  6 |     TABLE ACCESS FULL                     | ITEM_POOL_VERSION           |  9036 |   132K|    30   (0)| 00:00:01 |       |
          |                                                                                                                          
    |*  7 |     TABLE ACCESS BY GLOBAL INDEX ROWID    | CAT_ITEM_USER_RESPONSE      |     9 |   279 |    18   (0)| 00:00:01 | ROWID |
    ROWID |                                                                                                                          
    |   8 |      NESTED LOOPS                         |                             | 45349 |  5270K| 93325   (1)| 00:18:40 |       |
          |                                                                                                                          
    |*  9 |       HASH JOIN                           |                             |  4923 |   423K| 11377   (1)| 00:02:17 |       |
          |                                                                                                                          
    |* 10 |        INDEX FAST FULL SCAN               | INSTI_ID_NAME_COUN_DISP_IDX |  8165 |   111K|    18   (0)| 00:00:01 |       |
          |                                                                                                                          
    |* 11 |        HASH JOIN                          |                             |  4923 |   355K| 11359   (1)| 00:02:17 |       |
          |                                                                                                                          
    |* 12 |         TABLE ACCESS BY GLOBAL INDEX ROWID| TEST_SESSION_DETAIL         |  4107 |   148K|  6804   (1)| 00:01:22 | ROWID |
    ROWID |                                                                                                                          
    |  13 |          NESTED LOOPS                     |                             |  4923 |   278K|  6806   (1)| 00:01:22 |       |
          |                                                                                                                          
    |* 14 |           INDEX RANGE SCAN                | TEST_DETAIL_AK_1            |     1 |    21 |     2   (0)| 00:00:01 |       |
          |                                                                                                                          
    |* 15 |           INDEX RANGE SCAN                | TEST_SESSION_DETAIL_FK2_I   | 39737 |       |   102   (0)| 00:00:02 |       |
          |                                                                                                                          
    |  16 |         PARTITION HASH ALL                |                             |  1672K|    25M|  4546   (1)| 00:00:55 |     1 |
        5 |                                                                                                                          
    |  17 |          TABLE ACCESS FULL                | TEST_SESSION                |  1672K|    25M|  4546   (1)| 00:00:55 |     1 |
        5 |                                                                                                                          
    |* 18 |       INDEX RANGE SCAN                    | CAT_ITEM_USER_RESP_IDX1     |    18 |       |     3   (0)| 00:00:01 |       |
          |                                                                                                                          
    Predicate Information (identified by operation id):                                                                              
       1 - filter(TO_DATE('01-11-09','dd-mm-yy')<=TO_DATE('30-11-09','dd-mm-yy'))                                                    
       2 - access("P"."ITEM_ID"="I"."ITEM_ID")                                                                                       
       4 - filter("P"."PRETEST"=0)                                                                                                   
       5 - access("I"."ITEM_ID"="C"."ITEM_ID")                                                                                       
       6 - filter("I"."POOL_AVAILABILITY"='Y')                                                                                       
       7 - filter(TO_NUMBER("C"."RESTART_FLAG")=0)                                                                                   
       9 - access("S"."INSTITUTION_ID"="E"."INSTITUTION_ID")                                                                         
      10 - filter(SUBSTR("E"."INSTITUTION_ID_DISPLAY",8,3)<>'000')                                                                   
      11 - access("S"."TEST_SESSION_ID"="T"."TEST_SESSION_ID")                                                                       
      12 - filter(TRUNC(INTERNAL_FUNCTION("T"."TEST_END_DATE"))>=TO_DATE('01-11-09','dd-mm-yy') AND "T"."TEST_SESSION_STATUS_ID"=3   
                  AND TRUNC(INTERNAL_FUNCTION("T"."TEST_END_DATE"))<=TO_DATE('30-11-09','dd-mm-yy'))                                 
      14 - access("D"."TEST_NAME"='Reading Comprehension')                                                                           
      15 - access("T"."TEST_DETAIL_ID"="D"."TEST_DETAIL_ID")                                                                         
      18 - access("C"."TEST_SESSION_DETAIL_ID"="T"."TEST_SESSION_DETAIL_ID")                                                         
    43 rows selected.Edited by: user575115 on Dec 18, 2009 12:31 AM

    When you see something like ...
       7 - filter(TO_NUMBER("C"."RESTART_FLAG")=0)                                                                                    It means that Oracle had to do a conversion for you since you aren't using the proper data type in your query.
    That would mean IF there is an index on that column, it won't be useable...

  • Report Variable F4 help performance issue

    Hi,
    I have a BI report on DSO >> Multiprovider.
    When i choose F4 Variable help it takes around 2-3 minutes to display the data for selection.
    Currently XXXX chars is with -- Only Posted Values for Navigation. I have tried the below options but could not see any improvement in variable f4 help performance.
    -- Only Values in Infoprovider
    -- Values In Master Data table
    Could someone please suggest if you have faced the similar issue.
    Thanks
    Ashok

    Hello Ashok,
    Ideally you should never built a report based on a DSO, this is because it stores data at a line item level. The way the filter works is that looks at all records (SIDs) lying in the range of selection in the info provider and then displays the filter pane after it populates the records.
    There can only be 1 check in this case, is to check if your DB statistics are up-to-date. The DB statistics decide if an index is to be used or not. So check for the DSO active table and all related SID tables in transaction DB20. Check the date of creation of the statistics, if it's too much in the past, then the DB does not effectively use the indices and hence it takes time.
    You can use program RSANAORA to recompute the statistics.
    Regards,
    Ansel D'Souza

  • How to Handle the exception while perform multiple insert in a procedure?

    CREATE OR REPLACE PROCEDURE MUL_INS_EXCE AS
    CURSOR C IS SELECT EMP_NO,EMP_NAME,EMP_AGE FROM EMP;
    EMP_RECORD EMP %ROWTYPE;
    BEGIN
    OPEN C;
    LOOP
    FETCH C INTO EMP_RECORD;
    EXIT WHEN C%NOTFOUND;
    INSERT INTO (SELECT NO,NAME,AGE FROM E1 WHERE AGE >=23 WITH CHECK OPTION VALUE(EMP_RECORD.EMP_NO,EMP_RECORD.EMP_NAME,EMP_RECORD.EMP_AGE);
    END LOOP;
    CLOSE C;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END;
    I try to insert the record from emp into e1 table with some condition using the procedure. If run this procedure it insert record with check the age > =23. The conditions is not satisfied, exception is thrown procedure will terminate. Again i run this procedure, it will insert the from first. but i want, insert rest of the records. pls help me.

    >
    CHange your insert code like below....it should work
    If emp_record.age > 23 Then
    Insert into table name (fileld......) values(values)...............
    End If;;
    >
    CREATE OR REPLACE PROCEDURE MUL_INS_EXCE AS
    CURSOR C IS SELECT EMP_NO,EMP_NAME,EMP_AGE FROM EMP;
    EMP_RECORD EMP %ROWTYPE;
    BEGIN
    OPEN C;
    LOOP
    FETCH C INTO EMP_RECORD;
    EXIT WHEN C%NOTFOUND;
    INSERT INTO (SELECT NO,NAME,AGE FROM E1 WHERE AGE >=23 WITH CHECK OPTION VALUE(EMP_RECORD.EMP_NO,EMP_RECORD.EMP_NAME,EMP_RECORD.EMP_AGE);
    END LOOP;
    CLOSE C;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END;
    I try to insert the record from emp into e1 table with some condition using the procedure. If run this procedure it insert record with check the age > =23. The conditions is not satisfied, exception is thrown procedure will terminate. Again i run this procedure, it will insert the from first. but i want, insert rest of the records. pls help me.

  • Performance tunning in oracle

    Hi friends,
    I am himansu, i am facing a problem during performance tunning of query in oracle , please guide me how to tune a query which will give better performance.

    907977 wrote:
    Hi friends,
    I am himansu, i am facing a problem during performance tunning of query in oracle , please guide me how to tune a query which will give better performance.Welcome to OTN
    Please post your thread at SQL, PL/SQL. PL/SQL
    and provide your sql query.
    Hope this will help you.

  • Unknown steps in performance tunning

    Hi,
    I am in middle of performance tunning in BI 7.0, as i am going to do the following steps-i am unclear in some steps;
    expert advice is needed. post ur ans as soon as possible.
    When loading transaction data, following this procedure:
    known - Load all master data.
    known - Delete the indices of the InfoCube and its aggregates.
    Unknown - Turn on number range buffering.
    Unknown - Set an appropriate data packet size.
    known - Load the transaction data.
    known - Re-create the indices.
    Unknown - Turn off number range buffering.
    known - Refresh the statistics.
    regards,
    Suman

    Hi Suman,
    check these on number range buffering
    http://help.sap.com/saphelp_nw04/helpdata/en/7b/6eb2aa7aed44ea92ebb969e03081fb/frameset.htm
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0a6e3ff-f000-2d10-b59d-8ef35e248f83?quicklink=index&overridelayout=true

  • Tools in Performance Tunning

    What are the tools in performance Tunning in ABAP/4
    Thanks  Regards,
    Kumar

    Hi kumar,
    Tools provided for Performance Analysis
    Following are the different tools provided by SAP for performance analysis of an ABAP object
    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 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.
    how to perform sql trace:
    Poorly written SQL statements have the greatest impact on application performance. An SQL
    statement using which an Oracle database system reads and/or sorts thousands or even millions of
    rows of data can bring the database to a standstill. Indexes should be used properly to prevent such
    situations from occurring. To analyze such problems you should use the SQL Trace (TCode ST05) to
    with database access operations.
    CAUTION
    Only one person can perform an SQL trace at a time. Remember to turn off the
    trace when you are finished. SQL trace slows the system down.
    1. Using SQL Trace
    1. Open a program that you want to analyze, in the editor, so that it is ready and waiting to be
    executed.
    2. Open a new session using the menu path System   Create session.
    3. Run transaction ST05 (enter /nst05-zero-five, not oh-five in the Command field, or choose
    the menu path System  Utilities  Performance Trace).
    4. Then the initial screen of the test tool appears.
    The status of the Performance Trace is displayed in the lower part of the screen. This status tells you
    three things namely
      Whether any of the Performance Traces are switched on
      The users for whom Performance Trace is enabled
      The user that switched the Performance Trace on
    If the trace is switched on you must switch it off before you can proceed. There are two cases in
    which the trace needs to be switched off. They are
      If the trace was started within the past hour, it is possible that it is still being used. Contact the
    indicated user or try again later
      If the trace was started hours or days ago, the user probably left it on by mistake and it can be
    safely turned off
    To turn off the trace, press the Trace Off pushbutton.
    5. The initial screen has various trace functions such as SQL Trace, Enqueue Trace, RFC
    Trace
    6. Select SQL Trace.
    7. There are various options under which trace can be switched on. They are
      If you want to switch on the trace under your user name, choose Trace on.
      If you want to switch on the trace for another user or user group, choose Trace on for user.
      To enter a single user, specify the user name.
      To enter a user group, specify a search pattern (you can use the normal wildcards).
    If you want to change the user or user group, switch off the Performance Trace and then restart it,
    entering the new users or user group.
    8. Now switch back to the window containing your editor session (the one with your program
    waiting to be executed).
    9. Press F8 to run your program.
    Note Just press F8 and do nothing. Do not even press the Back button.
    10. When your program has run and the hourglass is no longer displayed, switch back to the trace
    window.
    11. Press the Trace Off pushbutton.
    12. Once Performance Trace is switched off, you can analyze the data
    Using Runtime Analysis Tool (SE30)
    1. You can open the Runtime Analysis tool as follows:
    To start from Choose
    Any screen System   Utilities   Runtime Analysis   Execute
    Initial screen of ABAP
    Workbench
    Test   Runtime Analysis
    Initial screen of ABAP Editor Program   Execute  Runtime Analysis
    ABAP Editor Utilities   More utilities   Runtime Analysis
    2. In the simplest case, you would enter a short description and a measurement object
    (transaction, program, or function module) to run the analysis in the current session.
    3. In the Measurement restrictions group box, you can make more specific restrictions for the
    measurement. For example, you may want to include only certain statements or time periods.
    (For further information refer section 3. 0).
    4. To start the measurement, choose Measure runtime. From the initial screen, you can
    specify whether the analysis should run in the same session or in a parallel session using the
    Enable/Disable button in the In parallel session group box.
    5. Run the transaction, program, or function module as normal.
    6. Return to the initial screen of the Runtime Analysis transaction. To do so, either leave
    transaction, program, or function module as normal, or start the runtime analysis again.
    7. The name of the performance data file that has just been created is displayed at the bottom of
    the initial screen. The file created by the system is added to the list of performance data files.
    You can now analyze, print, or delete the file, or save it locally. The Performance file group
    box contains options for analyzing performance files. (For further information refer sections 4.
    0 and 5. 0)
    regards,
    keerthi

  • Performance tunning

    Dear Experts,
    I am urgently looking forward to some comprehensive documentation on Performance tunning elaborating on the issues like:-
    1.)In what instances should we do performance tunning....
    2.) why it is neccessary and
    3.) what r the <b><u>various methods</b> <b>of performance tunnig....</u></b>
    I shall be highly obliged, if anyone can point me to relevant links, or send me illustrative documentation on these issues in performance tunning at [email protected]
    ur help shall be thankfully/duely acknowledged,
    regards,
    shalini.
    Message was edited by: shalini gupta

    Shalini ,
    Performance tuning is at various levels :
    1. Data Modeling
    2. Data Loading
    3. Report design
    4. Reporting
    It is a mix and match of the above and other factors you might need to consider could also be something like:
    1. DB being used
    2. Partitioning
    3. System parameters
    4. Authorization Design...
    All this depends on the level of performance tuning you want to do:
    https://websmp204.sap-ag.de/~sapidb/011000358700001890502003
    This is a link to the support portal and I have sent the same across to you. Hope it is useful.
    Arun

  • How to improve my pls/sql performance tunning skills

    Hi All , I would like to learn more about pl/sql performance tunning , where or how can i get more knowledge in this area ?
    Is there any tutorials which can help me to understand the Explain plan, Dbms_Profiler, Dbms_Advisor more etc ........Thanks . Bcj

    Explain plan
    http://www.psoug.org/reference/explain_plan.html
    DBMS_PROFILER (10g)
    http://www.psoug.org/reference/dbms_profiler.html
    DBMS_HPROF (11g)
    http://www.psoug.org/reference/dbms_hprof.html
    DBMS_ADVISOR
    http://www.psoug.org/reference/dbms_advisor.html
    DBMS_MONITOR
    http://www.psoug.org/reference/dbms_monitor.html
    DBMS_SUPPORT
    http://www.psoug.org/reference/dbms_support.html
    DBMS_TRACE
    http://www.psoug.org/reference/dbms_trace.html
    DBMS_SQLTUNE
    http://www.psoug.org/reference/dbms_sqltune.html

Maybe you are looking for

  • Hi. Where/how do order a new bottom cover for my macbook pro year 2009 ?

    Hello, the bottom cover of my macbook pro (model 2009) is too much scratched and is looking horible already, i would like to echange it. Any ideas what would be the process? Cann i find such a piece online on apple site and order it or i would need t

  • Is there a way to select within if block

    Hi I want to do something like the followings DECLARE      empcnt number ; BEGIN      BEGIN           select count(*)  into empcnt from employees where status = 'L';       EXCEPTION            WHEN NO_DATA_FOUND THEN              empcnt := 0;        

  • 11.1.1.3 Business rules not appearing in form

    Hi I am working in 11.1.1.3, and creating HBRs in calc manager, with variables, for use on planning forms (i.e. to "Run on Save") Problem I have is that even after the rule is deployed, it is not visible in the "Business Rules" tab while editing the

  • Configuring Marketplace Adapter

    Hello, We want to configure Receiver Marketplace adapter. The scenario is to send messages to Marketplace from XI. Is there any specific structure in which messages are to be sent? also from where could we find DDID value to be specified in adapter s

  • Combining DMGs with 'hdiutil' after splitting

    Hello all, So I've split a DMG into two sections using the terminal command; 'hdiutil' so that I could put it onto my external hard drive. For some reason the hard drive won't let me transfer a file over 6GB without giving me "Error Code 0." So now t