Oracle: why parallel delete doesn't go parallel?

Revious picture Revious · Jul 17, 2013 · Viewed 22.9k times · Source

I've tried the following statement. But it doesn't proceed parallel. Why? How can I speed up the operation?

ALTER SESSION ENABLE PARALLEL DML;

DELETE /*+ parallel(20) */
      FROM  table
      WHERE flag != 'N';

enter image description here

Answer

wanana picture wanana · Jul 17, 2013

try

ALTER SESSION ENABLE PARALLEL DML;
DELETE /*+ parallel(table, 20) */
  FROM  table
  WHERE flag!= 'N';

you can also try another option to delete data, using CTAS, reference from asktom Deleting many rows from a big table

create table new_table unrecoverable as select * from old_table where ....;

drop table old_table;

rename new_table to old_table;

create index old_table_idx1 on old_table(c1,c2) unrecoverable parallel 5;