alter table table_name parallel(degree 4)---4是修改该表并行度
alter table table_name parallel ---修改并行度为默认值
建索引时,我们为了建索引快,会加上并行,加上并行之后,此列索引就会是并行了。访问有并行度的索引时,CBO可能可能会考虑并行执行,这可能会引发一些问题,如在服务器资源紧张的时候用并行会引起更加严重的争用。当使用并行后,需要把并行度改回来。\x0d\x0aSQL>drop table test purge\x0d\x0aSQL>create table test as select * from dba_objects\x0d\x0aSQL>create index ind_t_object_id on test(object_id) parallel 4 \x0d\x0aSQL>select s.degree\x0d\x0afrom dba_indexes s\x0d\x0awhere s.index_name = upper('ind_t_object_id')\x0d\x0aDEGREE\x0d\x0a----------------------------------------\x0d\x0a4\x0d\x0a\x0d\x0aSQL>alter index ind_t_object_id noparallel\x0d\x0a\x0d\x0aSQL>select s.degree\x0d\x0afrom dba_indexes s\x0d\x0awhere s.index_name = upper('ind_t_object_id')\x0d\x0aDEGREE\x0d\x0a----------------------------------------\x0d\x0a1欢迎分享,转载请注明来源:内存溢出
评论列表(0条)