首页 > IT基础架构 > 网络安全 > Define Constraints on Views (188)

Define Constraints on Views (188)

原创 网络安全 作者:tsinglee 时间:2007-11-12 16:31:40 0 删除 编辑

Data warehousing applications recognize multidimensional data in the Oracle
database by identifying Referential Integrity (RI) constraints in the relational schema.
RI constraints represent primary and foreign key relationships among tables. By
querying the Oracle data dictionary, applications can recognize RI constraints and
therefore recognize the multidimensional data in the database. In some environments,
database administrators, for schema complexity or security reasons, define views on
fact and dimension tables. Oracle provides the ability to constrain views. By allowing
constraint definitions between views, database administrators can propagate base
table constraints to the views, thereby allowing applications to recognize
multidimensional data even in a restricted environment.

Only logical constraints, that is, constraints that are declarative and not enforced by
Oracle, can be defined on views. The purpose of these constraints is not to enforce any
business rules but to identify multidimensional data. The following constraints can be
defined on views:
■ Primary key constraint
■ Unique constraint
■ Referential Integrity constraint
Given that view constraints are declarative, DISABLE, NOVALIDATE is the only valid
state for a view constraint. However, the RELY or NORELY state is also allowed,
because constraints on views may be used to enable more sophisticated query
rewrites; a view constraint in the RELY state allows query rewrites to occur when the
rewrite integrity level is set to trusted mode.

Note: Although view constraint definitions are declarative in nature,
operations on views are subject to the integrity constraints defined on
the underlying base tables, and constraints on views can be enforced
through constraints on base tables.

1. Oracle 还提供了在视图上定义约束的功能 , 数据库管理员可以将基表上的约束propagate在视图上
2. 只有逻辑约束(用户声明而非Oracle强制)才能定义在视图上
3. 主键约束 , 唯一键约束 , 引用完整性约束可定义在视图上
4. 定义在视图上的约束是声明性质的 , 对于视图约束来说DISABLE, NOVALIDATE两种状态是有效的
RELY or NORELY两种状态也是允许的(使用查询重写)
5. 当重写完整性级别(被设为信任模式时 , 将视图约束设置为 RELY 状态将允许使用查询重写.


来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
  • 博文量
  • 访问量