操作内并行使用的slave process数量就是并行度dop,index&table都有dop 作为默认操作并行度default 1表示不使用并行处理
SQL> create table t1 (a int) parallel 6;
Table created.
SQL> select degree from user_tables where table_name=’T1′;
DEGREE
———-
6
SQL> alter table t1 parallel 3;
Table altered.
SQL> select degree from user_tables where table_name=’T1′;
DEGREE
———-
3
*禁用alter table(index) parallel 1 (noprallel)
#create 时候使用parallel不仅会在创建table&index时使,后续的操作ddl,dml也会使用(如果只想建表时使用,建好后修改)
SQL> create table t2 (a int) parallel;(未指定并行度)
Table created.
SQL> select degree from user_tables where table_name=’T2′;
DEGREE
———-
DEFAULT ~~~这样使用default并行度=(cpu_count*parallel_threads_per_cpu)
SQL> show parameter cpu_count
NAME TYPE VALUE
———————————— ———– ——————————
cpu_count integer 2
SQL> show parameter parallel_thread
NAME TYPE VALUE
———————————— ———– ——————————
parallel_threads_per_cpu integer 2
SQL>
SQL> insert into t2 values (1);
1 row created.
SQL> commit;
Commit complete.
SQL> set autotrace trace exp
SQL> select * from t2;
Execution Plan
———————————————————-
Plan hash val