Weird explain plan on multi-level structured XmlType column

Hello,
am running an explain on the follwing query on 11.2.0.2:
SELECT
T1.EVENT_ID,
ACTION_SUB_ID,
PARAM_KEY,
PARAM_VALUE,
TO_DATE('2013-12-10', 'YYYY-MM-DD')
FROM  T_C_RMP_MNTRNG_XML_FULL_IL ,
  XMLTABLE('/monitoring' PASSING XML_CONTENT COLUMNS
  EVENT_ID VARCHAR2(4000) PATH 'eventId',
  ACTIONS XMLTYPE PATH 'action'
) T1,
  XMLTABLE('/action' PASSING T1.ACTIONS COLUMNS
  ACTION_SUB_ID NUMBER(10,0) PATH 'actionSubId',
  PARAMS xmltype PATH 'param'
) T2,
  XMLTABLE('/param' PASSING T2.params columns
  PARAM_KEY VARCHAR2(4000) PATH 'key',
  PARAM_VALUE VARCHAR2(1000) PATH 'value'
) T3
WHERE MESSAGE_ID = 4972102 ;
Although MESSAGE_ID is the primary key of T_C_RMP_MNTRNG_XML_FULL_IL and thus there is only one record matching the condition, I get an explain plan with huge costs, 500MB of data and an estimated 10 hour runtime:
PLAN_TABLE_OUTPUT
Plan hash value: 4011854835
| Id  | Operation                      | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT               |                       |   223K|   489M|  3111K  (1)| 10:22:17 |
|   1 |  NESTED LOOPS                  |                       |       |       |            |          |
|   2 |   NESTED LOOPS                 |                       |   223K|   489M|  3111K  (1)| 10:22:17 |
|   3 |    NESTED LOOPS                |                       |   140K|    11M|  1678   (1)| 00:00:21 |
|*  4 |     INDEX RANGE SCAN           | X1B                   |     1 |    53 |     3   (0)| 00:00:01 |
|   5 |     TABLE ACCESS BY INDEX ROWID| T_OR_MON_ACTION       |   140K|  4542K|  1675   (1)| 00:00:21 |
PLAN_TABLE_OUTPUT
|*  6 |      INDEX RANGE SCAN          | X3                    |   140K|       |     4  (25)| 00:00:01 |
|*  7 |    INDEX RANGE SCAN            | X4G                   |  4083 |       |    22   (0)| 00:00:01 |
|   8 |   TABLE ACCESS BY INDEX ROWID  | T_OR_MON_ACTION_PARAM |     2 |  4428 |    52   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   4 - access("MESSAGE_ID"=4972102)
   6 - access("SYS_ALIAS_0"."NESTED_TABLE_ID"="T_C_RMP_MNTRNG_XML_FULL_IL"."SYS_NC0001200013$")
   7 - access("NESTED_TABLE_ID"="SYS_ALIAS_0"."SYS_NC0000500006$")
PLAN_TABLE_OUTPUT
Note
   - dynamic sampling used for this statement (level=2)
When I run the query, the result comes back within 0.3 seconds.
Why is the explain plan off like that?
Is this just the way it is, or is there something going wrong here?

This is my table create statement:
CREATE TABLE QQRCSBI0.T_C_RMP_MNTRNG_XML_FULL_IL (
  MESSAGE_ID NUMBER(22,0) NOT NULL ENABLE,
  XML_EVAL_ID NUMBER(22,0),
  VIN7 VARCHAR2(7 BYTE),
  FLEET_ID VARCHAR2(50 BYTE),
  CSC_SW_VERSION VARCHAR2(100 BYTE),
  RECEIVED DATE,
  XML_CONTENT SYS.XMLTYPE ,
  DWH_LM_TS_UTC DATE NOT NULL ENABLE,
  CONSTRAINT PK_C_RMP_MNTRNG_XML_FULL_IL5 PRIMARY KEY (MESSAGE_ID)
) NOLOGGING TABLESPACE CATALOG
VARRAY "XML_CONTENT"."XMLDATA"."ACTION" STORE AS TABLE "T_OR_MON_ACTION" (
  NOLOGGING TABLESPACE "CATALOG"
  VARRAY "PARAM" STORE AS TABLE "T_OR_MON_ACTION_PARAM" (
  NOLOGGING TABLESPACE "CATALOG"
  ) RETURN AS LOCATOR
) RETURN AS LOCATOR
XMLTYPE XML_CONTENT STORE AS OBJECT RELATIONAL XMLSCHEMA "http://mydomain.com/csc_monitoring_session.xsd" ELEMENT "monitoring";
I set all default table names in the schema to blank and registered the schema with genTables=false.
I am still running into problems retrieving the 3rd level T_OR_MON_ACTION_PARAM data. The query just crashes after a while because it is running out of either TEMP space or UNDO space (it keeps changing). I'll take a step back to re-evaluate and post another thread about that in a bit I guess...
You said "SQL*Plus explain plan, goes most of the time bananas" - is there a difference in what client (SqlPlus or SqlDeveloper) I use to get the explain plan? I thought the plan was generated by the DB and the clients just display the result, and the only difference is the way the clients display the plan?!

