materialized view Define Constraints on Views【每日一译】--20121204

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.

数据仓库应用组织多维数据在库里通过支持关系完整性约束在关系对象里。关系约束表现

为主键和外键在多表间的关系。通过查询ORACLE的数据字典,应用可以清楚RI约束并且

可以识别在库里的多维数据。在一些环境里,DBA,出于对象的复制或者安全的理由,定义

视图在实表和维度表。ORACLE提供了约束视图的能力。通过允许定义约束在多个视图间,

DBA可以让基表的约束用在视图上,所以允许应用去组织多维数据甚至在一个受限的环境里。

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:

只有逻辑约束,也就是,约束是可定义的并且不是通过ORACLE强制的,它可以定义在视图上。

这些约束的目的不是强制任何的商业规则而是为了支持多维数据。以下的约束可以定义在视图上:

■ 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.

#主键的约束

#唯一约束

#关系完整性约束

鉴于这种观点约束是可定义,DISABLE,NOVALIDATE是仅有的可用的视图约束状态。况且

RELY或者NORELY状态也是允许的,因为在这些视图上的约束可以用于开启更多的复制查询重写;

一个视图的约束在RELY状态允许查询写入的发生在当重写完整性级别被设为信任模式时。

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

备注:尽管视图约束定义是可定义的在正常情况下,视图上的操作要服务定义在基表的完整性约束,

并且视图可以被强制通过在基表上的约束。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值