环境:Oracle 11.2.0.3 需求:生产一张表由于前期设计不当,没有主键。现需要添加主键,数据量很大,想并行建立。
1.直接添加,提示ora-3001:未实施的功能;只能单线程建立主键
SQL> alter table t add constraint pk_t primary key (object_id) using index online parallel 2;
alter table t add constraint pk_t primary key (object_id) using index online parallel 2ORA-03001: 未实施的功能SQL> alter table t add constraint pk_t primary key (object_id) using index online;Table alteredSQL> alter table t drop primary key;Table alteredSQL> create unique index pk_t on t(object_id) parallel 2 online;
Index createdSQL> alter table t add constraint pk_t primary key (object_id);Table alteredSQL> alter index pk_t noparallel;Index altered原文:https://www.cnblogs.com/zjpeng/p/10705729.html