Similar Messages

  • Multiple XML schema in structured XMLType column possible?

    I have registered several different xml schema in my 10g database. I have a table with an XMLType column. That column will always hold one XML document that conforms to one of the XML schema. Question: does that by definition mean I have to use "unstructured" storage, or there any way to use structured storage telling Oracle that the XMLType conforms to xsd1 OR xsd2 OR xsd3?
    Thanks.

    In 10gR2 a column based on an XML Schema and using object-relation storage can be bound to one global element. The only way for a column to hold documents associated with more than one global element is if both elements are defined as members of the same substition group.

  • Generating multi-level xml in oracle

    Hi,
    I want to create a multi-level XML structure from oracle, is there a way?
    Presently oracle provides DBMS_XMLQUERY and XMLGEN package to generated XML structure given a query. But the structure so generated is of single level. That is say I use
    select XMLGEN.getXML('select * from employees') from dual;
    the output is
    <EMPLOYEE>
    <ROW num="1">
    <NAME>Mark</NAME>
    <TEL>451-638191</TEL>
    </ROW>
    </EMPLOYEE>
    That I call a single level output.
    To create a multiple level XML I went in for object type in oracle. But the problem with this is that if I want to have multiple children for a single parent then object types fail. The structure below is not possible with object type.
    <EMPLOYEE>
    <ROW num="1">
    <NAME>Mark</NAME>
    <CONTACT>
    <ROW>
    <RESIDENCE>
    <ADDRESS>
         <ROW>
         Fifth Avenue, New York
         </ROW>
    </ADDRESS>
    <TEL>
         <ROW>451-638191</ROW>
         <ROW>451-638192</ROW>
         <ROW>451-638193</ROW>
    </TEL>
    </RESIDENCE>
    </ROW>
    <ROW>
    <RESIDENCE>
    <ADDRESS>
         <ROW>
         Fouth Avenue, New York
         </ROW>
    </ADDRESS>
    <TEL>
         <ROW>452-638191</ROW>
         <ROW>452-638192</ROW>
         <ROW>452-638193</ROW>
    </TEL>
    </RESIDENCE>
    </ROW>
    </CONTACT>
    </ROW>
    </EMPLOYEE>
    Then I tried nested tables. Here one needs to create an object type to create a table type. One cannot create a table type out of another table type. So that leavs me with 2 levels
    object type
    used by
    table type
    used by
    table.
    Presently to generated a multi-level output as shown above I'm using cursors and build it in a clob variable.
    Is there any other way that one can build a multi-level structure. Or is there a build in package that comes with orace 8i (and higher).
    Regards,
    Milton.

    Milton,
    I was able to generate hierarchical XML from Oracle using object views and XML-SQL Utility (XSU).
    Here is a simplified version of my OR schema:
    /* Physical spec object */
    create or replace type physical_specifications_object as object (
    physical_specifications_id number(15),
    page_count number(10),
    product_id number(10),
    four_color_count number(10),
    two_color_count number(10),
    table_count number(10),
    binding_type varchar2(100),
    height varchar2(20),
    width varchar2(20)
    /* Market object */
    create or replace type market_object as object (
    market_id number(15),
    master_class_name varchar2(50),
    market_name varchar2(100),
    market_type varchar2(100),
    market_description varchar2(500),
    level_rank varchar2(15),
    market_code varchar2(100),
    product_id number(10)
    /* List of markets */
    create or replace type market_table as table of market_object;
    /* Market object view */
    create or replace view market_object_view of market_object
    with object identifier (market_id) as
    select mkt.market_id,
    class.master_class_name,
    mkt.market_name,
    mkt.market_type,
    mkt.market_description,
    prod_mkt.level_rank,
    mkt.market_code,
    p.product_id
    from market mkt,
    product p,
    product_market prod_mkt,
    master_class class
    where p.product_id = prod_mkt.product_id
    and prod_mkt.market_id = mkt.market_id
    and mkt.master_class_id = class.master_class_id(+);
    /* Feature object */
    create or replace type product_feature_object as object (
    feature_id number(15),
    feature_text varchar2(3500),
    feature_type varchar2(100)
    /* List of features */
    create or replace type product_feature_table as table of product_feature_object;
    /* Product object */
    create or replace type product_object as object (
    product_id number(10),
    title varchar2(150),
    media_type varchar2(20),
    standard_number varchar2(100),
    physical_specifications physical_specifications_object,
    markets market_table,
    product_features product_feature_table
    /* Product object view */
    create or replace view product_object_view of product_object
    with object identifier (product_id) as
    select p.product_id,
    p.title,
    p.media_type,
    p.standard_number,
    physical_specifications_object(spec.physical_specifications_id,
    spec.page_count,
    spec.product_id,
    spec.four_color_count,
    spec.two_color_count,
    spec.table_count,
    spec.binding_type,
    spec.height,
    spec.width),
    cast(multiset(select *
    from market_object_view mkt
    where mkt.product_id(+) = p.product_id) as market_table) as markets,
    cast(multiset(select f.feature_id, f.feature_text, f.feature_type
    from feature f
    where f.product_id = p.product_id) as product_feature_table) as product_features
    from product p,
    physical_specifications spec
    where p.product_id = spec.product_id(+)
    The objective is to generate XML for a product list with all the product subelements. The simple query "select * from product_object_view" when fed to the XML-SQL utility generates multi-level SQL. Note that Oracle 8i allows up to two level collection nesting in object types. Oracle 9i removes this limitation.
    Check XSU documentation at http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/xsu/xsu_userguide.html#1014886
    Hi,
    I want to create a multi-level XML structure from oracle, is there a way?
    Presently oracle provides DBMS_XMLQUERY and XMLGEN package to generated XML structure given a query. But the structure so generated is of single level. That is say I use
    select XMLGEN.getXML('select * from employees') from dual;
    the output is
    <EMPLOYEE>
    <ROW num="1">
    <NAME>Mark</NAME>
    <TEL>451-638191</TEL>
    </ROW>
    </EMPLOYEE>
    That I call a single level output.
    To create a multiple level XML I went in for object type in oracle. But the problem with this is that if I want to have multiple children for a single parent then object types fail. The structure below is not possible with object type.
    <EMPLOYEE>
    <ROW num="1">
    <NAME>Mark</NAME>
    <CONTACT>
    <ROW>
    <RESIDENCE>
    <ADDRESS>
         <ROW>
         Fifth Avenue, New York
         </ROW>
    </ADDRESS>
    <TEL>
         <ROW>451-638191</ROW>
         <ROW>451-638192</ROW>
         <ROW>451-638193</ROW>
    </TEL>
    </RESIDENCE>
    </ROW>
    <ROW>
    <RESIDENCE>
    <ADDRESS>
         <ROW>
         Fouth Avenue, New York
         </ROW>
    </ADDRESS>
    <TEL>
         <ROW>452-638191</ROW>
         <ROW>452-638192</ROW>
         <ROW>452-638193</ROW>
    </TEL>
    </RESIDENCE>
    </ROW>
    </CONTACT>
    </ROW>
    </EMPLOYEE>
    Then I tried nested tables. Here one needs to create an object type to create a table type. One cannot create a table type out of another table type. So that leavs me with 2 levels
    object type
    used by
    table type
    used by
    table.
    Presently to generated a multi-level output as shown above I'm using cursors and build it in a clob variable.
    Is there any other way that one can build a multi-level structure. Or is there a build in package that comes with orace 8i (and higher).
    Regards,
    Milton.

  • Import multi-level BOM into Oracle

    We have a client requirement to create BOM based on level using Pl/Sql, Data will be coming in the below format:-
    Item Description      BOM LEVEL
    a               *1*     
    aa               *2*     
    aaa               *3*     
    aab               *3*     
    aaba               *4*     
    aabb               *4*     
    ab               *2*     
    aba               *3*     
    abb               *3*     
    we want the above data in table to be inserted in below format:
    Assembly Item     Component Item
    a               Aa
    Aa               Aaa
    Aa               Aab
    Aa               Aac
    A               Ab
    Ab               Aba
    Ab               Abb
    Aab               aaba
    Please suggest.
    Thanks,
    Urvashi Arora
    Edited by: user10992307 on 08-May-2012 23:07

    When you look at one row in your source data, there is no way to tell what is the parent item for the component you are looking at.
    So you will have to write a program that walks thru the data and builds parent=child relationship. It will be a tricky program but once that is done, all you have to do is to insert into bom interface tables and Oracle will take care of the rest.
    Oracle BOM interface will take care of building a multi-level structure.
    Sandeep Gandhi

  • Multi Level Modeling

    Hi SAP Gurus,
    Can you please explain what is multi level modeling and give some scenario s to make clear difference.
    Thanks

    Hi,
    Multi-Dimensional Modeling with SAP NetWeaver BI
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6ce7b0a4-0b01-0010-52ac-a6e813c35a84
    /people/githen.ronney3/blog/2008/02/13/modeling-strategies
    Modeling the Data Warehouse Layer with BI
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3668618d-0c01-0010-1ab5-aa75c3a4dfc2
    /people/gilad.weinbach2/blog/2007/02/23/a-beginners-guide-to-your-first-bi-model-in-nw2004s
    BI Data Modeling
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2f5aa43f-0c01-0010-a990-9641d3d4eef7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/dc43c445-0d01-0010-23a1-ca348ff5f975
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    Hope this helps.
    Thanks,
    JituK

  • Query tunning in Oracle using Explain Plan

    Adding to my below question: I have now modified the query and the path shownby 'Explain plan' has reduced. The 'Time' column of plan_table is also showing much lesser value. However, some people are suggesting me to consider the time required by the query to execute on Toad. Will it be practical? Please help!!
    Hi, I am using Oracle 11g. I need to optimize a Select query(Need to minimize the execution time). I need to know how 'Explain Plan' would help me. I know how to use Explain Plan command. I refer Plan_table table to see the details of the plan. Please guide me regarding which columns of the Plan_table should be considered while modifying the query for optimization. Some people say, 'Time' column should be considered, some say 'Bytes' etc. Some suggest on minimizing the full table scans, while some people say that I should minimize the total no. operations (less no. of rows should be displayed in Plan_table). As per an experienced friend of mine, full table scans should be reduced (for e.g. if there are 5 full table scans in the plan, then try to reduce them to less than 5. ). However, if I consider any full table scan operation in the plan_table, its shows value of 'time' column as only 1 which is very very less. Does this mean the full scan is actually taking very less time?? If yes, then this means full table scans are very fast in my case and no need to work on them. Some articles suggest that plan shown by 'Explain Plan' command is not necessarily followed while executing the query. So what should I look for then? How should I optimize the query and how will I come to know that it's optimized?? Please help!!...
    Edited by: 885901 on Sep 20, 2011 2:10 AM

    885901 wrote:
    Hi, I am using Oracle 11g. I need to optimize a Select query(Need to minimize the execution time). I need to know how 'Explain Plan' would help me. I know how to use Explain Plan command. I refer Plan_table table to see the details of the plan. Please guide me regarding which columns of the Plan_table should be considered while modifying the query for optimization. Some people say, 'Time' column should be considered, some say 'Bytes' etc. Some suggest on minimizing the full table scans, while some people say that I should minimize the total no. operations (less no. of rows should be displayed in Plan_table). As per an experienced friend of mine, full table scans should be reduced (for e.g. if there are 5 full table scans in the plan, then try to reduce them to less than 5. ). However, if I consider any full table scan operation in the plan_table, its shows value of 'time' column as only 1 which is very very less. Does this mean the full scan is actually taking very less time?? If yes, then this means full table scans are very fast in my case and no need to work on them. Some articles suggest that plan shown by 'Explain Plan' command is not necessarily followed while executing the query. So what should I look for then? How should I optimize the query and how will I come to know that it's optimized?? Please help!!...how fast is fast enough?

  • Explain plan change

    9.2.0.8 on solaris 10
    What are the scenarios that an explain plan will change when using RBO as optimizer_mode
    we have a query like :
    select * emp where empno=101;
    For this query , the explain plan uses the index in the column empno where as the query :
    select * emp where empno=501;
    doesn't use a index . the time taken for retreival is the same . but why does the explain plan change ?.
    Do we have to collect stats when using RBO ?
    I tried tracing the above sessions, but couldn't find any diff (just to let you know that I tried )
    Edited by: user12046873 on Feb 28, 2010 10:43 PM

    It appears you are not using RBO, because using RBO would have resulted in the same execution plans. PERIOD.
    Nor should you use RBO, as CBO provides way better execution plans.
    You don't post these execution plans, nor how you retrieved them, so no comments are possible.
    They need to be the live execution plan from a trace file,+not using explain=+ as that will have tkprof calculate the explain plan.
    Sybrand Bakker
    Senior Oracle DBA

  • Updated content for multi-level record structure in PLSQL

    Hi All,
    please help me
    Need a FUNCTION which would take PERSON_id as the INPUT PARAMETER and RETURN the FULL DETAILS in a multi-level record structure in PLSQL.
    CREATE TABLE people(
    name VARCHAR2(5),
    person_id number
    INSERT INTO people(name,person_id) VALUES ('n1',1);
    INSERT INTO people(name,person_id) VALUES ('n2',2);
    INSERT INTO people(name,person_id) VALUES ('n3',3);
    INSERT INTO people(name,person_id) VALUES ('n4',4);
    INSERT INTO people(name,person_id) VALUES ('n5',5);
    INSERT INTO people(name,person_id) VALUES ('n6',6);
    A person can be assigned many tasks. Below,we can see person_id =1 has 2 tasks 10,20
    CREATE TABLE tasks(
    task_id number,              --->PK
    task_name VARCHAR2(5),
    person_id number          -->FK to People
    INSERT INTO tasks(task_id,task_name,person_id) VALUES (10, 'cleaning',1);
    INSERT INTO tasks(task_id,task_name,person_id) VALUES (20', 'washing',1);
    INSERT INTO tasks(task_id,task_name,person_id) VALUES (30, 'sweeping',2);
    INSERT INTO tasks(task_id,task_name,person_id) VALUES (40, 'ironing',3);
    Each TASK has many ACTIVTIES as below. Below,we can see task_id =10 ---->3 ACTIVITIES of activity_id of 100,200,300
    CREATE TABLE activities(
    activity_id number,
    activity_name VARCHAR2(50),
    task_id number,              --->FK  to task table
    INSERT INTO activities(activity_id,activity_name,task_id)VALUES (100, 'Clean home',10);
    INSERT INTO activities(activity_id,activity_name,task_id)VALUES (200, 'Clean Garden',10);
    INSERT INTO activities(activity_id,activity_name,task_id)VALUES (300, 'Clean clothes,10');
    INSERT INTO activities(activity_id,activity_name,task_id)VALUES (400, 'Wash car',20);
    Write a FUNCTION which would take PERSON_id as the INPUT PARAMETER and RETURN the FULL DETAILS in a multi-level record structure in PLSQL.
    Meaning We would get
    First ,person_details for a person-->next level is TASKS-->Activities_list in a NESTED RECORD SET
    create or replace function person_details(person_id NUMBER)
    RETURNs a
    PERSON_DETAILS RECORD structure as shown below.A person -->Tasks--> all activities
    record PERSON_DETAILS[1]
         person_id,
         name
         TASKS_DETAILS[1]          ---->2nd level
                     task_id[1],
               task_name[1]
                   ACTIVITIES[1]----->3rd level
                        activity_id[1],
                        activity_name[1]     
                      ACTIVITIES[2]
                        activity_id[2],
                        activity_name[2]                    
                   ACTIVITIES[3]
                        activity_id[3],
                        activity_name[3]
    *(1)--Most important part is how do i DEFINE AND DECLARE the RESULT RECORD SET in my FUNCTION?
      (2)--HOW DO WE DYNAMICALLY ALOCATE MEMORY for the record structure based on the no. of rows by each SELECT?
       (3)Access the nested levels and FILL in the DATA in the above record seperately USING SELECT statements.
    */*SELECT 1 ---Find and fill Person*/*
    *select person_id,name from people where person_id =1*
    *-->From this SELECT fill the OUTER record PERSON_DETAILS[no. of records] -->person_id,name*
    */**SELECT 2 ---I want to FIND all TASKS for THE ABOVE PERSON and fill the next part */*
    *select task_id,name from tasks where person_id = PERSON_DETAILS[1].person_id*
    *We get three TASK_ids,*
    *-->From this, HOW TO fill DATA for each TASK,how to  PERSON_DETAILS[1]->TASKS_DETAILS[1st record].task_id -->person_id,name*
    */**SELECT 3 ---I want to FIND all ACTIVITIES for THE ABOVE TASKS and fill the next part */*
    *for EACH of the TASKS found,we need to LOOP and*
    *select activity_id,name from activities where task_id = PERSON_DETAILS[1].-->TASKS_DETAILS[1st record]--->ACTIVITY_DETAILS[1].activity_id*
    I have tried my best to explain with the tables and the relationships.I just hope its not confusing now.Edited by: user_7000011 on 01-Apr-2009 12:46

    try this one.
    Learned something new today.
    CREATE TABLE temp_clob_tab(result CLOB);
    CREATE or replace TYPE task_t AS OBJECT("@task_id"   NUMBER,
                                last_name        VARCHAR2(20),
                                 activitylist     activity_tab
    create or replace type activity_t as object("@activity_id" number, activity_name varchar2(20));
    CREATE or replace  TYPE tasklist_t AS TABLE OF task_t;
    create or replace type activity_tab as table of activity_t;
    CREATE or replace TYPE people_t AS OBJECT("@people_id" NUMBER,
                                 task_name  VARCHAR2(20),
                                 task_t          tasklist_t
    DECLARE
      qryCtx DBMS_XMLGEN.ctxHandle;
      result CLOB;
    BEGIN
      DBMS_XMLGEN.setRowTag(qryCtx, NULL);
      qryCtx := DBMS_XMLGEN.newContext
        ('SELECT people_t(person_id,
                        name,
                        CAST(MULTISET
                               (SELECT e.task_id, e.task_name,cast(multiset
                                        (select activity_id,activity_name from activities a
                                            where a.task_id = e.task_id) as activity_tab)
                                  FROM tasks e
                                  WHERE e.person_id= d.person_id)
                             AS tasklist_t))
            AS peoplexml
            FROM people d
            where person_id = 1');
      -- now get the result
      result := DBMS_XMLGEN.getXML(qryCtx);
      INSERT INTO temp_clob_tab VALUES (result);
      -- close context
      DBMS_XMLGEN.closeContext(qryCtx);
    END;
    select * from          temp_clob_tab ;output
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <PEOPLEXML people_id="1">
       <TASK_NAME>n1</TASK_NAME>
       <TASK_T>
        <TASK_T task_id="10">
         <LAST_NAME>cleaning</LAST_NAME>
         <ACTIVITYLIST>
          <ACTIVITY_T activity_id="100">
           <ACTIVITY_NAME>Clean home</ACTIVITY_NAME>
          </ACTIVITY_T>
          <ACTIVITY_T activity_id="200">
           <ACTIVITY_NAME>Clean Garden</ACTIVITY_NAME>
          </ACTIVITY_T>
          <ACTIVITY_T activity_id="300">
           <ACTIVITY_NAME>Clean clothes</ACTIVITY_NAME>
          </ACTIVITY_T>
         </ACTIVITYLIST>
        </TASK_T>
        <TASK_T task_id="20">
         <LAST_NAME>washing</LAST_NAME>
         <ACTIVITYLIST>
          <ACTIVITY_T activity_id="400">
           <ACTIVITY_NAME>Wash car</ACTIVITY_NAME>
          </ACTIVITY_T>
         </ACTIVITYLIST>
        </TASK_T>
       </TASK_T>
      </PEOPLEXML>
    </ROW>
    </ROWSET>

  • Why can the explain plan be different from 2 exact set of structures

    hi,
    i have from a view some base tables let's say A , B, C & D
    this query is running very slow . so from the same database , i created tables A1 , B1, C1,& D1 from the above tables.
    i created some new indexes on A1 to D1 tables and the results returned to me is fast.
    i did an exlain plan
    so i drop the indexes on the original A to D table and created the new indexes as per A1 to D1 and analyzed them. and i also did an explain plan
    but the query is still running slow and also the explain plan is different to the one from A1 to D1 (the one that running fast)
    pls help me to understand how/why can this happen ?
    tks & rdgs

    hi,
    precisely i could have been providing insufficient information but i am too inexperienced to be able to give you the required information and i am also not very sure where i could get the info so that you all can advise me further.
    but this is from the user_tables , the only difference i see is that
    under LOGGING table A to E is 'YES'
    TABLE_NAME     TABLESPACE_NAME     PCT_FREE     LOGGING     BACKED_UP     NUM_ROWS     BLOCKS     CACHE     TABLE_LOCK     PARTITIONED
    A1          OWNER1          10          NO          N     37332          883         N     ENABLED     NO
    B1          OWNER1          10          NO          N     43458          861         N     ENABLED     NO
    C1          OWNER1          10          NO          N     823828          7826         N     ENABLED     NO
    D1          OWNER1          10          NO          N     881176          14646         N     ENABLED     NO
    E1          OWNER1          10          NO          N     18868          223         N     ENABLED     NO
    A          OWNER1          10          YES          N     37040          880         N     ENABLED     NO
    B          OWNER1          10          YES          N     43386          880         N     ENABLED     NO
    C          OWNER1          10          YES          N     823820          7684         N     ENABLED     NO
    D          OWNER1          50          YES          N     880948          26624         N     ENABLED     NO
    E          OWNER1          10          YES          N     18690          244         N     ENABLED     NOtks & rdgs

  • IDOC DELVRY05 - What structure for multi-level packing?

    Hi All
    I am creating DELVRY05 idocs via WE19.
    I am using handling materials, and packing my materials into handling units, which are in turn packed in a further level of handling unit.  So we have eaches packed in boxes, and boxes packed in a container.
    I an set up this scenario directly in VL31N, so I am happy that the data that I want to work with works.
    In WE19 I can set up single layer packing, i.e., eaches packed in containers, but I can not get multi level packing to work.
    I suspect that my organisation of E1EDL37 and E1EDL44 segments is incorrect.
    My question is this:
    What layout should I have for my E1EDL37 and E1EDL44 segments, and what order should they appear in my idoc?
    Thanks in advance.
    James

    James,
    Did you have a solution for this? I'm having the same issue. I couldn't able to make it work correctly. Somewhere I'm missing a small part, but couldn't able to figure it out.
    raj

  • Can we use SNP PDS in Multi level ATP ?

    Hi All,
    We do CTM planning with existing SNP PDS In APO and now we want to explore to use the Multi level ATP functionality for GATP.  I know, MATP can create the ATP trees if the stock is not available and these can be converted into PPDS order.
    My question is, can we use SNP PDS for this purpose?
    Thanks,
    Abhilasha

    Hi Abhilasha,
    There is no such specific mention anywhere in the literature that you cannot use SNP PDS for MATP. The only downside to using SNP PDS is that SNP PDS are meant for mid to long term planning and the activities/operations in SNP PDS are usually not in detail i.e only important activities or bottle neck components are usually used which will not always facilitate detailed scheduling.
    On the other hand MATP creates ATP tree structures by plan exlosion(which can be SNP/PDS) and saves the requirements groups(component requirements of header level) with dates/qts and source of supply. It uses PPDS component to convert these ATP tree structures into PPDS planned orders depending on the conversion horizon/requirements dates. It does that by reading the source of supply, requirements dates and quantities from ATP tree structure and by plan explosion.
    When MATP planned orders are created you should no longer plan them with automatic planning run as that will cause re-explosion of the plan and might cause incorrect down stream requirements if you had had substitutions at component leve during MATP check. In planned orders, you have an option of changing the allowed sources of supply (in source of supply section). But for orders created by MATP, you will not be allowed to change the source of supply field from SNP PDS to PPDS PDS in the planned order because it will re-explode the plan. So you can decide for yourself if you can use SNP PDS as source of supply for PPDS planned orders.
    Hope that answers your question.
    Regards,
    Mohan

  • RE: how to explode multi level bom ?

    hi sd experts,
    I really appreciate if anyone explain me how explode multi level BOM
    if possible pls send me best practices
    thanks
    regards
    shabnum

    Hi Shabnum,
    For ex:
    main material is 101(material No)
    Subitems for 101 are: 102,103, 104 & 105
    102 also has 2 two sub items i.e., 106 & 107
    I created material masters for all the items i.e., 101 to 107 and posted stocks and maintained prices individually in VK11.
    I created BOM in CS01 seperately for 101 & 102
    I changed the Item Category Group for both the main items 101 & 102 from NORM to ERLA and tried creating the Sales Order.
    For 101 BOM is exploding correctly in order but for 102 it is not exploding.
    If I enter both the materials 101 & 102 as 2 line items then BOM is exploding for both the materials.
    Then do the Config in :
    Pls check the Item category configuration for your header material for the following field:
    Structure Scope: whether it is A or B...A is for explode single level & B is for explode multi-level bill of material. In your case, it should be maintained as "B"
    This would work for you
    Reward if it helps
    Regards
    Srini

  • DIFFERENCE BETWEEN SINGLE LEVEL AND MULTI LEVEL COSTING

    Sir,'
    Please explain the difference between Single Level and Multi Level Costing in Detail
    thanking You

    While using material ledger, we can use the single level or multi-level price determination for valuation of inventory.
    Procurement processes are used in Product Cost Controlling to determine procurement costs and to present those costs. Purchase Order, for example, is single-level procurement and Production is multilevel procurement.
    Single-level material price determination calculates the periodic unit price for a material. The standard price and the cumulative single-level differences of the period are taken into account. Single-level material price determination takes into account the differences that arise directly when a material is procured.
    Multilevel price determination calculates the periodic unit price for a material. The standard price, the single-level differences cumulated in the period, the differences between planned and actual prices, as well as input material differences (multilevel differences) are all taken into account.
    Single-level material price determination  is a prerequisite for Multi-level price determination.

  • How to improve the query performance or tune query from Explain Plan

    Hi
    The following is my explain plan for sql query. (The plan is generated by Toad v9.7). How to fix the query?
    SELECT STATEMENT ALL_ROWSCost: 4,160 Bytes: 25,296 Cardinality: 204                                         
         8 NESTED LOOPS Cost: 3 Bytes: 54 Cardinality: 1                                    
              5 NESTED LOOPS Cost: 2 Bytes: 23 Cardinality: 1                               
                   2 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 13 Cardinality: 1                          
                        1 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                     
                   4 TABLE ACCESS BY INDEX ROWID TABLE AR.HZ_CUST_ACCOUNTS Cost: 1 Bytes: 10 Cardinality: 1                          
                        3 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.HZ_CUST_ACCOUNTS_U1 Cost: 1 Cardinality: 1                     
              7 TABLE ACCESS BY INDEX ROWID TABLE AR.HZ_PARTIES Cost: 1 Bytes: 31 Cardinality: 1                               
                   6 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.HZ_PARTIES_U1 Cost: 1 Cardinality: 1                          
         10 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 12 Cardinality: 1                                    
              9 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                               
         15 NESTED LOOPS Cost: 2 Bytes: 29 Cardinality: 1                                    
              12 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 12 Cardinality: 1                               
                   11 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                          
              14 TABLE ACCESS BY INDEX ROWID TABLE ONT.OE_ORDER_HEADERS_ALL Cost: 1 Bytes: 17 Cardinality: 1                               
                   13 INDEX RANGE SCAN INDEX (UNIQUE) ONT.OE_ORDER_HEADERS_U2 Cost: 1 Cardinality: 1                          
         21 FILTER                                    
              16 TABLE ACCESS FULL TABLE ONT.OE_TRANSACTION_TYPES_TL Cost: 2 Bytes: 1,127 Cardinality: 49                               
              20 NESTED LOOPS Cost: 2 Bytes: 21 Cardinality: 1                               
                   18 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 12 Cardinality: 1                          
                        17 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                     
                   19 INDEX RANGE SCAN INDEX (UNIQUE) ONT.OE_ORDER_HEADERS_U2 Cost: 1 Bytes: 9 Cardinality: 1                          
         23 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 12 Cardinality: 1                                    
              22 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                               
         45 NESTED LOOPS Cost: 4,160 Bytes: 25,296 Cardinality: 204                                    
              42 NESTED LOOPS Cost: 4,150 Bytes: 23,052 Cardinality: 204                               
                   38 NESTED LOOPS Cost: 4,140 Bytes: 19,992 Cardinality: 204                          
                        34 NESTED LOOPS Cost: 4,094 Bytes: 75,850 Cardinality: 925                     
                             30 NESTED LOOPS Cost: 3,909 Bytes: 210,843 Cardinality: 3,699                
                                  26 PARTITION LIST ALL Cost: 2,436 Bytes: 338,491 Cardinality: 14,717 Partition #: 29 Partitions accessed #1 - #18          
                                       25 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_AE_HEADERS Cost: 2,436 Bytes: 338,491 Cardinality: 14,717 Partition #: 29 Partitions accessed #1 - #18     
                                            24 INDEX SKIP SCAN INDEX XLA.XLA_AE_HEADERS_N1 Cost: 264 Cardinality: 1,398,115 Partition #: 29 Partitions accessed #1 - #18
                                  29 PARTITION LIST ITERATOR Cost: 1 Bytes: 34 Cardinality: 1 Partition #: 32           
                                       28 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_AE_LINES Cost: 1 Bytes: 34 Cardinality: 1 Partition #: 32      
                                            27 INDEX RANGE SCAN INDEX (UNIQUE) XLA.XLA_AE_LINES_U1 Cost: 1 Cardinality: 1 Partition #: 32
                             33 PARTITION LIST ITERATOR Cost: 1 Bytes: 25 Cardinality: 1 Partition #: 35                
                                  32 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_DISTRIBUTION_LINKS Cost: 1 Bytes: 25 Cardinality: 1 Partition #: 35           
                                       31 INDEX RANGE SCAN INDEX XLA.XLA_DISTRIBUTION_LINKS_N3 Cost: 1 Cardinality: 1 Partition #: 35      
                        37 PARTITION LIST SINGLE Cost: 1 Bytes: 16 Cardinality: 1 Partition #: 38                     
                             36 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_EVENTS Cost: 1 Bytes: 16 Cardinality: 1 Partition #: 39 Partitions accessed #2               
                                  35 INDEX UNIQUE SCAN INDEX (UNIQUE) XLA.XLA_EVENTS_U1 Cost: 1 Cardinality: 1 Partition #: 40 Partitions accessed #2          
                   41 PARTITION LIST SINGLE Cost: 1 Bytes: 15 Cardinality: 1 Partition #: 41                          
                        40 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_TRANSACTION_ENTITIES Cost: 1 Bytes: 15 Cardinality: 1 Partition #: 42 Partitions accessed #2                    
                             39 INDEX UNIQUE SCAN INDEX (UNIQUE) XLA.XLA_TRANSACTION_ENTITIES_U1 Cost: 1 Cardinality: 1 Partition #: 43 Partitions accessed #2               
              44 TABLE ACCESS BY INDEX ROWID TABLE GL.GL_CODE_COMBINATIONS Cost: 1 Bytes: 11 Cardinality: 1                               
                   43 INDEX UNIQUE SCAN INDEX (UNIQUE) GL.GL_CODE_COMBINATIONS_U1 Cost: 1 Cardinality: 1

    damorgan wrote:
    Tuning is NOT about reducing the cost of i/o.
    i/o is only one of many contributors to cost and only one of many contributors to waits.
    Any time you would like to explore this further run this code:
    SELECT 1 FROM dual
    WHERE regexp_like(' ','^*[ ]*a');but not on a production box because you are going to experience an extreme tuning event with zero i/o.
    And when I say "extreme" I mean "EXTREME!"
    You've been warned.I think you just need a faster server.
    SQL> set autotrace traceonly statistics
    SQL> set timing on
    SQL> select 1 from dual
      2  where
      3  regexp_like   (' ','^*[ ]*a');
    no rows selected
    Elapsed: 00:00:00.00
    Statistics
              1  recursive calls
              0  db block gets
              0  consistent gets
              0  physical reads
              0  redo size
            243  bytes sent via SQL*Net to client
            349  bytes received via SQL*Net from client
              1  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              0  rows processedRepeated from an Oracle 10.2.0.x instance:
    SQL> SELECT DISTINCT SID FROM V$MYSTAT;
           SID
           310
    SQL> ALTER SESSION SET EVENTS '10053 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    Session altered.
    SQL> select 1 from dual
      2  where
      3  regexp_like   (' ','^*[ ]*a');The session is hung. Wait a little while and connect to the database using a different session:
    COLUMN STAT_NAME FORMAT A35 TRU
    SET PAGESIZE 200
    SELECT
      STAT_NAME,
      VALUE
    FROM
      V$SESS_TIME_MODEL
    WHERE
      SID=310;
    STAT_NAME                                VALUE
    DB time                                   9247
    DB CPU                                    9247
    background elapsed time                      0
    background cpu time                          0
    sequence load elapsed time                   0
    parse time elapsed                        6374
    hard parse elapsed time                   5997
    sql execute elapsed time                  2939
    connection management call elapsed        1660
    failed parse elapsed time                    0
    failed parse (out of shared memory)          0
    hard parse (sharing criteria) elaps          0
    hard parse (bind mismatch) elapsed           0
    PL/SQL execution elapsed time               95
    inbound PL/SQL rpc elapsed time              0
    PL/SQL compilation elapsed time              0
    Java execution elapsed time                  0
    repeated bind elapsed time                  48
    RMAN cpu time (backup/restore)               0Seems to be using a bit of time for the hard parse (hard parse elapsed time). Wait a little while, then re-execute the query:
    STAT_NAME                                VALUE
    DB time                                   9247
    DB CPU                                    9247
    background elapsed time                      0
    background cpu time                          0
    sequence load elapsed time                   0
    parse time elapsed                        6374
    hard parse elapsed time                   5997
    sql execute elapsed time                  2939
    connection management call elapsed        1660
    failed parse elapsed time                    0
    failed parse (out of shared memory)          0
    hard parse (sharing criteria) elaps          0
    hard parse (bind mismatch) elapsed           0
    PL/SQL execution elapsed time               95
    inbound PL/SQL rpc elapsed time              0
    PL/SQL compilation elapsed time              0
    Java execution elapsed time                  0
    repeated bind elapsed time                  48
    RMAN cpu time (backup/restore)               0The session is not reporting additional CPU usage or parse time.
    Let's check one of the session's statistics:
    SELECT
      SS.VALUE
    FROM
      V$SESSTAT SS,
      V$STATNAME SN
    WHERE
      SN.NAME='consistent gets'
      AND SN.STATISTIC#=SS.STATISTIC#
      AND SS.SID=310;
         VALUE
           163Not many consistent gets after 20+ minutes.
    Let's take a look at the plan:
    SQL> SELECT SQL_ID,CHILD_NUMBER FROM V$SQL WHERE SQL_TEXT LIKE 'select 1 from du
    al%';
    SQL_ID        CHILD_NUMBER
    04mpgrzhsv72w            0
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('04mpgrzhsv72w',0,'TYPICAL'))
    select 1 from dual where regexp_like   (' ','^*[ ]*a')
    NOTE: cannot fetch plan for SQL_ID: 04mpgrzhsv72w, CHILD_NUMBER: 0
          Please verify value of SQL_ID and CHILD_NUMBER;
          It could also be that the plan is no longer in cursor cache (check v$sql_p
    lan)No plan...
    Let's take a look at the 10053 trace file:
    Registered qb: SEL$1 0x19157f38 (PARSER)
      signature (): qb_name=SEL$1 nbfros=1 flg=0
        fro(0): flg=4 objn=258 hint_alias="DUAL"@"SEL$1"
    Predicate Move-Around (PM)
    PM: Considering predicate move-around in SEL$1 (#0).
    PM:   Checking validity of predicate move-around in SEL$1 (#0).
    CBQT: Validity checks failed for 7uqx4guu04x3g.
    CVM: Considering view merge in query block SEL$1 (#0)
    CBQT: Validity checks failed for 7uqx4guu04x3g.
    Subquery Unnest
    SU: Considering subquery unnesting in query block SEL$1 (#0)
    Set-Join Conversion (SJC)
    SJC: Considering set-join conversion in SEL$1 (#0).
    Predicate Move-Around (PM)
    PM: Considering predicate move-around in SEL$1 (#0).
    PM:   Checking validity of predicate move-around in SEL$1 (#0).
    PM:     PM bypassed: Outer query contains no views.
    FPD: Considering simple filter push in SEL$1 (#0)
    FPD:   Current where clause predicates in SEL$1 (#0) :
              REGEXP_LIKE (' ','^*[ ]*a')
    kkogcp: try to generate transitive predicate from check constraints for SEL$1 (#0)
    predicates with check contraints:  REGEXP_LIKE (' ','^*[ ]*a')
    after transitive predicate generation:  REGEXP_LIKE (' ','^*[ ]*a')
    finally:  REGEXP_LIKE (' ','^*[ ]*a')
    apadrv-start: call(in-use=592, alloc=16344), compile(in-use=37448, alloc=42256)
    kkoqbc-start
                : call(in-use=592, alloc=16344), compile(in-use=38336, alloc=42256)
    kkoqbc-subheap (create addr=000000001915C238)Looks like the query never had a chance to start executing - it is still parsing after 20 minutes.
    I am not sure that this is a good example - the query either executes very fast, or never has a chance to start executing. But, it might still make your point physical I/O is not always the problem when performance problems are experienced.
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • "Multi-level error propagation carried out" in SCM 5.0

    When I use the SNP PPM Generation With Lot Size Margin function in SCM 5.0, I got the following error:
    Multi-level error propagation carried out
    Message no. /SAPAPO/OM242
    Could you please give me this help?
    Thanks,
    Lian

    Hi,
    Thank you for the information, but the problem is still there though I de-activated all user-exits...
    I also saw the following error:
    Invalid planning version
    Message no. /SAPAPO/OM015
    Thanks,
    Lian

Maybe you are looking for