dba_tables 中degree 字段是从SYS.tab$.degree这个字段查询出来的 ,公式为 lpad(decode(t.degree, 32767, 'DEFAULT', nvl(t.degree,1)),10),也就是 32767为default,建表时没有设置degree为空则degree为1;在实际的sql执行中oracle并行会受到cpu核数的限制,还有这个参数parallel_degree_policy默认为manul 时实际并行度cpu_count * parallel_threads_per_cpu
查询table 的degree
select o.OWNER,o.OBJECT_NAME,t.DEGREE, LPAD (DECODE (t.DEGREE, 32767, 'DEFAULT', NVL (t.DEGREE, 1)), 10) from SYS.tab$ t,dba_objects o where t.obj#=o.OBJECT_ID
and o.OBJECT_NAME='CUSTOMERS';
设置表的并行度为4
alter table tablename parallel 4;
设置表的并行度为default
alter table tablename parallel;
取消表的并行度
alter table tablename noparallel;
为了有助于理解可以查看着两个文章
http://www.eygle.com/archives/2008/04/parallel_degree_instances.html
https://uhesse.com/2011/10/12/auto-dop-differences-of-parallel_degree_policyautolimited/
为了有助于理解可以查看着两个文章
http://www.eygle.com/archives/2008/04/parallel_degree_instances.html
https://uhesse.com/2011/10/12/auto-dop-differences-of-parallel_degree_policyautolimited/