Oracle并行添加主键的方法
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 2 ORA-03001: 未实施的功能 SQL> alter table t add constraint pk_t primary key (object_id) using index online; Table altered SQL> alter table t drop primary key; Table altered
SQL> create unique index pk_t on t(object_id) parallel 2 online; Index created SQL> alter table t add constraint pk_t primary key (object_id); Table altered SQL> alter index pk_t noparallel; Index altered
SQL> desc t Name Type Nullable Default Comments -------------- ------------- -------- ------- -------- OWNER VARCHAR2(30) Y OBJECT_NAME VARCHAR2(128) Y SUBOBJECT_NAME VARCHAR2(30) Y OBJECT_ID NUMBER DATA_OBJECT_ID NUMBER Y OBJECT_TYPE VARCHAR2(19) Y CREATED DATE Y LAST_DDL_TIME DATE Y TIMESTAMP VARCHAR2(19) Y STATUS VARCHAR2(7) Y TEMPORARY VARCHAR2(1) Y GENERATED VARCHAR2(1) Y SECONDARY VARCHAR2(1) Y NAMESPACE NUMBER Y EDITION_NAME VARCHAR2(30) Y SQL> alter table t drop primary key; Table altered SQL> desc t Name Type Nullable Default Comments -------------- ------------- -------- ------- -------- OWNER VARCHAR2(30) Y OBJECT_NAME VARCHAR2(128) Y SUBOBJECT_NAME VARCHAR2(30) Y OBJECT_ID NUMBER Y DATA_OBJECT_ID NUMBER Y OBJECT_TYPE VARCHAR2(19) Y CREATED DATE Y LAST_DDL_TIME DATE Y TIMESTAMP VARCHAR2(19) Y STATUS VARCHAR2(7) Y TEMPORARY VARCHAR2(1) Y GENERATED VARCHAR2(1) Y SECONDARY VARCHAR2(1) Y NAMESPACE NUMBER Y EDITION_NAME VARCHAR2(30) Y
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。