Это работает с простым примером ниже, как на 11.2.0.3 (EE, 64bit, Solaris), так и на 12.1.0.1 (EE, 64bit, Windows).
Это подразумевает, что вы используете определенную ошибку, которая может быть связана с некоторыми незначительными деталями вашего объекта, оператора или среды. Следующим шагом будет болезненный процесс изменения вашего запроса, пока он не соответствует моему запросу, ища тривиальные отличия, которые заставляют его перестать работать.
Образцы таблиц
--drop table tab_new;
--drop table tab_a;
--drop table tab_b;
--drop table tab_c;
create table tab_new(col01 number,col02 number,col03 number,col04 number,col05 number,col06 number,col07 number,col08 number,col09 number,col10 number,col11 number,col12 number,col13 number,col14 number,col15 number,col16 number,col17 number,col18 number,col19 number,col20 number,col21 number,col22 number,col23 number,col24 number,col25 number,col26 number,col27 number,col28 number,col29 number,col30 number,col31 number,col32 number) nologging;
create table tab_a (col01 number,col02 number,col03 number,col04 number,col05 number,col06 number,col07 number,col08 number,col09 number,col10 number,col11 number,col12 number,col13 number,col14 number,col15 number,col16 number,col17 number,col18 number,col19 number,col20 number,col21 number,col22 number,col23 number,col24 number,col25 number,col26 number,col27 number,col28 number,col29 number,col30 number,col31 number,col32 number) nologging;
create table tab_b (col01 number,col02 number,col03 number,col04 number,col05 number,col06 number,col07 number,col08 number,col09 number,col10 number,col11 number,col12 number,col13 number,col14 number,col15 number,col16 number,col17 number,col18 number,col19 number,col20 number,col21 number,col22 number,col23 number,col24 number,col25 number,col26 number,col27 number,col28 number,col29 number,col30 number,col31 number,col32 number) nologging;
create table tab_c (col01 number,col02 number,col03 number,col04 number,col05 number,col06 number,col07 number,col08 number,col09 number,col10 number,col11 number,col12 number,col13 number,col14 number,col15 number,col16 number,col17 number,col18 number,col19 number,col20 number,col21 number,col22 number,col23 number,col24 number,col25 number,col26 number,col27 number,col28 number,col29 number,col30 number,col31 number,col32 number) nologging;
отчётность
rollback;
alter session enable parallel dml;
explain plan for
INSERT /*+ PARALLEL(16) */ INTO TAB_NEW (col01,col02,col03,col04,col05,col06,col07,col08,col09,col10,col11,col12,col13,col14,col15,col16,col17,col18,col19,col20,col21,col22,col23,col24,col25,col26,col27,col28,col29,col30,col31,col32)
SELECT a.col01,a.col02,a.col03,a.col04,a.col05,a.col06,a.col07,a.col08,a.col09,a.col10,a.col11,a.col12,a.col13,a.col14,a.col15,a.col16,a.col17,a.col18,a.col19,a.col20,a.col21,a.col22,a.col23,a.col24,a.col25,a.col26,a.col27,a.col28,a.col29,a.col30,a.col31,a.col32
FROM TAB_A a, TAB_B b, TAB_C c
WHERE a.col01 = b.col01
AND b.col01 = c.col01;
select * from table(dbms_xplan.display(format => 'basic'));
Объяснить план
LOAD AS SELECT
операции и ее расположение под PX
операции означает, что данные вставлены параллельно.
Plan hash value: 1632580283
-------------------------------------------------------
| Id | Operation | Name |
-------------------------------------------------------
| 0 | INSERT STATEMENT | |
| 1 | PX COORDINATOR | |
| 2 | PX SEND QC (RANDOM) | :TQ10003 |
| 3 | LOAD AS SELECT | TAB_NEW |
| 4 | OPTIMIZER STATISTICS GATHERING | |
| 5 | HASH JOIN | |
| 6 | HASH JOIN | |
| 7 | PX RECEIVE | |
| 8 | PX SEND HASH | :TQ10000 |
| 9 | PX BLOCK ITERATOR | |
| 10 | TABLE ACCESS FULL | TAB_A |
| 11 | PX RECEIVE | |
| 12 | PX SEND HASH | :TQ10001 |
| 13 | PX BLOCK ITERATOR | |
| 14 | TABLE ACCESS FULL | TAB_B |
| 15 | PX RECEIVE | |
| 16 | PX SEND HASH | :TQ10002 |
| 17 | PX BLOCK ITERATOR | |
| 18 | TABLE ACCESS FULL | TAB_C |
-------------------------------------------------------
Спасибо, я все еще не мог запустить его параллельно с использованием Attempt1, хотя он работал с Attempt2, проблема в том, что Slaves (PX) все время ждал мастера (QC) на самом деле очень долгое время. Не уверен, что это проблема разногласий IO или что-то еще, но в конце мы больше не используем параллель. Параллел хорошо работал для небольших наборов данных, но для больших наборов данных (10 миллионов +) программа никогда не заканчивалась и длилась долгое время. – Annjawn