这适用于下面的简单示例,适用于 11.2.0.3(EE,64 位,Solaris)和 12.1.0.1(EE,64 位,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 |
-------------------------------------------------------