-- 移除索引
drop index TB_1;
drop index TB_2 ;
alter table TB drop constraint PK_TB;
--允许列为空
alter table TB modify (LN_NO CHAR(16) NULL);
alter table TB modify (IVS_NO CHAR(16) NULL);
--创建自增序列
create sequence SEQ_REC_ID
minvalue 1
maxvalue 999999999
start with 1
increment by 1
nocache;
--增加ID列
--alter table TB drop column ID;
alter table TB add (ID INT NULL);
UPDATE TB SET ID=SEQ_REC_ID.NEXTVAL;
alter table TB MODIFY (ID INT NOT NULL);
--创建主键
alter table TB
add constraint PK_TB primary key (ID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);