如何确定了你是否使用并行
同时准备两个会话:
会话一中:
SQL> alter table t parallel <---修改表为可并行。
2 ;
表已更改。
SQL> select sid from v$mystat where rownum = 1; <--找出当前会话的ID
SID
----------
154
已用时间: 00: 00: 00.01
SQL> insert into t select * from t; <---向其中插入64000条数据,同时执行下一步查询是否并行
已创建64000行。
已用时间: 00: 00: 05.56
会话二中执行:
SQL> select sid,qcsid,server#,degree from v$px_session where qcsid=154;
SID QCSID SERVER# DEGREE
---------- ---------- ---------- ----------
148 154 1 4 《-----父ID为154,分出了4个子
144 154 2 4 ID,同时并行度为4.
150 154 3 4
153 154 4 4
154 154
会话一中的执行计划也可看出来:
SQL> explain plan for
2 insert into t select * from t;
已解释。
已用时间: 00: 00: 00.01
SQL> select * from table(dbms_xplan.display);