a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 137|回复: 0

[考试辅导] oracle认证应用技术学习资料汇总2

[复制链接]
发表于 2012-8-4 14:06:19 | 显示全部楼层 |阅读模式
约束状态 . H  e  y; W( d
  enable validate:是默认,新旧数据同时满足约束规则 % n+ h/ H/ ?: i! d
  enable novalidate:旧数据可以不满足,检新插入的数据要满足约束 2 j7 [$ i2 g% U* D
  disable validate:不允许在表上执行任何DML操作,主要用在分区表,对于主键和唯一约事,会删除相应的唯一索引,但约束状态任可用 2 T9 J, F* `- E2 M3 u' E. m
  disable novalidate数据可不满足约束规则,对于主键和唯一约事,会删除相应的唯一索引,
, y: K  d6 J; o7 F
( R+ ~% D, V2 o3 K7 i5 A# o约束常用语句
, X0 e8 k, W, G6 H' p  create table t(i number,v mubmer not null) 9 U8 S4 c, A* z" x: ~
  create table t(i number,v mubmer unique) ) ]/ M+ v3 G9 u, W8 e' X
  create table t(i number constraint pk_i primary key,v number) 7 ?" \# m! R8 [4 w
  create table t2(c number,d number,constraint fk_d foreign key(c),references t1(v)); # m6 a) B: z0 m; U' }& c
  alter table t add constraint pk_i primary key (i) ; m+ M" A8 A& @. e% H4 N' K6 @. L
  alter table t modify i not null; * z; n( a" y6 v( P  x6 D
  alter table t add constraint t_i unique(i)[(create index ind_name on t(i))];
" ?6 n% o& F- _% Y' Y+ }  alter table t add constraint t_i check(i in (1,2,3,4,5));
& `' ]* y: l- f  d. a' x2 D8 e# B  alter table t disable novalidate constraint i # }- G! r9 V% ?6 ~1 V! ^. }" o
  alter table t enable novalidate constraint check_i
2 \$ i( h9 x" D% I; t2 G1 p  alter table t drop constraint i;
% H) J1 H9 w. U- f& d: U. `3 g& A  alter table t drop primary key i;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-5 14:37 , Processed in 0.234065 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表