--新增列
alter table tabA add id2 varchar2(32); --备份值 update tabA set id2 = id; --删主键 alter table tabA drop primary key cascade drop index; --允许空 alter table tabA modify id null; --更新空 update tabA set id = null; --改类型 alter table tabA modify id integer; --恢复值 update tabA set id = id2; --加主键 alter table tabA add constraint pk_tabA primary key (id); --删除列 alter table tabA drop column id2;