并行技术(1)
http://blog.chinaunix.net/uid-23284114-id-3187151.html
并行技术(2)
http://blog.chinaunix.net/uid-23284114-id-3189199.html 设置并行度Setting the Degree of Parallelism for Parallel Execution,有下面几种方式:
1.SQL语句级加PARALLEL hint(暗示)
SELECT /*+ PARALLEL(orders, 4) */ COUNT(*) FROM orders;
2.session级别设置
ALTER SESSION FORCE PARALLEL
3.表级和索引级:
ALTER TABLE orders PARALLEL 4;
ALTER INDEX iorders PARALLEL 4;
DDL操作设定DOP create table test parallel 4 as select * from d_test where rownum<100;
create index time_idx on test(time) parallel 4;
ALTER INDEX time_idx rebuild parallel 5;
oracle根据啥决定并行度 1.SQL语句中的hint
2.SESSION级别(ALTER SESSION FORCE PARALLEL)
3.表级、索引级定义的级别
并行度的优先级别从高到低:
Hint->alter session force parallel->表,索引上的设定-> 系统参数 在session可以决定开启或关闭表或索引设定的并行度,包括DML、DDL、QUERY
关闭:ALTER SESSION DISABLE PARALLEL DML|DDL|QUERY;
开启:ALTER SESSION ENABLE PARALLEL DML|DDL|QUERY;
session级别设定并行度:
ALTER SESSION FORCE PARALLEL DML|DDL|QUERY PARALLEL 5;
oracle默认(the default DOP)并行度:
1.根据cpu的个数、RAC实例数和PARALLEL_THREADS_PER_CPU决定。
2.如果处理分区,分区的个数决定并行度。
创建表默认并行度为1
SQL> create table tt(id number);
SQL> select table_name,degree from user_tables where table_name='TT';
- TABLE_NAME DEGREE
- --------------------------------------------- --------------------------------------------------------------------------
- TT 1
可以把表的并行度设为系统默认的并行度(the default DOP)
alter table tt parallel;
SQL> select table_name,degree from user_tables where table_name='TT';
- TABLE_NAME DEGREE
- ------------------------------------------------------------ --------------------------------------------------------------------------------
- TT DEFAULT
并行技术(1)
http://blog.chinaunix.net/uid-23284114-id-3187151.html并行技术(2)
http://blog.chinaunix.net/uid-23284114-id-3189199.html
阅读(1940) | 评论(0) | 转发(0) |