Cost of the execution plan is different in the two databases

Hi gurus,

I have two databases, which are 12 C.

The execution plan cost is different in the two databases for the same query.

is it possible to copy the execution to another plan.

Thank you in advance

Kind regards

REDA

Jr.Raj wrote:

There are a few differences.

The machine that has a high cost, has setup up, linux, 2-node RAC, more CPU.

and

other machine windows server less Setup and less cpus.

Please explain, cost really makes a difference.

Thank you & best regards

REDA

You simply can't compare costs like that. It does not work like that. Especially through two different systems.  Here is a very good read: column the COST of the PLAN to EXPLAIN. Oracle FAQ

Tags: Database

Similar Questions

  • Is there an easy way to merge the two databases?

    I would like to know if there is an easy way to merge two data from a single database?

    The two databases are generated on different machines with different data (no duplicates).


    Thank you!



    Mark

    It is possible that the db_dump and db_load utilities can be used here.   They are documented in the BDB C API reference manual.      Basic process would be to empty the database on a system, move the files to the other system can use db_load and load it into the existing db.    Since there is no duplicate, this process should work for you.

    Thank you

    Mike

  • Synchronization between two databases with only 2% of the data; Please help me

    Hi all

    I have two oracle databases in 2 different servers PROD and TEST instances. the two databases are in gr 10 2 in linux servers.

    My PROD database contains about 300 GB of data and is dedicated for production area.
    My Test database is dedicated to Spanish test for PROD database. (small server in terms of space and RAM comparing to PROD db)
    I would like to synchronize every week TEST db with PROD db with only 2% of the data and all the structures
    Could someone tell me, if you use a datapump export I can import only 2% of the amount of data and the structures ot theere is another way to do it?
    Thank you very much

    best regards,
    W

    I'm not really sure what you're talking about. There is no option, expdp and impdp x % of the data, is that? And if Oracle can sovle repositories inetegrity (PK, FK), it cannot be assumed which tables are lookup table (to be entirely exported) and can not assume the logical data integrity.

    Nicolas.

  • on the remote database table relationship

    I have databases @orcl1 and @orcl2. I built relationships join of a table of @orcl1 with three tables of @orcl2. What are the performance? The two database are not on the same server.

    Published by: dealer on December 10, 2008 23:48

    Hello
    I meant create mview in @orcl2 based on the data you needed from @orcl1. Once you have located mview in @orcl2, then set your relationship with mview and other tables join in @orcl2.

    Hope this helps

    Concerning

  • Unable to connect to the local database (without using the tnsname)

    Hi guys
    I have 2 database running on the local computer.

    Db1 SID - orcl (install 1)
    DB2 SID - unicode (later installation)


    Today I stop the basic unicode and stop its respective services.

    on the back
    I did a sqlplus scott/tiger, I got an error
    ORA-12560: TNS:protocol adapter error

    That's why
    I did a
    Set ORACLE_SID = orcl

    and I still get the same error.
    -------------------------------------------------

    So I'm the other way around. I orcl database stop, stop its services and database unicode to START and its services.

    I disassembled the ORACLE_SID environment variable.

    Now, I have in the command prompt
    sqlplus scott/tiger

    I am connected to the unicode database!
    -------------------------------------------------

    Now I ORCL stop unicode data and start...

    and I have a
    sqlplus scott/tiger@ORCL...

    I HAVE no problem to connect to it...
    --------------------------------------------------

    May I ask why should I provide the TNSname ORCL database and I do not for the UNICODE of the databases...
    Both are local on my database.

    What's wrong?

    Moreover, I am on XP.
    Thank you!

    Set ORACLE_SID = orcl
    sqlplus / as sysdba;
    sys@ORCL > exit

    Set ORACLE_SID = unicode
    sqlplus / as sysdba;
    sys@Unicode > exit

    Well, we know that both your DBs are working properly.

    So out of curiosity, I did cela tests...
    (1) connect the two database and stop
    (2) stop their services
    (3) start only ORCL service
    (4) close and reopen the command prompt to delete the var of environment ORACLE_SID

    sqlplus / as sysdba;
    Error: ORA-12560: TNS: Protocol adapter error

    (5) now I stop service ORCL
    (6) (and I start the service of UNICODE)

    then I deliver

    sqlplus / as sysdba;
    sys@Unicode >

    It seems quite normal. In your registry value ORACLE_SID is, most likely, unicode, the last created: check it out, and if so, you can connect to unicode DB without setting ORACLE_SID, while you will need to set to connect to DB orcl.

    When you have more than one DB, you set the ORACLE_SID environment variable before connecting either you use connection strings.

  • Why I have two different execution plans for the same query on two different servers

    Hello everyone.

    I need your help to solve the problem quickly.

    In a nutshell, we have two servers that have the same version of Oracle RDBMS (11.2.0.4 EE). One of them for purposes of development and another is a production one.

    We have therefore two different execution plans for the same query executed on both servers. The only case of execution is OK and another is too slow.

    So I have to slow down the work of query using the same scheme to explain that young.

    Fence wire.

  • Same SQL different execution Plans in two different database instances.

    Hi all

    I run a different query on two instances of database. On one instance, the query takes 30 minutes and the other it takes 10 hours to complete. Data on the two instances are the same. When I generated the execution plan, on the two cases, it was different.

    OS: Redhat Linux 5
    Database version: 11.2.02 (on two instances)

    Plan on 1 Instance that takes 30 minutes.
    SELECT 
         X_REPLEN_RQST_INV_STG.BUSINESS_UNIT, 
         NVL(SUBSTR (W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, 
         INSTR(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, '~', -1, 1) - LENGTH(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM)),'N/A') AS DOC_ID, 
         W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_ITEM, 
         W_PURCH_SCHEDULE_LINE_F.PURCH_SCHEDULE_NUM, 
         X_REPLEN_RQST_INV_STG.INV_ITEM_ID, 
         X_REPLEN_RQST_INV_STG.PROCESS_DATE AS REPLEN_PROCESS_DT, 
         X_REPLEN_RQST_INV_STG.EXPECTED_DATE AS REPLEN_EXPECTED_DT, 
         X_REPLEN_RQST_INV_STG.REORDER_QTY AS REPLEN_REORDER_QTY, 
         X_ITEM_ATTRIB_D.REPLENISH_CLASS AS REPLEN_CLASS, 
         X_REPLEN_RQST_INV_STG.REPLEN_STATUS, 
         X_REPLEN_RQST_INV_STG.REPLENISH_TYPE AS REPLEN_TYPE, 
         X_REPLEN_RQST_INV_STG.REQ_ID, 
         X_REPLEN_RQST_INV_STG.REQ_LINE_NBR, 
         X_REPLEN_RQST_INV_STG.REQ_SCHED_NBR, 
         X_REPLEN_RQST_INV_STG.REQ_DISTRIB_NBR, 
         P.FIRST_PO_DISP_DT, 
         W_PURCH_SCHEDULE_LINE_F.DATASOURCE_NUM_ID
    FROM 
         X_REPLEN_RQST_INV_STG LEFT OUTER JOIN W_RQSTN_LINE_COST_F 
                   ON X_REPLEN_RQST_INV_STG.RQSTN_LN_COST_INTG_ID = W_RQSTN_LINE_COST_F.INTEGRATION_ID 
                        AND X_REPLEN_RQST_INV_STG.DATASOURCE_NUM_ID = W_RQSTN_LINE_COST_F.DATASOURCE_NUM_ID 
         LEFT OUTER JOIN W_PURCH_COST_F 
                   ON W_RQSTN_LINE_COST_F.INTEGRATION_ID = W_PURCH_COST_F.REQ_DISTR_INTG_ID 
                        AND W_RQSTN_LINE_COST_F.DATASOURCE_NUM_ID = W_PURCH_COST_F.DATASOURCE_NUM_ID 
         INNER join W_PURCH_SCHEDULE_LINE_F 
                   ON W_PURCH_COST_F.PURCH_SCHEDULE_INTG_ID = W_PURCH_SCHEDULE_LINE_F.INTEGRATION_ID 
                        AND W_PURCH_COST_F.DATASOURCE_NUM_ID = W_PURCH_SCHEDULE_LINE_F.DATASOURCE_NUM_ID 
         LEFT OUTER JOIN W_STATUS_D S1 
                   ON W_RQSTN_LINE_COST_F.APPROVAL_STATUS_WID = S1.ROW_WID 
                        AND W_RQSTN_LINE_COST_F.DATASOURCE_NUM_ID = S1.DATASOURCE_NUM_ID 
                        AND 'PURCH_APPROVE' = S1.W_STATUS_CLASS 
         LEFT OUTER JOIN W_STATUS_D S2 
                   ON W_PURCH_COST_F.APPROVAL_STATUS_WID = S2.ROW_WID 
                        AND W_PURCH_COST_F.DATASOURCE_NUM_ID = S2.DATASOURCE_NUM_ID 
                        AND 'PURCH_APPROVE' = S2.W_STATUS_CLASS 
         LEFT OUTER JOIN (SELECT p1.BUSINESS_UNIT, p1.PO_ID, MIN(p1.DATETIME_DISP) AS FIRST_PO_DISP_DT
    FROM 
              X_PS_PO_DISPATCHED p1 GROUP BY p1.BUSINESS_UNIT, p1.PO_ID) P 
                   ON SUBSTR (W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, 1, INSTR(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, '~', 1, 1)-1) = P.BUSINESS_UNIT 
                        AND SUBSTR (W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, INSTR(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, '~', -1, 1) - LENGTH(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM)) = 
    
    P.PO_ID      
         LEFT OUTER JOIN W_PRODUCT_D 
                   ON W_PURCH_SCHEDULE_LINE_F.PRODUCT_WID = W_PRODUCT_D.ROW_WID 
         LEFT OUTER JOIN X_ITEM_ATTRIB_D 
                   ON SUBSTR (W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, 1, INSTR(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, '~', 1, 1)-1) = X_ITEM_ATTRIB_D.BUSINESS_UNIT 
                        AND W_PRODUCT_D.PART_NUM = X_ITEM_ATTRIB_D.INV_ITEM_ID
    WHERE 
         TRIM(X_REPLEN_RQST_INV_STG.req_id) IS NOT NULL 
         AND X_REPLEN_RQST_INV_STG.replenish_type = '1' 
         AND X_REPLEN_RQST_INV_STG.replen_status = '4' 
         AND X_ITEM_ATTRIB_D.REPLENISH_CLASS = 'A' 
         AND S1.STATUS_CODE != 'X' 
         AND S2.STATUS_CODE != 'X' 
         AND P.FIRST_PO_DISP_DT IS NOT NULL
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1674299164
    
    ----------------------------------------------------------------------------------------------------------------
    | Id  | Operation                            | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                     |                         |     1 |   461 | 13942   (1)| 00:04:11 |
    |*  1 |  HASH JOIN                           |                         |     1 |   461 | 13942   (1)| 00:04:11 |
    |   2 |   NESTED LOOPS                       |                         |       |       |            |          |
    |   3 |    NESTED LOOPS                      |                         |     1 |   441 | 10409   (1)| 00:03:08 |
    |   4 |     NESTED LOOPS                     |                         |     1 |   421 | 10407   (1)| 00:03:08 |
    |   5 |      NESTED LOOPS                    |                         |     1 |   388 | 10406   (1)| 00:03:08 |
    |   6 |       NESTED LOOPS                   |                         |     1 |   319 | 10405   (1)| 00:03:08 |
    |   7 |        NESTED LOOPS                  |                         |     1 |   280 | 10404   (1)| 00:03:08 |
    |*  8 |         HASH JOIN                    |                         |     1 |   220 | 10401   (1)| 00:03:08 |
    |   9 |          NESTED LOOPS                |                         |       |       |            |          |
    |  10 |           NESTED LOOPS               |                         |    16 |  2896 | 10392   (1)| 00:03:08 |
    |* 11 |            TABLE ACCESS FULL         | X_REPLEN_RQST_INV_STG   |    16 |  2432 | 10375   (1)| 00:03:07 |
    |* 12 |            INDEX UNIQUE SCAN         | W_RQST_LN_CS_F_U1       |     1 |       |     1   (0)| 00:00:01 |
    |  13 |           TABLE ACCESS BY INDEX ROWID| W_RQSTN_LINE_COST_F     |     1 |    29 |     2   (0)| 00:00:01 |
    |* 14 |          TABLE ACCESS FULL           | W_STATUS_D              |     1 |    39 |     8   (0)| 00:00:01 |
    |  15 |         TABLE ACCESS BY INDEX ROWID  | W_PURCH_COST_F          |     1 |    60 |     3   (0)| 00:00:01 |
    |* 16 |          INDEX RANGE SCAN            | W_PURCH_COST_F_M1       |     1 |       |     2   (0)| 00:00:01 |
    |* 17 |        TABLE ACCESS BY INDEX ROWID   | W_STATUS_D              |     1 |    39 |     1   (0)| 00:00:01 |
    |* 18 |         INDEX UNIQUE SCAN            | W_STATUS_D_P1           |     1 |       |     0   (0)| 00:00:01 |
    |  19 |       TABLE ACCESS BY INDEX ROWID    | W_PURCH_SCHEDULE_LINE_F |     1 |    69 |     1   (0)| 00:00:01 |
    |* 20 |        INDEX UNIQUE SCAN             | W_PRCH_SC_LN_F_U1       |     1 |       |     1   (0)| 00:00:01 |
    |  21 |      TABLE ACCESS BY INDEX ROWID     | W_PRODUCT_D             |     1 |    33 |     1   (0)| 00:00:01 |
    |* 22 |       INDEX UNIQUE SCAN              | W_PRODUCT_D_P1          |     1 |       |     0   (0)| 00:00:01 |
    |* 23 |     INDEX RANGE SCAN                 | X_ITEM_ATTRIB_U01       |     1 |       |     1   (0)| 00:00:01 |
    |* 24 |    TABLE ACCESS BY INDEX ROWID       | X_ITEM_ATTRIB_D         |     1 |    20 |     2   (0)| 00:00:01 |
    |  25 |   VIEW                               |                         |  1428K|    27M|  3529   (2)| 00:01:04 |
    |* 26 |    FILTER                            |                         |       |       |            |          |
    |  27 |     HASH GROUP BY                    |                         |  1428K|    27M|  3529   (2)| 00:01:04 |
    |  28 |      TABLE ACCESS FULL               | X_PS_PO_DISPATCHED      |  1428K|    27M|  3493   (1)| 00:01:03 |
    ----------------------------------------------------------------------------------------------------------------
    On the Instance 2
    SELECT 
         X_REPLEN_RQST_INV_STG.BUSINESS_UNIT, 
         NVL(SUBSTR (W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, 
         INSTR(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, '~', -1, 1) - LENGTH(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM)),'N/A') AS DOC_ID, 
         W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_ITEM, 
         W_PURCH_SCHEDULE_LINE_F.PURCH_SCHEDULE_NUM, 
         X_REPLEN_RQST_INV_STG.INV_ITEM_ID, 
         X_REPLEN_RQST_INV_STG.PROCESS_DATE AS REPLEN_PROCESS_DT, 
         X_REPLEN_RQST_INV_STG.EXPECTED_DATE AS REPLEN_EXPECTED_DT, 
         X_REPLEN_RQST_INV_STG.REORDER_QTY AS REPLEN_REORDER_QTY, 
         X_ITEM_ATTRIB_D.REPLENISH_CLASS AS REPLEN_CLASS, 
         X_REPLEN_RQST_INV_STG.REPLEN_STATUS, 
         X_REPLEN_RQST_INV_STG.REPLENISH_TYPE AS REPLEN_TYPE, 
         X_REPLEN_RQST_INV_STG.REQ_ID, 
         X_REPLEN_RQST_INV_STG.REQ_LINE_NBR, 
         X_REPLEN_RQST_INV_STG.REQ_SCHED_NBR, 
         X_REPLEN_RQST_INV_STG.REQ_DISTRIB_NBR, 
         P.FIRST_PO_DISP_DT, 
         W_PURCH_SCHEDULE_LINE_F.DATASOURCE_NUM_ID
    FROM 
         X_REPLEN_RQST_INV_STG LEFT OUTER JOIN W_RQSTN_LINE_COST_F 
                   ON X_REPLEN_RQST_INV_STG.RQSTN_LN_COST_INTG_ID = W_RQSTN_LINE_COST_F.INTEGRATION_ID 
                        AND X_REPLEN_RQST_INV_STG.DATASOURCE_NUM_ID = W_RQSTN_LINE_COST_F.DATASOURCE_NUM_ID 
         LEFT OUTER JOIN W_PURCH_COST_F 
                   ON W_RQSTN_LINE_COST_F.INTEGRATION_ID = W_PURCH_COST_F.REQ_DISTR_INTG_ID 
                        AND W_RQSTN_LINE_COST_F.DATASOURCE_NUM_ID = W_PURCH_COST_F.DATASOURCE_NUM_ID 
         INNER join W_PURCH_SCHEDULE_LINE_F 
                   ON W_PURCH_COST_F.PURCH_SCHEDULE_INTG_ID = W_PURCH_SCHEDULE_LINE_F.INTEGRATION_ID 
                        AND W_PURCH_COST_F.DATASOURCE_NUM_ID = W_PURCH_SCHEDULE_LINE_F.DATASOURCE_NUM_ID 
         LEFT OUTER JOIN W_STATUS_D S1 
                   ON W_RQSTN_LINE_COST_F.APPROVAL_STATUS_WID = S1.ROW_WID 
                        AND W_RQSTN_LINE_COST_F.DATASOURCE_NUM_ID = S1.DATASOURCE_NUM_ID 
                        AND 'PURCH_APPROVE' = S1.W_STATUS_CLASS 
         LEFT OUTER JOIN W_STATUS_D S2 
                   ON W_PURCH_COST_F.APPROVAL_STATUS_WID = S2.ROW_WID 
                        AND W_PURCH_COST_F.DATASOURCE_NUM_ID = S2.DATASOURCE_NUM_ID 
                        AND 'PURCH_APPROVE' = S2.W_STATUS_CLASS 
         LEFT OUTER JOIN (SELECT p1.BUSINESS_UNIT, p1.PO_ID, MIN(p1.DATETIME_DISP) AS FIRST_PO_DISP_DT
    FROM 
              X_PS_PO_DISPATCHED p1 GROUP BY p1.BUSINESS_UNIT, p1.PO_ID) P 
                   ON SUBSTR (W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, 1, INSTR(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, '~', 1, 1)-1) = P.BUSINESS_UNIT 
                        AND SUBSTR (W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, INSTR(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, '~', -1, 1) - LENGTH(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM)) = 
    
    P.PO_ID      
         LEFT OUTER JOIN W_PRODUCT_D 
                   ON W_PURCH_SCHEDULE_LINE_F.PRODUCT_WID = W_PRODUCT_D.ROW_WID 
         LEFT OUTER JOIN X_ITEM_ATTRIB_D 
                   ON SUBSTR (W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, 1, INSTR(W_PURCH_SCHEDULE_LINE_F.PURCH_ORDER_NUM, '~', 1, 1)-1) = X_ITEM_ATTRIB_D.BUSINESS_UNIT 
                        AND W_PRODUCT_D.PART_NUM = X_ITEM_ATTRIB_D.INV_ITEM_ID
    WHERE 
         TRIM(X_REPLEN_RQST_INV_STG.req_id) IS NOT NULL 
         AND X_REPLEN_RQST_INV_STG.replenish_type = '1' 
         AND X_REPLEN_RQST_INV_STG.replen_status = '4' 
         AND X_ITEM_ATTRIB_D.REPLENISH_CLASS = 'A' 
         AND S1.STATUS_CODE != 'X' 
         AND S2.STATUS_CODE != 'X' 
         AND P.FIRST_PO_DISP_DT IS NOT NULL
    
    
    ---------------------------------------------------------------------------------------------------------------
    | Id  | Operation                           | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                    |                         |     1 |   420 | 19630   (1)| 00:04:35 |
    |   1 |  NESTED LOOPS                       |                         |       |       |            |       |
    |   2 |   NESTED LOOPS                      |                         |     1 |   420 | 19630   (1)| 00:04:35 |
    |   3 |    NESTED LOOPS                     |                         |     1 |   400 | 19627   (1)| 00:04:35 |
    |   4 |     NESTED LOOPS                    |                         |     1 |   386 | 19626   (1)| 00:04:35 |
    |   5 |      NESTED LOOPS                   |                         |     1 |   317 | 19625   (1)| 00:04:35 |
    |   6 |       NESTED LOOPS                  |                         |     1 |   289 | 19624   (1)| 00:04:35 |
    |   7 |        NESTED LOOPS                 |                         |     1 |   229 | 19621   (1)| 00:04:35 |
    |   8 |         NESTED LOOPS                |                         |     1 |   201 | 19620   (1)| 00:04:35 |
    |   9 |          MERGE JOIN CARTESIAN       |                         |     1 |   172 | 19619   (1)| 00:04:35 |
    |  10 |           VIEW                      |                         |     1 |    20 |  4942   (2)| 00:01:10 |
    |* 11 |            FILTER                   |                         |       |       |            |       |
    |  12 |             HASH GROUP BY           |                         |     1 |    20 |  4942   (2)| 00:01:10 |
    |  13 |              TABLE ACCESS FULL      | X_PS_PO_DISPATCHED      |  1428K|    27M|  4902   (1)| 00:01:09 |
    |  14 |           BUFFER SORT               |                         |     1 |   152 | 19619   (1)| 00:04:35 |
    |* 15 |            TABLE ACCESS FULL        | X_REPLEN_RQST_INV_STG   |     1 |   152 | 14676   (1)| 00:03:26 |
    |  16 |          TABLE ACCESS BY INDEX ROWID| W_RQSTN_LINE_COST_F     |     1 |    29 |     1   (0)| 00:00:01 |
    |* 17 |           INDEX UNIQUE SCAN         | W_RQST_LN_CS_F_U1       |     1 |       |     1   (0)| 00:00:01 |
    |* 18 |         TABLE ACCESS BY INDEX ROWID | W_STATUS_D              |     1 |    28 |     1   (0)| 00:00:01 |
    |* 19 |          INDEX UNIQUE SCAN          | W_STATUS_D_P1           |     1 |       |     0   (0)| 00:00:01 |
    |  20 |        TABLE ACCESS BY INDEX ROWID  | W_PURCH_COST_F          |     3 |   180 |     3   (0)| 00:00:01 |
    |* 21 |         INDEX RANGE SCAN            | W_PURCH_COST_F_M1       |     1 |       |     2   (0)| 00:00:01 |
    |* 22 |       TABLE ACCESS BY INDEX ROWID   | W_STATUS_D              |     1 |    28 |     1   (0)| 00:00:01 |
    |* 23 |        INDEX UNIQUE SCAN            | W_STATUS_D_P1           |     1 |       |     0   (0)| 00:00:01 |
    |* 24 |      TABLE ACCESS BY INDEX ROWID    | W_PURCH_SCHEDULE_LINE_F |     1 |    69 |     1   (0)| 00:00:01 |
    |* 25 |       INDEX UNIQUE SCAN             | W_PRCH_SC_LN_F_U1       |     1 |       |     1   (0)| 00:00:01 |
    |* 26 |     TABLE ACCESS BY INDEX ROWID     | W_PRODUCT_D             |     1 |    14 |     1   (0)| 00:00:01 |
    |* 27 |      INDEX UNIQUE SCAN              | W_PRODUCT_D_P1          |     1 |       |     0   (0)| 00:00:01 |
    |* 28 |    INDEX RANGE SCAN                 | X_ITEM_ATTRIB_U01       |     1 |       |     2   (0)| 00:00:01 |
    |* 29 |   TABLE ACCESS BY INDEX ROWID       | X_ITEM_ATTRIB_D         |     1 |    20 |     3   (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------------------------
    In the second execution plan, we can see that it uses a Cartesian product.

    Thank you.

    Oceaner wrote:
    Hi all

    I run a different query on two instances of database. On one instance, the query takes 30 minutes and the other it takes 10 hours to complete. Data on the two instances are the same. When I generated the execution plan, on the two cases, it was different.

    The most obvious difference is the subquery total inline:

    Quick plan:

    ----------------------------------------------------------------------------------------------------------------
    | Id  | Operation                            | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------------------------------------------
    |*  1 |  HASH JOIN                           |                         |     1 |   461 | 13942   (1)| 00:04:11 |
    |   2 |   NESTED LOOPS                       |                         |       |       |            |          |
    ...
    |  25 |   VIEW                               |                         |  1428K|    27M|  3529   (2)| 00:01:04 |
    |* 26 |    FILTER                            |                         |       |       |            |          |
    |  27 |     HASH GROUP BY                    |                         |  1428K|    27M|  3529   (2)| 00:01:04 |
    |  28 |      TABLE ACCESS FULL               | X_PS_PO_DISPATCHED      |  1428K|    27M|  3493   (1)| 00:01:03 |
    ----------------------------------------------------------------------------------------------------------------
    

    Plan of slow

    ---------------------------------------------------------------------------------------------------------------
    | Id  | Operation                           | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------------------------
    ...
    |   9 |          MERGE JOIN CARTESIAN       |                         |     1 |   172 | 19619   (1)| 00:04:35 |
    |  10 |           VIEW                      |                         |     1 |    20 |  4942   (2)| 00:01:10 |
    |* 11 |            FILTER                   |                         |       |       |            |          |
    |  12 |             HASH GROUP BY           |                         |     1 |    20 |  4942   (2)| 00:01:10 |
    |  13 |              TABLE ACCESS FULL      | X_PS_PO_DISPATCHED      |  1428K|    27M|  4902   (1)| 00:01:09 |
    |  14 |           BUFFER SORT               |                         |     1 |   152 | 19619   (1)| 00:04:35 |
    |* 15 |            TABLE ACCESS FULL        | X_REPLEN_RQST_INV_STG   |     1 |   152 | 14676   (1)| 00:03:26 |
    ...
    ---------------------------------------------------------------------------------------------------------------
    

    Note the value of lines given to the operation - VIEW


    One for the slow plan - that of why Oracle chose display online as a starting point for the query and used a Cartesian merge join to join to the table nearby.

    1.4Million for the fast plan - this is why Oracle has decided to visit the table set and use it as the table of the probe in a hash join.

    I think we can assume that the estimation of the single line is a big mistake. We can also assume that the two series of statistics (or possibly index definitions) on the tables two versions do not match.

    It would be useful, of course, see the comprehensive implementation plan, and preferably one from memory: (http://jonathanlewis.wordpress.com/2006/12/22/dbms_xplan-again/).

    You might notice that you outer joins are not relevant - maybe this SQL is a framework for a more general query - given that the plan shows that they have all been turned away.

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    Author: core Oracle

  • The execution plan changes for the same query.

    Hi all

    This issue was raised before also, but still not able to find the real cause of this.

    Thread1:
    Re: Research of fragmentation of the table in Oracle 8.1.6.3.0

    Thread2:
    CBC latch and buffer busy await you on the same table.

    It comes, sometimes hammers server 100% CPU utilization with free latch and buffer busy wait events.

    We found a single query consumes high CPU usage that is run by different sessions.

    This query have two types of execution plans, where one is accurate and is not (its primary key hit index index no appropriate means present on the table)

    Because its primary key index hit repeatedly at various sessions, some sessions are powerful db file sequential read and a few sessions waiting buffer busy waits for event. Also during this time a few sessions waiting for latch free event.

    My doubt is how to sql even with different literal values execution plan changes and causes a prob.
    select count(*),event from v$session_wait group by event;
      COUNT(*) EVENT
    ---------- ----------------------------------------------------------------
           165 SQL*Net message from client
             1 SQL*Net message to client
             3 buffer busy waits
             2 db file parallel read
            18 db file sequential read
            10 latch free
             5 log file sync
             1 pmon timer
             6 rdbms ipc message
             1 smon timer
    
    SQL> select sid from v$session_wait where event='db file sequential read';
           SID
    ----------
            26
            58
            82
           107
           116
           223
           212
           203
           192
           173
           161
           157
           150
           147
           254
           238
           229
           112
           101
            81
            68
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 161
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=161
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    4231             161      49569 oracle@tfrdb3 (TNS V1-V3)
    
    
    SQL> select sql_text
    from v$process a,
         v$session b,  2    3
         v$sql c
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and
        a.spid = &PID;  4    5    6    7
    Enter value for pid: 4231
    old   7:     a.spid = &PID
    new   7:     a.spid = 4231
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM LOG WHERE ID = '09292AMR
    10B41FE' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'234225222' OR TYPE =
     18 AND LOG_SEQ='234225222') ORDER BY TIME_STAMP ASC
    
    SQL> set autotrace traceonly exp
    SQL> SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM amrwf1.LOG WHERE ID = '09292AMR10B41FE' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'234225222' OR TYPE =18 AND LOG_SEQ='234225222') ORDER BY TIME_STAMP ASC;
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=11 Card=2 Bytes=126)
       1    0   SORT (ORDER BY) (Cost=11 Card=2 Bytes=126)
       2    1     CONCATENATION
       3    2       TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=4 Card=1
              Bytes=63)
    
       4    3         INDEX (UNIQUE SCAN) OF 'PK_LOG_LOG_SEQ' (UNIQUE) (Co
              st=3 Card=1)
    
       5    2       TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=4 Card=1
              Bytes=63)
    
       6    5         INDEX (RANGE SCAN) OF 'PK_LOG_LOG_SEQ' (UNIQUE) (Cos
              t=3 Card=1)
    
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 147
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=147
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    6255             147      38306 oracle@tfrdb3 (TNS V1-V3)
    
    SQL> select sql_text
    from v$process a,
         v$session b,
         v$sql c  2    3
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and
        a.spid = &PID;  4    5    6    7
    Enter value for pid: 6255
    old   7:     a.spid = &PID
    new   7:     a.spid = 6255
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM LOG WHERE ID = '09273AMR
    62B4894' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'223324996' OR TYPE =
     18 AND LOG_SEQ='223324996') ORDER BY TIME_STAMP ASC
    
    
    SQL> set autotrace traceonly exp
    SQL> SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM amrwf1.LOG WHERE ID = '09273AMR62B4894' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'223324996' OR TYPE =18 AND LOG_SEQ='223324996') ORDER BY TIME_STAMP ASC;
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1538 Card=736 Bytes=
              46368)
    
       1    0   SORT (ORDER BY) (Cost=1538 Card=736 Bytes=46368)
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=1527 Card=7
              36 Bytes=46368)
    
       3    2       INDEX (RANGE SCAN) OF 'LOG_ID' (NON-UNIQUE) (Cost=32 C
              ard=736)
    
    
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 82
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=82
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    6172              82      45378 oracle@tfrdb3 (TNS V1-V3)
    
    
    SQL> select sql_text
    from v$process a,
         v$session b,
         v$sql c
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and  2
      3      a.spid = &PID;  4    5    6    7
    Enter value for pid: 6172
    old   7:     a.spid = &PID
    new   7:     a.spid = 6172
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    How to avoid this... why its different execution plan using (I mean bad index PK)

    Is it possible to avoid this?

    If any details please check out some of my previous post on this specific URL (above)

    -Yasser

    My doubt is how to sql even with different literal values execution plan changes and causes a prob.

    Different literal values cause analysis difficult.
    Hard analysis includes the re-evaluation of the best path.
    Literal value is included in the assessment of the selectivity for the scan interval (log_seq >...)

    See
    http://www.centrexcc.com/A%20Look%20under%20The%20Hood%20Of%20CBO%20-%20The%2010053%20Event.ppt.PDF
    http://www.centrexcc.com/fallacies%20Of%20The%20Cost%20Based%20Optimizer.PDF
    more the book of Jonathan Lewis which other threads, I believe that you already have.

    You must lower your CPU.
    Previous discussions, if the situation is still the same, it sounded like hard analysis particularly with this SELECTION against the NEWSPAPER plays an important role in that.

    How to avoid this... why its different execution plan using (I mean bad index PK)

    The points raised in the previous discussion remain valid.
    -Do you have access to this SQL to change?
    for example using bind variable or trick it if necessary due to problems caused by data as discussed in the previous thread.
    - Or you could it repoint the view to a view and a hint?
    -If a particular user makes this sql, could affect you cursor_sharing just for this user. If not, you should consider implementing pan-Canadian database.

    Oracle 8.1.6 still?

  • Find child cursors due to changes in the execution plan

    Hi all

    I have a situation to provide the list of execution of the plan for a particular SQL_ID. The particular SQL toggles between 2 paths (FTS and Index scan), but at this point in time, I can see that a single (current) plan_hash_value for instruction. That is to say - the previous cursor gets disabled (due to a statistical series application package which in turn disabled the previous cursor - this is my guess).

    I can get it from dba_hist_sqlstat for the specific SQL, but curious, it is only possible to get it from the dynamic views such as V$ SQL and V$ SQLAREA for a list of all the plan_hash_values for a particular SQL, where the child_number is 0.

    Any idea please?

    Note: I am interested to extract cursors of the child due to the execution of different cursors of the regime and not child created because different settings for the same plan (mode ex-optimizer etc...)

    > is it possible to capture the two dynamic views PHV even if the first cursor is invalidated

    Once it is invalid, it is out!  Is no longer present.

    Hemant K Collette

  • Should I wait until the end of the execution time of the query for the execution plan?

    Hello Experts,

    I want to see the execution plan of the query below. However, it takes more than 3 hours. Should I wait all the time to see the execution plan?

    Note: EXPLAIN PLAN for does not work. (I mean that I do not see the actual line number, etc. with EXPLAIN the PLAN of market)

    You can see the output of the execution plan when I canceled the execution after 1 minute.

    My first question is: what should I do to see the execution plan for queries running out of time time?

    2nd question: when I cancel the query during execution in order to see the execution plan, will I see the specific plan of execution or erroneous values? Because the first execution plan seems inaccurate, what do you think?

    question 3: why EXPLAIN the PLAN for the clause does not work? Also, should I use EXPLAIN the PLAN of the clause to this scenerio? Can I see the result of running for long time without her queries?

    Thnaks for your help.

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    PL/SQL Release 11.2.0.2.0 - Production

    CORE Production 11.2.0.2.0

    AMT for Linux: Version 11.2.0.2.0 - Production

    NLSRTL Version 11.2.0.2.0 - Production

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price

    of custinvoicejour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) = substr (nls_lower (t.dataareaid), 1, 7) and

    substr (nls_lower (J.INVOICEID), 1: 25) = substr (nls_lower (t.INVOICEID), 1: 25)

    where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM = 29457

    and substr (nls_lower (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in

    (select IT. Drmpos.avtr_seg_cust_campend ACCOUNTNUM this where THIS. CAMPAIGN = '201406' and THIS. SEGMENT_LEVEL in (', 'E'))

    and J.AVAWARDSALES > 190

    and substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406'

    "and J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 ';

    SQL_ID, dznya6x7st0t8, number of children 0

    -------------------------------------

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT,.

    J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price of

    CustInvoiceJour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) =

    substr (nls_lower (t.DataAreaId), 1, 7) and

    = substr (nls_lower (J.INVOICEID), 1: 25)

    substr (nls_lower (t.INVOICEID), 1: 25) where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM =

    29457 and substr (nls_lower, (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in (select CE. ACCOUNTNUM of

    drmpos.avtr_seg_cust_campend this where THIS. CAMPAIGN = '201406' and

    IT. SEGMENT_LEVEL in (', 'E')) and J.AVAWARDSALES > 190 and

    substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406' and

    "J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 '.

    Hash value of plan: 2002317666

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                           | Begins | E - lines. A - lines.   A - time | Pads | Bed |  OMem |  1Mem | Used Mem.

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                                |      1.        |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    |*  1 |  HASH JOIN |                                |      1.   3956.      0 | 00:00:00.01 |       0 |      0 |  2254K |  1061K | 2190K (0) |

    |*  2 |   HASH JOIN |                                |      1.     87.  16676. 00:00:01.64 |     227K |   3552.  3109K |  1106K | 4111K (0) |

    |*  3 |    TABLE ACCESS BY INDEX ROWID | CUSTINVOICEJOUR |      1.   1155 |  31889 | 00:00:01.16 |     223KO |     15.       |       |          |

    |*  4 |     INDEX RANGE SCAN | I_062INVOICEDATEORDERTYPEIDX |      1.   4943 |    134K | 00:00:00.83 |   45440 |      0 |       |       |          |

    |   5.    SIMPLE LIST OF PARTITION.                                |      1.  82360 |    173K | 00:00:00.08 |    3809 |   3537 |       |       |          |

    |*  6 |     TABLE ACCESS FULL | AVTR_SEG_CUST_CAMPEND |      1.  82360 |    173K | 00:00:00.06 |    3809 |   3537 |       |       |          |

    |   7.   TABLE ACCESS BY INDEX ROWID | CUSTINVOICETRANS |      1.   4560 |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    |*  8 |    INDEX RANGE SCAN | I_064INVLINENUMCAMPAIGNOFPRICE |      1.   4560 |      0 | 00:00:00.01 |       0 |      0 |       |       |          |

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - access("J".") "SYS_NC00299$"="T". "' SYS_NC00165$ ' AND SUBSTR (NLS_LOWER ('J'. "" "" REFFACTURE")(, 1, 25) = SUBSTR (NLS_LOWER ("T"." "" "REFFACTURE")(, 1, 25)).

    2 - access("J".") INVOICEACCOUNT '= SYS_OP_C2C ("EC". ". ACCOUNTNUM'))

    3 - filter("J".") AVAWARDSALES"> 190)

    4 - access("J".") SYS_NC00299$ "= U ' 201"AND "J". INVOICEDATE"> = TO_DATE(' 2014-06-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND

    "J"." SYS_NC00307$ "= U ' 201406"AND "J". INVOICEDATE"< = TO_DATE (' 2014-06-13 00:00:00 ',' syyyy-mm-dd hh24:mi:ss')))

    filter ((' J'. "INVOICEDATE' > = 'J' AND TO_DATE(' 2014-06-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss') '." " SYS_NC00307$ "= U '201406' AND"

    "J"." INVOICEDATE"< = TO_DATE (' 2014-06-13 00:00:00 ',' syyyy-mm-dd hh24:mi:ss'))))

    6 filter (("CE". "SEGMENT_LEVEL" = A "OR"THIS"." SEGMENT_LEVEL "=" E"))

    8 - access("T".") SYS_NC00165$ "= U ' 201"AND "T". AVBROCHURELINENUM "= 29457)

    filter ("T". ("AVBROCHURELINENUM" = 29457)

    EXPLAIN PLAN FOR

    Select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * / J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE, (T.LINEAMOUNT + T.LINEAMOUNTTAX) price

    of custinvoicejour j join custinvoicetrans t on

    substr (nls_lower (j.DataAreaId), 1, 7) = substr (nls_lower (t.dataareaid), 1, 7) and

    substr (nls_lower (J.INVOICEID), 1: 25) = substr (nls_lower (t.INVOICEID), 1: 25)

    where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM = 29457

    and substr (nls_lower (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in

    (select IT. Drmpos.avtr_seg_cust_campend ACCOUNTNUM this where THIS. CAMPAIGN = '201406' and THIS. SEGMENT_LEVEL in (', 'E'))

    and J.AVAWARDSALES > 190

    and substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406'

    "and J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 ';

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR);

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR ('7h1nbzqjgwsp7', 2));

    SQL_ID, 7h1nbzqjgwsp7, number of children 2

    EXPLAIN PLAN for select / * + GATHER_PLAN_STATISTICS NO_PARALLEL * /.

    J.INVOICEACCOUNT, J.INVOICEID, J.INVOICEDATE,

    (T.LINEAMOUNT + T.LINEAMOUNTTAX) join price j custinvoicejour

    CustInvoiceTrans t on substr (nls_lower (j.dataareaid), 1, 7) =

    substr (nls_lower (t.DataAreaId), 1, 7) and

    = substr (nls_lower (J.INVOICEID), 1: 25)

    substr (nls_lower (t.INVOICEID), 1: 25) where

    substr (nls_lower (T.DATAAREAID), 1, 7) = '201' and T.AVBROCHURELINENUM =

    29457 and substr (nls_lower, (j.dataareaid), 1, 7) = '201' and

    J.INVOICEACCOUNT in (select CE. ACCOUNTNUM of

    drmpos.avtr_seg_cust_campend this where THIS. CAMPAIGN = '201406' and

    IT. SEGMENT_LEVEL in (', 'E')) and J.AVAWARDSALES > 190 and

    substr (nls_lower (J.AVBILLINGCAMPAIGN), 1, 13) = '201406' and

    "J.INVOICEDATE between ' 04.06.2014' and ' 13.06.2014 '.

    NOTE: cannot fetch SQL_ID plan: 7h1nbzqjgwsp7, CHILD_NUMBER: 2

    Check the value of SQL_ID and CHILD_NUMBER;

    It could also be that the plan is no longer in the cursor cache (check v$ sql_plan)

    NightWing wrote:

    Randolf,

    I don't understand. What you hear from the above statement that you mean A-lines and E will be incorrect, but the ratio between them remain the same. Therefore, you can deduct the bad things by comparing the differences.

    Thus, A-lines always give a wrong result for cancellation of queries, isn't it?

    Charlie,

    I think that Martin gave a good explanation. Here's another example that hopefully makes more obvious things:

    17:56:55 SQL >-things go very wrong here with a small buffer cache

    17:56:55 SQL >-T2 lines are badly scattered when you access through T1. FK

    17:56:55 SQL >--

    17:56:55 SQL >-"Small job" approach would have been a good idea

    17:56:55 SQL >-if the estimate of 100 iterations of the loop was correct!

    17:56:55 SQL > select

    17:56:55 (t2.attr2) count 2

    17:56:55 3 of

    17:56:55 4 t1

    17:56:55 5, t2

    17:56:55 6 where

    17:56:55   7  /*------------------*/

    17:56:55 8 trunc (t1.attr1) = 1

    17:56:55 9 and trunc (t1.attr2) = 1

    17:56:55 10 / *-* /.

    17:56:55 11 and t1.fk = t2.id

    17:56:55 12.

    T1

    *

    ERROR on line 4:

    ORA-01013: user has requested the cancellation of the current operation

    Elapsed time: 00:04:58.30

    18:01:53 SQL >

    18:01:53 SQL > @xplan_extended_display_cursor ' ' ' ' 'ALLSTATS LAST + COST.

    18:01:53 SQL > set echo off verify off termout off

    SQL_ID, 353msax56jvvp, number of children 0

    -------------------------------------

    SELECT count (t2.attr2) from t1, t2 where

    / / *-* trunc (t1.attr1) = 1 and

    trunc (T1.attr2) = 1 / *-* / and t1.fk = t2.id

    Hash value of plan: 2900488714

    ------------------------------------------------------------------------------------------------------------------------------------

    | ID | The NEST | DSB | Operation | Name | Begins | E - lines. Cost (% CPU). A - lines.   A - time | Pads | Bed |

    ------------------------------------------------------------------------------------------------------------------------------------

    |   0 |     |   7. SELECT STATEMENT |        |      1.        |  4999 (100) |      0 | 00:00:00.01 |       0 |      0 |

    |   1.   0 |   8 2 GLOBAL TRI |        |      1.      1.            |      0 | 00:00:00.01 |       0 |      0 |

    |   2.   1.   5.   NESTED LOOPS |        |      1.        |            |  57516 | 00:04:58.26 |     173K |  30770 |

    |   3.   2.   3.    NESTED LOOPS |        |      1.    100.  4999 (1) |  57516 | 00:00:21.06 |     116K |   3632.

    |*  4 |   3.   1.     TABLE ACCESS FULL | T1 |      1.    100.  4799 (1) |  57516 | 00:00:00.19 |    1008 |   1087 |

    |*  5 |   3.   2.     INDEX UNIQUE SCAN | T2_IDX |  57516 |      1.     1 (0) |  57516 | 00:00:20.82 |     115K |   2545 |

    |   8 2 2 |   4.    TABLE ACCESS BY INDEX ROWID | T2 |  57516 |      1.     2 (0) |  57516 | 00:04:37.14 |   57516 |  27138 |

    ------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    4 filter ((TRUNC ('T1'. "ATTR1") = 1 AND TRUNC ('T1'. " ATTR2') = 1))

    5 - access("T1".") FK '= 'T2'.' (ID')

    You say here that I canceled a query after about 5 minutes, and looking at the statistics of content (RowSource) I can already say the following:

    1. the estimation of cardinality of T1 is far - the optimizer estimated 100 lines, but it actually generated more than 57000 lines when the query was cancelled. If this definitely seems like a candidate at the origin of the problems

    2. the query has spent most of the time in search of random table T2

    So while it is true that I don't know final A-lines of this cancelled query information, I can still say a lot of this and begin to deal with the problems identified so far.

    Randolf

  • What is the correct procedure of DMBS_XPLAN for the query execution plan

    Hello.

    We are on Oracle 11.2.0.3 on Linux. I am dev. DBA and we have about 80 developers Java development team. They want to question the execution plan of queries to resolve the sqls. Generally, they use the GUI tools like the toad to see execution plan. I always use the procedure for the following query execution plan:

    
    

    Select * from
    Table (dbms_xplan.display_cursor (null, null, 'allstats + cost'));

    I should suggest that they use this too rather than rely on tools like the toad - because they can show estimated plan and not the actual plan. And to provide a sql, it is best to use the real plan to work with. Do not take account of 'allstats + cost' part in the command above, but my point is: should I ask them of still rely on sqlplus and not the GUI tools and use the command display_cursor package DBMS_XPLAN?

    I will be grateful for suggestions.

    OrauserN

    You must use the DBMS_XPLAN package and functionality.

    The tool used to run the package doesn't matter. A raw request to DISPLAY_CURSOR will run the same server code in any tool including Toad.

    If you rely on other GUI features (for example a "explain plan" button or similar) then you know what this feature of actuall application running under-the-covers.

    My suggestion would be to assess and consider using Oracle free sql developer version 4 because it is not only FREE but also uses the DBMS_XPLAN correctly.

    http://www.Oracle.com/technetwork/developer-tools/SQL-Developer/downloads/index.html?ssSourceSiteId=ocomen

  • Star_transformation not shoiwng in the execution plan

    Hello

    We have a data warehouse and processing star not no projection in the execution plan.

    STAR_TRANSFORMATION_ENABLED at the database level.

    With the help of 11.2.0.3 on AIX

    The fact table has index bitmap and fks to keys on tables dimesnion dimesnion.

    Example query
    select *
    from media m, retailer_transaction rt
    , retailer r
    where m.dimension_key = rt.plant_issue_id
    and rt.outlet_id = r.dimension_key
    and prod_num = 600
    Anthing we are ' % s '?

    Found how interrogate more selective cause said to use star_transformation

    added and plis_handled_year = 2013
    and out_num 123423

    Why is this good?

    Is there a rule such as only highly selective queries will use transformation star?

    Thank you

    Published by: user5716448 on February 15, 2013 04:10

    Transformation of Star I it'sactually one expensive thing to do. So, the optimizer plans an ABC on this subject. This quote comes from a piece on the blog of optimizer Oracle [url https://blogs.oracle.com/optimizer/entry/star_transformation]:

    "The transformation is performed based on cost - when the cost of the transformed plan is lower than that of the unprocessed plan. If dimension filters do not significantly reduce the amount of data to be extracted from the fact table, and then a full table scan is more effective. »

    Cheers, APC

  • An odd index in the execution plan name

    Hi all

    Today someone came to aks my help on setting a SQL. Follow-up is compositions of the entire plan. Although I resovled performance issue, I still don't understand why
    the index with the name "BIN$ ld5VAtb88PngQAB/AQF8hg == $0 ' similar appear in the plan."

    If I remember correctly, this kind of names mean the items in the Recycle Bin. But the index has been abandoned can be used in the execution plan?
    Someone sees potential problems involved with this kind of index name, index name, just please?

    Best regards
    Leon
    ---------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                                             | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                                      |                                |     1 |   231 |     5   (0)| 00:00:01 |
    |*  1 |  FILTER                                               |                                |       |       |            |          |
    |   2 |   TABLE ACCESS FULL                                   | TBL_SYS_USERS                  |   344 | 79464 |     5   (0)| 00:00:01 |
    |   3 |   NESTED LOOPS                                        |                                |     1 |    80 |    13   (0)| 00:00:01 |
    |*  4 |    TABLE ACCESS FULL                                  | TBL_SYS_DATA_ACCESS_RULES      |     1 |    54 |    13   (0)| 00:00:01 |
    |*  5 |    INDEX UNIQUE SCAN                                  | BIN$ld5VAtb88PngQAB/AQF8hg==$0 |     1 |    26 |     0   (0)| 00:00:01 |
    |   6 |     NESTED LOOPS                                      |                                |     1 |    80 |    13   (0)| 00:00:01 |
    |*  7 |      TABLE ACCESS FULL                                | TBL_SYS_DATA_ACCESS_RULES      |     1 |    54 |    13   (0)| 00:00:01 |
    |*  8 |      INDEX UNIQUE SCAN                                | BIN$ld5VAtb88PngQAB/AQF8hg==$0 |     1 |    26 |     0   (0)| 00:00:01 |
    |   9 |       NESTED LOOPS                                    |                                |     1 |    80 |    13   (0)| 00:00:01 |
    |* 10 |        TABLE ACCESS FULL                              | TBL_SYS_DATA_ACCESS_RULES      |     1 |    54 |    13   (0)| 00:00:01 |
    |* 11 |        INDEX UNIQUE SCAN                              | BIN$ld5VAtb88PngQAB/AQF8hg==$0 |     1 |    26 |     0   (0)| 00:00:01 |
    |* 12 |         TABLE ACCESS BY INDEX ROWID                   | TBL_SYS_EMPLOYEES              |     1 |    26 |     1   (0)| 00:00:01 |
    |* 13 |          INDEX UNIQUE SCAN                            | BIN$ld5VAtba8PngQAB/AQF8hg==$0 |     1 |       |     0   (0)| 00:00:01 |
    |* 14 |          TABLE ACCESS FULL                            | TBL_SYS_DATA_ACCESS_RULES      |     1 |    54 |    13   (0)| 00:00:01 |
    |* 15 |           TABLE ACCESS FULL                           | TBL_SYS_DATA_ACCESS_RULES      |     1 |    54 |    13   (0)| 00:00:01 |
    |* 16 |            TABLE ACCESS FULL                          | TBL_SYS_DATA_ACCESS_RULES      |     1 |    54 |    13   (0)| 00:00:01 |
    |* 17 |             TABLE ACCESS BY INDEX ROWID               | TBL_SYS_EMPLOYEES              |     1 |    26 |     1   (0)| 00:00:01 |
    |* 18 |              INDEX UNIQUE SCAN                        | BIN$ld5VAtba8PngQAB/AQF8hg==$0 |     1 |       |     0   (0)| 00:00:01 |
    |  19 |              NESTED LOOPS                             |                                |     1 |    80 |    14   (0)| 00:00:01 |
    |  20 |               TABLE ACCESS BY INDEX ROWID             | TBL_SYS_EMPLOYEES              |     1 |    26 |     1   (0)| 00:00:01 |
    |* 21 |                INDEX UNIQUE SCAN                      | BIN$ld5VAtba8PngQAB/AQF8hg==$0 |     1 |       |     0   (0)| 00:00:01 |
    |* 22 |               TABLE ACCESS FULL                       | TBL_SYS_DATA_ACCESS_RULES      |     1 |    54 |    13   (0)| 00:00:01 |
    |  23 |                NESTED LOOPS                           |                                |     1 |    80 |    14   (0)| 00:00:01 |

    user12064076 wrote:
    Hi all

    Today someone came to aks my help on setting a SQL. Follow-up is compositions of the entire plan. Although I resovled performance issue, I still don't understand why
    the index with the name "BIN$ ld5VAtb88PngQAB/AQF8hg == $0 ' similar appear in the plan."

    If I remember correctly, this kind of names mean the items in the Recycle Bin. But the index has been abandoned can be used in the execution plan?
    Someone sees potential problems involved with this kind of index name, index name, just please?

    Best regards
    Leon

    The simple answer is that the table has been abandoned and flashed then back to before the fall. When this happens, the table name is restored to its original name, but the index names are not restored. A quick to demonstrate test case.

    First, create us a table and an index, and then collect statistics:

    DROP TABLE T1 PURGE;
    
    CREATE TABLE T1 AS
    SELECT
      ROWNUM C1,
      RPAD('A',255,'A') C2
    FROM
      DUAL
    CONNECT BY
      LEVEL<=10000;
    
    COMMIT;
    
    CREATE INDEX IND_T1_C1 ON T1(C1);
    
    EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE)
    

    Then we will check that the index will be used with a sample SQL statement:

    
    SELECT
      C1,
      SUBSTR(C2,1,2)
    FROM
      T1
    WHERE
      C1<=5;
    
     C1 SU
    --- --
      1 AA
      2 AA
      3 AA
      4 AA
      5 AA
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
    
    PLAN_TABLE_OUTPUT
    -----------------------------------------------------------------------------------------
    SQL_ID  g0kkvxqg3v145, child number 0
    -------------------------------------
    SELECT   C1,   SUBSTR(C2,1,2) FROM   T1 WHERE   C1<=5
    
    Plan hash value: 683303157
    
    -----------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |       |       |     3 (100)|          |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |     5 |  1300 |     3   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IND_T1_C1 |     5 |       |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C1"<=5)
    

    The index has been used.

    Then, we will empty the trash, delete the index and see if it can still be used in an execution plan:

    PURGE RECYCLEBIN;
    
    DROP INDEX IND_T1_C1;
    
    SELECT
      C1,
      SUBSTR(C2,1,2)
    FROM
      T1
    WHERE
      C1<=5;
    
     C1 SU
    --- --
      1 AA
      2 AA
      3 AA
      4 AA
      5 AA
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------
    SQL_ID  g0kkvxqg3v145, child number 0
    -------------------------------------
    SELECT   C1,   SUBSTR(C2,1,2) FROM   T1 WHERE   C1<=5
    
    Plan hash value: 3617692013
    
    --------------------------------------------------------------------------
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      |       |       |   137 (100)|          |
    |*  1 |  TABLE ACCESS FULL| T1   |     5 |  1300 |   137   (5)| 00:00:01 |
    --------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - filter("C1"<=5)
    

    Note that in the foregoing that falling was not used.

    We'll re-create the index and gather statistics (when the index is created on Oracle Database 10.1 and higher, the index of statistics will be automatically collected, so it's actually an unnecessary step):

    CREATE INDEX IND_T1_C1 ON T1(C1);
    
    EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE)
    

    We could verify that the index will be used again, but we can skip this step.

    Now we remove the table and pick up the trash. Then we run the simple query of the T1 table again and retrieve the execution plan:

    DROP TABLE T1;
    
    FLASHBACK TABLE T1 TO BEFORE DROP;
    
    SELECT
      C1,
      SUBSTR(C2,1,2)
    FROM
      T1
    WHERE
      C1<=5;
    
     C1 SU
    --- --
      1 AA
      2 AA
      3 AA
      4 AA
      5 AA
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------------------------------------
    SQL_ID  g0kkvxqg3v145, child number 0
    -------------------------------------
    SELECT   C1,   SUBSTR(C2,1,2) FROM   T1 WHERE   C1<=5
    
    Plan hash value: 3441582395
    
    --------------------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |                                |       |       |     3 (100)|       |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1                             |     5 |  1300 |     3   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | BIN$PESygWW5R0WhbOaDugxqwQ==$0 |     5 |       |     2   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C1"<=5)
    

    In the above, you will notice that the index has been used, but now has a funny name.

    We will resolve the weird name and re - run the query:

    ALTER INDEX "BIN$PESygWW5R0WhbOaDugxqwQ==$0" RENAME TO IND_T1_C1;
    
    SELECT
      C1,
      SUBSTR(C2,1,2)
    FROM
      T1
    WHERE
      C1<=5;
    
     C1 SU
    --- --
      1 AA
      2 AA
      3 AA
      4 AA
      5 AA
    
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
    
    PLAN_TABLE_OUTPUT
    -----------------------------------------------------------------------------------------
    SQL_ID  g0kkvxqg3v145, child number 0
    -------------------------------------
    SELECT   C1,   SUBSTR(C2,1,2) FROM   T1 WHERE   C1<=5
    
    Plan hash value: 683303157
    
    -----------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |       |       |     3 (100)|          |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |     5 |  1300 |     3   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IND_T1_C1 |     5 |       |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("C1"<=5)
    

    The index is now back to normal.

    Charles Hooper
    http://hoopercharles.WordPress.com/
    IT Manager/Oracle DBA
    K & M-making Machine, Inc.

  • the two execution Plan

    Hello
    can you be kind to such me which is better and why (based on the columns of the execution Plan):
    Execution Plan A
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=17)
       1    0   SORT (AGGREGATE)
       2    1     INDEX (RANGE SCAN) OF 'TEST_IDX' (NON-UNIQUE) (Cost=2 Card=1 Bytes=17)
       3    2       SORT (AGGREGATE)
       4    3         FIRST ROW (Cost=2 Card=6 Bytes=60)
       5    4           INDEX (RANGE SCAN (MIN/MAX)) OF 'TEST_IDX' (NON-UNIQUE) (Cost=2 Card=1060)
    
    tkprof gek1_ora_16520.trc gek1_ora_16520.out explain=scott/tiger sort=exeela sys=no
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          2          0           0
    Fetch        2      0.00       0.00          0          2          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        4      0.00       0.00          0          4          0           1 
    AND:
    Execution Plan B
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=13)
       1    0   COUNT (STOPKEY)
       2    1     VIEW (Cost=2 Card=6 Bytes=78)
       3    2       INDEX (RANGE SCAN DESCENDING) OF 'TEST_IDX' (NON-UNIQUE) (Cost=2 Card=6 Bytes=102) 
    
    tkprof gek1_ora_16521.trc gek1_ora_16521.out explain=scott/tiger sort=exeela sys=no
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.03       0.06          2         41          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.00       0.00          0          2          0           1
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        4      0.03       0.06          2         43          0           1 
    Thank you.

    What is the version of db? Why you have not posted the actual queries as well? In a very generic view, the first is more beautiful, but is purely based on the elapsed time. What you are actually looking for?

    HTH
    Aman...

  • Need help to get the actual execution plan

    I need to get the actual execution plan of a query and its actual cost.
    If I understand correctly explaining the plan gives only the estimated according to my plan. Can someone help me please?

    I'm doing this:

    SQL> select OBJECT_NAME,DATA_OBJECT_ID,STATUS from dba_objects where owner='SANTU';
    
    OBJECT_NAME
                                                     DATA_OBJECT_ID STATUS
    --------------------------------------------------------------------------------
    ------------------------------------------------ -------------- -------
    TST_REDEF
                                                              73444 VALID
    REDEF_PK
                                                              73447 VALID
    
    SQL> select sql_id,sql_text from v$sqlarea where sql_text like '%DATA_OBJECT_ID,STATUS from dba_objects%';
    
    SQL_ID
    -------------
    SQL_TEXT
    --------------------------------------------------------------------------------
    gbvnfhs59t98f
    select sql_id,sql_text from v$sqlarea where sql_text like '%DATA_OBJECT_ID,STATUS from dba_objects%'
    
    bxdyf6ph2g3ay
    select OBJECT_NAME,DATA_OBJECT_ID,STATUS from dba_objects where owner='SANTU'
    
    SQL> select * from table(dbms_xplan.display_cursor('bxdyf6ph2g3ay'));
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    SQL_ID  bxdyf6ph2g3ay, child number 0
    -------------------------------------
    select OBJECT_NAME,DATA_OBJECT_ID,STATUS from dba_objects where
    owner='SANTU'
    
    Plan hash value: 2160718650
    
    ------------------------------------------------------------------------------------------------
    | Id  | Operation                        | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                 |             |       |       |    47 (100)|          |
    |   1 |  VIEW                            | DBA_OBJECTS |  1638 |   161K|    47 (3)| 00:00:01 |
    |   2 |   UNION-ALL                      |             |       |       |    |          |
    |*  3 |    FILTER                        |             |       |       |    |          |
    |*  4 |     HASH JOIN                    |             |  1830 |   209K|    46 (3)| 00:00:01 |
    |   5 |      INDEX FULL SCAN             | I_USER2     |    88 |  1936 |     1 (0)| 00:00:01 |
    |   6 |      NESTED LOOPS                |             |  1830 |   169K|    45 (3)| 00:00:01 |
    |   7 |       TABLE ACCESS BY INDEX ROWID| USER$       |     1 |    18 |     1 (0)| 00:00:01 |
    |*  8 |        INDEX UNIQUE SCAN         | I_USER1     |     1 |       |     0 (0)|          |
    |*  9 |       TABLE ACCESS FULL          | OBJ$        |  1830 |   137K|    44 (3)| 00:00:01 |
    |* 10 |     TABLE ACCESS BY INDEX ROWID  | IND$        |     1 |     8 |     2 (0)| 00:00:01 |
    |* 11 |      INDEX UNIQUE SCAN           | I_IND1      |     1 |       |     1 (0)| 00:00:01 |
    |  12 |     NESTED LOOPS                 |             |     1 |    29 |     2 (0)| 00:00:01 |
    |* 13 |      INDEX FULL SCAN             | I_USER2     |     1 |    20 |     1 (0)| 00:00:01 |
    |* 14 |      INDEX RANGE SCAN            | I_OBJ4      |     1 |     9 |     1 (0)| 00:00:01 |
    |  15 |    NESTED LOOPS                  |             |     1 |    97 |     1 (0)| 00:00:01 |
    |  16 |     TABLE ACCESS BY INDEX ROWID  | USER$       |     1 |    18 |     1 (0)| 00:00:01 |
    |* 17 |      INDEX UNIQUE SCAN           | I_USER1     |     1 |       |     0 (0)|          |
    |* 18 |     INDEX RANGE SCAN             | I_LINK1     |     1 |    79 |     0 (0)|          |
    ------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       3 - filter(((("O"."TYPE#"<>1 AND "O"."TYPE#"<>10) OR ("O"."TYPE#"=1 AND =1))
    AND
                  (("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND
                  "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND
                  "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND "O"."TYPE#"<>87 AND
                  "O"."TYPE#"<>88) OR BITAND("U"."SPARE1",16)=0 OR (INTERNAL_FUNCTION("O"."TYPE#") AND
                  ((SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR
                  ("U"."TYPE#"=2 AND "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')))
                  OR  IS NOT NULL)))))
       4 - access("O"."OWNER#"="U"."USER#")
       8 - access("U"."NAME"='SANTU')
       9 - filter(("O"."NAME"<>'_NEXT_OBJECT' AND "O"."NAME"<>'_default_auditing_opt
    ions_'
                  AND "O"."LINKNAME" IS NULL AND BITAND("O"."FLAGS",128)=0 AND "O"."
    SPARE3"="U"."USER#"))
      10 - filter(("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR "I"."TYPE#"=3 OR "I"."TYPE#"=4
    OR
                  "I"."TYPE#"=6 OR "I"."TYPE#"=7 OR "I"."TYPE#"=9))
      11 - access("I"."OBJ#"=:B1)
      13 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','
    current_
                  edition_id')))
           filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv',
    'current
                  _edition_id'))))
      14 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."US
    ER#")
      17 - access("U"."NAME"='SANTU')
      18 - access("L"."OWNER#"="U"."USER#")
    
    57 rows selected.
    
    SQL>
    

    Execution plans

    Kind regards
    S.K.

Maybe you are looking for