并行索引SQL语句示例:
1.建立并行索引
create index indexname on tablemane(to_char(字段,'yyyy-mm-dd')) online parallel 8
tablespace tablespace
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
其中:
--indexname:索引名
--tablename:添加索引的表
--parallel :并行数
--tablespace:表空间名
2.结束并行
alter index indexname noparallel;
3.执行表信息收集使得索引生效
exec dbms_stats.gather_table_stats(ownname=>'用户名',tabname=>'表名',estimate_percent=>30,cascade=>true);