Oracle 11.2 - perform parallel DML on a table that is not partitioned with LOB column

Hello

Since I wanted to demonstrate the new enhancements of Oracle 12 c on SECUREFICHIERS, I tried to use PDML declarations on a table that is not partitioned with LOB column, in Oracle 11 g and Oracle 12 c releases. The Oracle 11.2 SECUREFICHIERS and large objects Developer Guide January 2013 said clearly:

Parallel execution of the following DML operations on tables with LOB columns is supported. These operations performed in parallel run only mode when it is run on a partitioned table. The DML statements on tables not partitioned with LOB columns continue to run in serial execution mode.

  • INSERT SELECT AS
  • CREATE TABLE AS SELECT
  • DELETE
  • UPDATE
  • MERGE (conditionally UPDATE and INSERT)
  • Multi-table INSERT

So, I created and filled a simple table with a BLOB column:

SQL> CREATE TABLE T1 (A BLOB);
Table created.

Then, I tried to see the execution of a parallel ABOLITION plan:

SQL> EXPLAIN PLAN FOR
  2  delete /*+parallel (t1,8) */ from t1;

Explained.

SQL> select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3718066193

-------------------------------------------------------------------------------------------------------
| Id  | Operation             | Name     | Rows  | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
-------------------------------------------------------------------------------------------------------
|   0 | DELETE STATEMENT      |          |  2048 |     2   (0)| 00:00:01 |        |      |            |
|   1 |  DELETE               | T1       |       |            |          |        |      |            |
|   2 |   PX COORDINATOR      |          |       |            |          |        |      |            |
|   3 |    PX SEND QC (RANDOM)| :TQ10000 |  2048 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
|   4 |     PX BLOCK ITERATOR |          |  2048 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
|   5 |      TABLE ACCESS FULL| T1       |  2048 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------

Note
-----
   - dynamic sampling used for this statement (level=2)

And I ended up executing the statement.

SQL> commit;
Commit complete.

SQL> alter session enable parallel dml;
Session altered.

SQL> delete /*+parallel (t1,8) */ from t1;
2048 rows deleted.

As we can see, the statement was executed in parallel:

SQL> select * from v$pq_sesstat;

STATISTIC                      LAST_QUERY SESSION_TOTAL
------------------------------ ---------- -------------
Queries Parallelized                    1             1
DML Parallelized                        0             0
DDL Parallelized                        0             0
DFO Trees                               1             1
Server Threads                          5             0
Allocation Height                       5             0
Allocation Width                        1             0
Local Msgs Sent                        55            55
Distr Msgs Sent                         0             0
Local Msgs Recv'd                      55            55
Distr Msgs Recv'd                       0             0

11 rows selected.

Is this normal? It is not supposed to be supported on Oracle 11 g with no partitioned table containing the LOB column...

Thank you for your help.

Michael

Hello

The explain plan shows that only the query is run in parallel but not delete it.

Concerning

Maurice

Tags: Database

