我正在执行成功执行的直接路径插入。当我尝试自动跟踪执行时,我得到了ORA-12838: cannot read/modify an object after modifying it in parallel
.
SQL> insert into emp_big select * from emp_big_temp;
411843 rows created.
Elapsed: 00:00:00.89
Execution Plan
----------------------------------------------------------
Plan hash value: 3203427748
-----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT | | 357K| 45M| 1164 (1)| 00:00:14 |
| 1 | LOAD TABLE CONVENTIONAL | EMP_BIG | | | | |
| 2 | TABLE ACCESS FULL | EMP_BIG_TEMP | 357K| 45M| 1164 (1)| 00:00:14 |
-----------------------------------------------------------------------------------------
Note
-----
- dynamic sampling used for this statement (level=2)
Statistics
----------------------------------------------------------
15 recursive calls
31909 db block gets
12829 consistent gets
0 physical reads
34685216 redo size
845 bytes sent via SQL*Net to client
802 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
411843 rows processed
SQL> rollback;
Rollback complete.
Elapsed: 00:00:00.18
SQL>
SQL> insert /*+ append */ into emp_big select * from emp_big_temp;
411843 rows created.
Elapsed: 00:00:00.18
Execution Plan
----------------------------------------------------------
ERROR:
ORA-12838: cannot read/modify an object after modifying it in parallel
SP2-0612: Error generating AUTOTRACE EXPLAIN report
Statistics
----------------------------------------------------------
0 recursive calls
4438 db block gets
4283 consistent gets
0 physical reads
7648 redo size
829 bytes sent via SQL*Net to client
816 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
411843 rows processed
问题:
- 根据 ,表
emp_big
的并行度设置为 1select table_name, degree from user_tables
。为什么 Oracle 强制并行插入? - 为什么使用
autotrace trace
原因ORA-12838
?