Oracle 约束的相关操作

2014-11-24 18:25:14 · 作者: · 浏览: 0

alter table mytable add primary key(col[,df[,..]])


alter table mytable add constraint constraint_name primary key(col)


alter table mytable disable primary key


alter table mytable constraint 原主键名 to 新


alter table t1 add constraint fk_t1_t2 foreign key (cid) references t2(cid);


alter table emp add constraint fk_a foreign (empno) references dept(deptno) on delete cascade


alter table emp rename constraint fk1 to fk2


alter table tablea disabled constraint fk_1;


--关闭数据完整性交验


alter table purchase enable novalidate constraint fk


alter table tableA drop constraint my_pk 删除约束


alter table add constraint name unique(col1,col2);


alter table mytable add constraint cons_name check(col

alter table mytable modify st default 'AC';\


alter table mytable modify(col1 not null)