Similar Questions

  • Performance problem on the SQL query that does not use the primary key index

    Hello!

    I have some performance issues on a single SQL query (Oracle 10 g).
    I could solve the problem by using the INDEX indicator, but I would like to know WHY this is happening.

    * Tables *.
    create table jobs)
    ID number (5) not null,
    name varchar2 (100),
    primary key constraint Job_PK (id)
    )
    /
    -Record count: 298

    create table Comp)
    integer ID not null,
    name varchar2 (100),
    primary key constraint Comp_PK (id)
    )
    /
    -Record count: 193

    -Relation m: n
    create table JobComp)
    integer ID not null,
    id_job integer not null,
    id_comp integer not null,
    primary key constraint JobComp_PK (id),
    unique key constraint JobComp_UK (id_job, id_comp),
    Constraint JobComp_FK_Job foreign key (id_job) refers to Job (id),
    Constraint JobComp_FK_Comp foreign key (id_comp) makes reference Comp (id)
    )
    /
    create index JobComp_IX_Comp on JobComp (Cod_Comp)
    /
    create index JobComp_IX_Job on JobComp (Cod_Job)
    /
    -Record count: 6431

    * Ask *.

    When I run this query, the execution plan shows the index using (JobComp_PK and JobComp_IX_Comp).
    No problem.

    Select JobComp.*
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in 0.20 sec

    But when I add the field 'name' of the work table the plan uses full access table to the table of work

    Select JobComp.*, Job.name
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in the 2.70 dry

    With the help of the index

    Select / * + INDEX (Job Job_PK) * /.
    JobComp.*, Job.name
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in 0.20 sec

    * Doubt *.

    This behavior is correct?

    PS. : I tried to recalculate the statistics, but nothing changes:

    analyze the job calculation table statistics.
    /
    change the statistical calculation of index Job_PK reconstruction;
    /
    Start
    dbms_utility.analyze_schema (sys_context ('userenv', 'current_schema'), 'CALCULATE');
    end;
    /

    [of]
    Gustavo Ehrhardt

    Gus.EHR wrote:
    Hello.
    I'm sorry for the plan unformatted.
    The execution time of the querys "without field name' and 'with the field name with suspicion" are equal.
    He has no problem caching, because I get the plans of the sequence different from the querys and repeated the performance. The result is always the same.

    I don't think that there is no problem with oracle crossing LOOP IMBRIQUEE to the HASH JOIN when you include the field name and this should be the expected behavior. But it seems that your WORKING table has a degree of parallelism set against what is causing the query to run in parallel (as JOB table is now available with full table scan, instead of indexed access earlier). It could be that the parallel execution is contributor to extra Runtime.
    (a) do you know why the degree of parallelism on the WORK table has been defined? Do you need it?

    You can see if the following query provides a better response time?

    select /*+ NOPARALLEL(JOB) */ JobComp.*, Job.Name
      from JobComp
      join Job
        on Job.id = JobComp.id_job
     where JobComp.id_comp = 134
    
  • Y at - it DB Oracle options that do not work with Oracle Apex

    Hi team,

    Y at - it options Oracle DB (DB audit vault wall and fire. HCC, advanced... Security etc) which will not work with Oracle Apex. Please let us know of a few documents if you

    Thank you kindly,

    Hi Rhine23,

    Rhine23 wrote:

    Y at - it options Oracle DB (DB audit vault wall and fire. HCC, advanced... Security etc) which will not work with Oracle Apex. Please let us know of a few documents if you

    It's the kind of question that can be answered with My Oracle Support | First Oracle Support or you can write to the APEX [email protected] about this application development team.

    Also, see the "Support" section at the end of the page Oracle Application Express - downloads.

    I hope this helps!

    Kind regards

    Kiran

  • Get the latest date DML for all tables

    Hi gurus,

    Version - ORacle 11i

    I need to get a list of the tables that was not 'DML used' for a long time (updates/Inserts / (and selects too if available)). I searched for this in the forum and found 3 methods I used

    1 insert/update dtm
    ----------------------------------
      SELECT DISTINCT table_name, T.COLUMN_NAME
        FROM all_tab_cols t
       WHERE UPPER (T.COLUMN_NAME) LIKE 'UPD%'
             OR    UPPER (T.COLUMN_NAME) LIKE 'INSERT%'
               AND T.OWNER = 'STG'
               AND T.DATA_TYPE IN ('TIMESTAMP', 'DATE')
    ORDER BY column_name
    
    Issue- Not all the tables have inaert/upd dtm
    2 all_tab_modifications
    -------------------------------------
      SELECT table_Name, timestamp
        FROM all_tab_modifications t
       WHERE T.TABLE_OWNER = 'STG'
    ORDER BY timestamp ASC
    
    Issue - Not all tables are monitored
    3 ORA_ROWSCN
    ------------------------------------------
    select MAX(ORA_ROWSCN), SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN)) from stg.XXXXXX
    
    Issue- This throws error MAX(ORA_ROWSCN) is not a valid input . ie for really old tables this throws error.
    How do I get there?

    Thank you
    S

    957793 wrote:
    Thank you peter.

    But one thing I noticed, sometimes at the time where I start an analysis table calculates statistics, the table disappears from the all_tab_modifications

    Thank you
    S

    Yes, makes the Act of analyzing a table disappears from the view of xxx_tab_modifications. It is because this view follows changes in the analyzed table have been modified in order to analyze the self employment can tell whether or not it must be analused "today."

    Assuming that you use more or less the default policy analysis that Oracle puts in place, it would be a pretty safe assumption that any which table not in xxx_tab_modifications had to be a substantial (as defined by the auto scan parameters) activity dml recently, or in other words did not have an important activity for a long time. You can make a difference based on the last_analyzed_date column in the xxx_tables view.

    John

  • Add void partition on another column in oracle

    I have a table that has two partitions (as standard): first_half and second_half, based on a column "INSERT_DAY."

    I must add subpartitions 'SUCCESS' and 'SUCCESS' based on the values in another column 'STATUS' (subpartition by list) that I have to turn my score range on composite (range-list).

    I don't want to drop the existing tables or partitions. What is the ALTER query for this?

    PS: Is Oracle 9i database

    Thanks for posting the actual code. This makes it much easier to see what is happening and test things.

    The requirement is to remove all records with counter = 3 (which means successful load) for records that have more than 15 days.

    Then you should just REMOVE the lines and do with it.

    So I thought, why not create partitions of sub metered so that the final DDL would be something like the following.

    Any change like this for the partitioning of the table means that all data should be transferred into a new segment.

    Please explain how to move all THE data (including the data that you want to remove) is better than just delete the data.

    I would then write a request for DELETION, which would take a long time to run.

    What evidence do you have that a DELETION would "take some time" to run?

    How many lines are there in the table? How many of these lines you want to delete?

  • Why I don't have the error: ORA-14551: cannot perform a DML operation inside a query

    Hello

    create table table_1 (phone number)

    create or replace function function_a return number
      is
        l_rv number;
      begin
        l_rv := dbms_random.value();
        insert into table_1 values(l_rv);
        return l_rv;
      end;
    
    

    Select double function_a

    Now, I get the error:

    ORA-14551: cannot perform a DML operation inside a query

    ORA-06512: at "FUNCTION_A", line 6

    create the table table_2 (phone number)

    insert into table_2 select function_a from dual
    
    

    Now, I make the same mistake. It is to insert records into table_2

    Can someone please clarify this?

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production

    Post edited by: O - O added: (select double function_a)

    O - O wrote:

    To be called from instructions SQL, stored function must obey "purity" following rules, which are intended to control the side effects:

    • rule1) When it is called from a SELECT statement or a parallelized INSERT , UPDATE , or DELETE statement, the function cannot change database tables.
    • rule2) When it is called from a INSERT , UPDATE , or DELETE statement, the function cannot query or modify database tables modified by that statement.

    Can you please explain this? I think that these statements are contradicted with

    insert into select double function_a table_2

    Now, I make the same mistake. It is to insert records into table_2

    When your function is called by a select statement, an error is triggered because of rule1).

    When your function is called in an insert statement, no error is raised. The insert does not work in parallel (this is an insert row after all). So rule1) is also not infringed. The insert is on the table2, change table1. Because it does not modify the same table rule2) is not violated. So no reason to trigger an error.

  • Why this parallel DML statement is not run as fast as DBMS_PARALLEL_EXECUTE?

    Hello

    I'm on the database Oracle Enterprise Edition, Linux RH 11.2.0.3. I have a pl/sql function that accepts a sdo_geometry (essentially an object with a few varrays), round each number in one of the varrays and retransmits the object.  Here is a version of the function, simplified slightly for brevity:

    create or replace round_coordinates (p_geometry in sdo_geometry, p_round_factor in numbers)

    return sdo_geometry parallel_enable

    is

    sdo_geometry v_geometry: = p_geometry;

    v_ordinates sdo_ordinate_array;

    Start

    v_ordinates: = p_geometry.sdo_ordinates;

    for me in v_ordinates.first... loop of v_ordinates. Last

    v_ordinates (i): = round (v_ordinates (i), p_round_factor);

    end loop;

    Return sdo_geometry (v_geometry.sdo_gtype, v_geometry.sdo_srid, v_geometry.sdo_point, v_geometry.sdo_elem_info, v_ordinates);

    end round_coordinates;

    /

    I need to perform this function as an update DML on hundreds of millions of sdo_geometry objects and according to my estimates it will take weeks.  So, I want to run in parallel.

    The data is in a bunch of tables, some with lines of k ~ 100 more with millions of people.  My preference is to browse the tables and run an update such as:

    Update < table > set geometry = round_coordinates (geometry);

    But I would like to operate in parallel, so I thought that I would allow the DML parallel to the session with

    ALTER session enable parallel dml.

    ALTER table < table > parallel;

    , and then run the update by: Update / * + parallel * / < table > set geometry = round_coordinates (geometry);

    When I do that, I can see a v$ px_session 16 parallel slaves are bent and the plan of the explanation is the following:

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

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |    TQ | IN-OUT | PQ Distrib.

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

    |   0 | UPDATE STATEMENT.             | 10000 |   468K |    43 (0) | 00:00:01 |        |      |            |

    |   1.  UPDATE | SMALL_10000 |       |       |            |          |        |      |            |

    |   2.   COORDINATOR OF PX |             |       |       |            |          |        |      |            |

    |   3.    PX SEND QC (RANDOM). : TQ10000 | 10000 |   468K |    43 (0) | 00:00:01 |  Q1 00 | P > S | QC (RAND) |

    |   4.     ITERATOR BLOCK PX |             | 10000 |   468K |    43 (0) | 00:00:01 |  Q1 00 | ISSUE |            |

    |   5.      TABLE ACCESS FULL | SMALL_10000 | 10000 |   468K |    43 (0) | 00:00:01 |  Q1 00 | SVCP |            |

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

    But the update statement on my test data set does not any more quickly - it takes a few seconds more series that suggests General fresh extra expectations for the management of parallel slaves that's happened, but they did not have the query run faster.


    I tried to use the dbms_parallel_execute with the create_chunks_by_rowid option package and parallel_level = 16 With that I get at the end just over 1/16th of the time that it takes to run in series!

    That's fine, so I have the option dbms_parallel_execute, but I would like to understand why the query with the parallel flag does not expedite things.

    Any ideas?

    Thank you

    John

    It may be that the call to the PL/SQL function slows down things. Did you think to do in pure SQL?

    Here is an example:

    update test_sdo tsd
       set tsd.geometry.sdo_ordinates =
           (select cast(collect(round(t2.column_value)) as sdo_ordinate_array)
              from test_sdo t1
                  ,table(t1.geometry.sdo_ordinates) t2
             where t1.id = tsd.id)
    

    Post edited by: PaulHorth

    BTW: You can parallelize the query part of the SQL but not updating, it's documentation:

    "Parallel DML can be done on tables with columns object provided that the columns of the object are not accessible."

  • Running in parallel DML not forced

    Hello

    I work with an Oracle RDBMS 12cR1,

    I amcurrently how can I influence parallel experimentation DML and parallel DDL (for example edit.

    For example, I have the following settings:

    parallel_degree_level = 100

    parallel_degree_limit = CPU

    parallel_degree_policy = MANUAL

    These are the default values.

    At this point, that means I should be able to influence the optimier through tips.

    There is no statistics on the table I want to insert data.

    I started with:

    ALTER session force parallel dml parallel 4;

    Then I have an insert of type:

    insert into table (list of aliases for column using the dbms_random package)

    Select (column list) of the double

    connect by level < = 100000;

    When I followed the execution using EM, I don't see the parallel expected excution.

    The execution plan looks like this:

    CREATE statement

    load in select

    the gathering optimizer statistics

    connect to without filtering

    double quick

    This isn't a 'great' table and select to insert is not "big".

    If because I have such a '' big, '' set that Oracle chooses not to use parallel DML had?

    How can I force parallel DML execution?

    Thanks and greetings

    Laury wrote:

    Yes, after some further tests, I discovered that connection by does not allow for parallel processing.

    Yet, I do not observe the same kind of results as you.

    Think about how a connect works by, and it must be clear that it would be very difficult to implement a parallel connection by - especially when the driving table has only one row. But you don't really want to use a simple connect by to generate a large amount of data because of the impact this can have on memory.

    Once you've worked out why you do not get the parallelism you should be found - your parallel functions ARE enabled? Your parallel_max_servers is not null (you keep do not answer the question on parallel settings)-you can introduce the strategy who joined a small "connect by" result set to itself and you give the complete end parallelism you need:

    Insert / * + parallel (second_emp, 6) * / into second_emp

    (

    EmpNo,

    Ename,

    employment,

    Bishop.

    HireDate,

    SAL,

    Comm,

    DEPTNO

    )

    with generator as)

    Select

    rownum id

    Of

    Double

    connect

    level<=>

    )

    Select

    round (dbms_random.value (1: 500000)) like empno,

    dbms_random. String name ('U', 10),

    random_job as job,

    random_mgr as Bishop,

    trunc ((sysdate-1000) + dbms_random.value (0.366)) as hiredate.

    round (dbms_random.value (800, 300)) as sal,

    -decode (rounds (dbms_random.value (0, 1401)), 1401, null, rounds (dbms_random.value (0, 1401))) as comm

    (

    case

    When ((dbms_random.value (0, 1401)) round between 1000 and 1401)

    then null

    another round (dbms_random.value (0, 1401))

    end

    ) as Comm.,

    TO_NUMBER ((substr (round (dbms_random.value (10, 30)), 1, 1) |)) '0')) as deptno

    Of

    (select 1 n2 of the generator where id)<= 100)   ="">

    (select 1 n2 of the generator where id)<= 1000)  ="">

    ;

    Note in particular the subquery WITH which will generate a small TWG internally; then the join between two copies of this table - and this join does not use the rownum or operator LEVEL. This gives you a merge join parallel that generates a large amount of data and allows the PX servers make all calls to dbms_random.

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

    | ID | Operation | Name                      | Lines | Bytes | Cost (% CPU). Time |    TQ | IN-OUT | PQ Distrib.

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

    |   0 | INSERT STATEMENT.                           |       |       |     7 (100) |          |        |      |            |

    |   1.  TRANSFORMATION OF THE TEMPORARY TABLE.                           |       |       |            |          |        |      |            |

    |   2.   LOAD SELECT ACE |                           |       |       |            |          |        |      |            |

    |   3.    COUNT                            |                           |       |       |            |          |        |      |            |

    |   4.     CONNECT TO WITHOUT FILTERING.                           |       |       |            |          |        |      |            |

    |   5.      QUICK DOUBLE |                           |     1.       |     2 (0) | 00:00:01 |        |      |            |

    |   6.   COORDINATOR OF PX |                           |       |       |            |          |        |      |            |

    |   7.    PX SEND QC (RANDOM). : TQ10001 |     1.    26.     5 (0) | 00:00:01 |  Q1, 01 | P-> S | QC (RAND) |

    |   8.     LOAD SELECT ACE (HYBRID TSM/HWMB) |                           |       |       |            |          |  Q1, 01 | SVCP |            |

    |   9.      OPTIMIZER STATISTICS COLLECTION |                           |     1.    26.     5 (0) | 00:00:01 |  Q1, 01 | SVCP |            |

    |  10.       THE CARTESIAN MERGE JOIN.                           |     1.    26.     5 (0) | 00:00:01 |  Q1, 01 | SVCP |            |

    |  11.        RECEIVE PX |                           |     1.    13.     2 (0) | 00:00:01 |  Q1, 01 | SVCP |            |

    |  12.         PX SEND BROADCAST | : TQ10000 |     1.    13.     2 (0) | 00:00:01 |  Q1 00 | P-> P | BROADCAST |

    | * 13 |          VIEW                       |                           |     1.    13.     2 (0) | 00:00:01 |  Q1 00 | SVCP |            |

    |  14.           ITERATOR BLOCK PX |                           |     1.    13.     2 (0) | 00:00:01 |  Q1 00 | ISSUE |            |

    | * 15 |            TABLE ACCESS FULL | SYS_TEMP_0FD9D66BC_3BA6C3 |     1.    13.     2 (0) | 00:00:01 |  Q1 00 | SVCP |            |

    |  16.        KIND OF BUFFER.                           |     1.    13.     5 (0) | 00:00:01 |  Q1, 01 | SVCP |            |

    | * 17.         VIEW                        |                           |     1.    13.            |          |  Q1, 01 | SVCP |            |

    |  18.          ITERATOR BLOCK PX |                           |     1.    13.     2 (0) | 00:00:01 |  Q1, 01 | ISSUE |            |

    | * 19.           TABLE ACCESS FULL | SYS_TEMP_0FD9D66BC_3BA6C3 |     1.    13.     2 (0) | 00:00:01 |  Q1, 01 | SVCP |            |

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

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

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

    13 - filter ("ID"<>

    15 - access(:Z>=:Z AND:Z)<>

    17 - filter ("ID"<>

    19 - access(:Z>=:Z AND:Z)<>

    Concerning

    Jonathan Lewis

  • Parallel DML may be downgraded to the DML series?

    Oracle Database Enterprise Edition 11.2.0.3.0

    When you run a parallel query (e.g. SELECT * FROM parallel_table WHERE a <?), the optimizer may choose a parallel or series, the selectivity of the predicate function plan and availability different access roads - usually a scan interval series index for highly selective queries (a small number of return lines), and a parallel table full scan for less selective queries (returning a large number of lines).

    However, with parallel DML enabled, no such optimization seems to happen. There may be a very effective for a query as series plan "DELETE FROM parallel_table WHERE a <? ', but once parallel DML is activated, the optimizer based on CSSTidy always seems to choose a parallel plan.

    Is there a way to allow the optimizer to choose between series and parallel DML according to predicates in the query? I wish I could enable parallel DML, but knowing that, in the case of a very selective, query optimizer will not parallel DML use but will use a series DML.

    Note that I'm allowing to the DML, not no force in parallel it (although it seems more to do with the fact that a table series is considered parallel, without having to refer to the query).

    Here is an example of this behavior, deleted 18 m rows in a table of rows of 300 m:

    First, the cost of a DML series operation is 59,000, using an index to access the lines:

    COMMIT;

    ALTER SESSION DISABLE PARALLEL DML.

    DELETE

    OF parallel_table

    WHERE the DATETIME_a < sysdate - 650;

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

    | ID | Operation | Name                    | Lines | Bytes | Cost (% CPU). Time |

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

    |   0 | DELETE STATEMENT.                         |    18 M |  2037M | 58723 (1) | 00:11:45 |

    |   1.  REMOVE | PARALLEL_TABLE |       |       |            |          |

    |*  2 |   INDEX RANGE SCAN | IDX_PT_DATETIME_A |    18 M |  2037M | 58723 (1) | 00:11:45 |

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

    Now, by allowing parallel DML, the optimizer chooses a parallel full table much more expensive for the same request, cost 926 000 scan. Why he won't come back in terms of the series?

    COMMIT;

    ALTER SESSION ENABLE PARALLEL DML.

    DELETE

    OF parallel_table

    WHERE the DATETIME_a < sysdate - 650;

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

    | ID | Operation | Name               | Lines | Bytes | Cost (% CPU). Time |    TQ | IN-OUT | PQ Distrib.

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

    |   0 | DELETE STATEMENT.                    |    18 M |  2037M |   926K (1) | 03:05:22 |        |      |            |

    |   1.  COORDINATOR OF PX |                    |       |       |            |          |        |      |            |

    |   2.   PX SEND QC (RANDOM). : TQ10001 |    18 M |  2037M |   926K (1) | 03:05:22 |  Q1, 01 | P > S | QC (RAND) |

    |   3.    INDEX MAINTENANCE | PARALLEL_TABLE |       |       |            |          |  Q1, 01 | SVCP |            |

    |   4.     RECEIVE PX |                    |    18 M |  2037M |   926K (1) | 03:05:22 |  Q1, 01 | SVCP |            |

    |   5.      RANGE OF SEND PX | : TQ10000 |    18 M |  2037M |   926K (1) | 03:05:22 |  Q1 00 | P > P | RANGE |

    |   6.       REMOVE | PARALLEL_TABLE |       |       |            |          |  Q1 00 | SVCP |            |

    |   7.        ITERATOR BLOCK PX |                    |    18 M |  2037M |   926K (1) | 03:05:22 |  Q1 00 | ISSUE |            |

    |*  8 |         TABLE ACCESS FULL | PARALLEL_TABLE |    18 M |  2037M |   926K (1) | 03:05:22 |  Q1 00 | SVCP |            |

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

    Dan.Jan wrote:

    So in summary, by adding a second index to the table, the optimizer computes a much higher estimate of the costs for the use of a scan of the index systematic range. As a result, he opts for the full table scan, which is not necessarily the most efficient plan. I am inclined to think that it is a bug with optimizer, as much as it manifests itself only in the line superior (0) plan.

    It's a pretty good reason to be suspicious - and I think you are right that it is a bug.

    The cost of a removal is the cost of the selection the ROWID of the lines to remove, which is in this very simple case: ' selectivity * leaf_blocks ' for the index. However, when you create the second FINAL cost index seems to change to "selectivity * (leaf_blocks + clustering_factor) ' (I ran your test case, tried a few simple variations and looked 10053 files trace - so my conclusion is not a complete analysis of the question.)

    Since you have a test case, raise a SR with Oracle.

    Concerning

    Jonathan Lewis

    (Update: added missing 'leaf_blocks' to the 2nd expression)

  • Council in parallel and enable parallel dml

    Hi team,

    I found the following code in our development. And I did not understand why must be given
    ALTER TABLE < tnm > ACTIVATE PARALLEL DML and also
    Suspicion of parallel in the DML.
        EXECUTE IMMEDIATE ('alter session enable parallel dml') ;
        DELETE /*+parallel(a,4) */     FROM Temp a ;
     
    The statement above with Alter command and parallel Hint improve the performance of DML.

    Please suggest me.
    Thank you

    If we want to execute DML instructions in parallel, that we must allow the parallel DML for the session.

    The statement above with Alter command and parallel Hint improve the performance of DML.

    Yes. N ° maybe. Sometimes.

    If parallelization (dread Word) makes things run faster depends on many things. The number of cores has your server. How many other processes use the system at the same time. If there is a reasonable plan to organize the parallel threads. Into the INITRANS of the table settings.

    Parallel SQL is an important area that has a lot to understand. The best place to start is with Doug Burns paper on the subject. [url http://oracledoug.com/px_slaves.pdf] Find it here (attention: PDF)

    Cheers, APC

  • Question about parallel hint and 'alter table enable parallel DML'

    Hi all

    I have a DML as follows:

    Insert / * + append * / into table1
    Select *.
    of COMPLEX_VIEW;

    Here complex_view contains a very complicated SQL, in which there is some heavy tables joins, subqueries, and aggregations.

    Question 1:

    Let's assume that the underlying tables have no attribute "parallel." Where should I add "parallel index" to force it to be run in parallel and can get better performance?

    Some members think that what follows is good.

    Insert / * + append * / into table1
    Select / * + parallel (a 4) * / *.
    of COMPLEX_VIEW;

    But I think that indicators must be put in the defintion of the complex view where they should be and do not put advice to the main insert DML, like this:

    Insert / * + append * / into table1
    Select *.
    of COMPLEX_VIEW; -I added the indicators in the COMPLEX_VIEW.

    What is your opinion?

    Quesion2:
    Without ' alter session enable parallel DML ", I can see the parallel session in v$ px_session thus." And the execution time has been shortened. This proves without this statement, the DML is also run in parallel.

    So, what is the effect of this statement?

    Best regards
    Leon

    I prefer the suspicion out of the COMPLEX_VIEW. This way, only this application forces the suspicion. If you put the indicator in the COMPLEX_VIEW, any other query on COMPLEX_VIEW (or Assembly of COMPLEX_VIEW to another view or a table) would also "encode" indicator in its execution. You don't then isolation parallel query to only where it is needed.

    If you put the parallel indicator in SELECT it (or view), the query is parallelized. This does not necessarily mean that the INSERT is parallelized. What you see v$ px_session are only slaves to PQ to SELECT.
    You must ALTER SESSION ACTIVATE PARALLEL DML and add the PARALLEL indicator in the INSERT.

    Hemant K Collette

  • can I use "Oracle Database 12 c: performance management and Tuning" training for the certification "Oracle Database 11g: Performance Tuning 1Z0-054 '"»

    I took "Oracle Database 12 c: new performance management and Tuning" the oracle University training. Now I would like to get certified on "Oracle Database 11g: Performance Tuning 1Z0-054 ' exam. Is this possible?

    I guess you ask if you can use the course 12 c as long as the condition of course for the review of 11g.  Over 12 c is not listed as one of the options for the 11 g certification and course requirements are normally specific version - at least with DBA certifications.  If you are already an Oracle OCP DBA, of course, there is no requirement of course for the review of performance tuning.  From what I know the training requirements for other certifications, I do not that you will be able to use it. However, Brandye will provide a definitive answer to whether the course 12 c would be acceptable for 11g certification.

    That said, I'm with John - 12 c review is about a community of 85 to 90% in the review of the 11g and is currently about 20% of the price while it is in beta.  What is the point of trying to cross the releases?

  • Remove all lines and insert them into Oracle can make performance worse?

    I m working in a project that I need to make a batch update regularly (every 4 months) of excel files. These files have doesn´t excellent key in their ranks.

    The development of a code that deletes all lines and inserts the entire base again is easier than one who checks in all the ranks of its primary key and if necessary update. (sometimes may be a key to 5 columns).

    My question is: if I delete all the rows in the tables of the insert it again, it will cause tablespace fragmentation and in a future loss of performance?

    Is there a way to avoid this?

    Thanks in advance

    Alexander

    This response helped me a lot.

    Thank you all

    Remove all lines and insert them into Oracle can make performance worse? -Stack overflow

  • call a function inside a function to insert into a table and receiver error - ORA-14551: cannot perform a DML operation within a query.

    Hi all

    your help is greatly appreciated...

    Calling B.fucntion inside an A.fonctions to insert data into a table.


    Here when you call the B.fucntion to insert data in the table... receiver AM a mistake

    Omitted in B - SQL Error: ORA-14551: cannot perform a DML operation inside a query...


    Can someone please help me to clarify this...


    The FUNCTION A(varUPD_TYPE IN VARCHAR2) RETURN VARCHAR2 IS
    varRETURN_VALUE VARCHAR2 (25): = NULL;

    numALLOWED_COUNT PROD. PROCESS_COUNTER. TYPE % ALLOWED_COUNT;
    numLAST_COUNT_ADDED PROD. PROCESS_COUNTER. TYPE % LAST_COUNT_ADDED;
    dtCHANGE_DATE DATE: = NULL;
    varSTMT VARCHAR2 (2000);
    bln_Allowed BOOLEAN;
    myVar VARCHAR2 (32767).


    BEGIN

    IF varUPD_TYPE = "A" THEN

    BEGIN
    SELECT CH_DATE, LAST_COUNT_ADDED, ALLOWED_COUNT
    IN dtCH_DATE, numLAST_COUNT_ADDED, numALLOWED_COUNT
    PROD. PROCESS_COUNTER
    WHERE NOM_PROCESSUS = "DAILY".
    AND COUNTER_IND = A '

    IF dtCH_DATE < = trunc (sysdate) THEN
    numLAST_COUNT_ADDED: = 0;
    END IF;

    EXCEPTION
    WHILE OTHERS THEN
    numLAST_COUNT_ADDED: = 0;
    numALLOWED_COUNT: = 1;
    END;
    IF numALLOWED_COUNT > = numLAST_COUNT_ADDED + 1 THEN

    bln_Allowed: = True;

    varSTMT: = "UPDATE PROD. TMS_PROCESS_COUNTER ';
    varSTMT: = varSTMT | ' SET last_count_added = ' | (numLAST_COUNT_ADDED + 1);
    varSTMT: = varSTMT | "WHERE nom_processus =" DAILY "';
    varSTMT: = varSTMT | "AND COUNTER_IND ="D"';


    IF varSTMT IS NOT NULL
    THEN
    MyVar: = B(96,varSTMT);
    PROC_LOG (' CALL B ': myVar);
    IF myvar > 0 THEN
    NULL;
    END IF;
    END IF;
    On the other

    End if;

    END IF;

    EXCEPTION WHEN OTHERS THEN
    PROC_LOG ("A failed '");
    PROC_LOG (' SQL error: ' |) SUBSTR (SQLERRM, 1, 1000));
    RETURNS A NULL VALUE.
    PUT AN END TO;

    The FUNCTION B(numTABLE_ID IN NUMBER, varSQL_STATEMENT IN VARCHAR2) RETURNS NUMBER IS
    varINSERT_BATCH_STMT VARCHAR2 (32767): = NULL;
    varADD_REC_TYPE BATCH_TABLES. TYPE % ADD_REC_TYPE;

    BEGIN

    INSERT INTO BATCH_STATEMENT (ID, TABLE_ID, STATEMENT, QUEUE_SEQUENCE_ID)
    VALUES (Numidian, numTABLE_ID, varSQL_STATEMENT, 1);

    EXCEPTION WHEN OTHERS THEN
    PROC_LOG ('B failed');
    PROC_LOG (' SQL error: ' |) SUBSTR (SQLERRM, 1, 1000));
    RETURNS - 1;
    END B;


    Structure of the Batch_statement table:


    ID Number (15) not null
    number (2) not null table_id
    Statement varchar2 (4000) not null
    Queue_sequence_id number (5) not null


    Why do you do such coding mess full of bad practices.

    Remove the exceptions WHEN OTHERS, you're a turing a mistake in this way, they are bugs and (never) use functions to perform DML.

    Functions are not intended for DML. Period.

  • 1Z0-054: Oracle Database 11g Performance Tuning Expert

    I intend to give the exam 1z0-054 for the certification, "Oracle Database 11g Performance Tuning Expert".

    The path to Certification indicates that, if you are 'OCP DBA 11 g' then you can directly take this article and there is no requirement for training instructor. Therefore, I decided to prepare my own. Can someone guide me on study material and landfills?

    Kind regards

    Ahmer Mansoor

    Therefore, I decided to prepare my own. Can someone guide me on study material and landfills?

    First of all, the word "shock" has a precise meaning. It is short for "landfills of brain", which are illegal and can cost you this certification and all others you have taken.

    http://blogs.Oracle.com/certification/entry/0477

    Second - there is currently no study guide or a specific book to this certification at the moment. I write the study guides and this one is actually next on my list when I finished the current book to * 1Z0-117: Oracle Database 11 g Release 2: SQL Tuning *. I have a guide for 1Z0 - 054 before sometime in may more likely. That said, I have a few links for legal study on the companion Web site material for my series of guide to the subjects for this exam. It also has links to the Oracle documentation that contains the information you need. Once I have started writing the book review, links will develop quickly because I research for her themes and links to the documentation could extend as well.

    http://www.oraclecertificationprep.com/Apex/f?p=OCPSG:EXAM_DETAILS:0:no:P2_EXAM:1Z0 - 054

Maybe you are looking for