Views and Base Tables【每日一译】--2013-1-11

An attempt to use an invalid view automatically causes Oracle to recompile the view
dynamically. After replacing the view, the view might be valid or invalid, depending

on the following conditions:

自动尝试使用无效的视图促使O去动态编译视图。当替换视图后,视图有可能有效

或者无效,取决于以下几个条件:

■ All base tables referenced by the defining query of a view must exist. If a base
table of a view is renamed or dropped, the view is invalidated and cannot be used.
References to invalid views cause the referencing statement to fail. The view can
be compiled only if the base table is renamed to its original name or the base table

is re-created.

#所有与视图定义查询的基表必须存在。如果基表或者视图换名或者DROP,视图将

变得无效并且不能被使用。与无效视图相关的将导致相关语句失败。视图可以被编译

仅当基表被重命名回原来的名字或者基表被重新创建。

■ If a base table is altered or re-created with the same columns, but the datatype of
one or more columns in the base table is changed, then most dependent views can

be recompiled successfully.

#如果基表被修改或者重新创建使用相同的列,但一列或多列在数据类型在基表中被

修改,那么多数依赖视图可以被成功的编译。

■ If a base table of a view is altered or re-created with at least the same set of
columns, then the view can be validated. The view cannot be validated if the base
table is re-created with new columns and the view references columns no longer
contained in the re-created table. The latter point is especially relevant in the case
of views defined with a SELECT * FROM table query, because the defining
query is expanded at view creation time and permanently stored in the data

dictionary.

#如果视图基表被修改或者重建包含至少原来的所有列,那么视图将是有效的。当基表

在重建后包含新列并且与视图相关的列不在包含在新建的基表中,那么视图将是无效的。

后面那一点尤为相关在视图定义使用SELECT * FROM TABLE查询,因为定义查询在视

图创建时已经自动扩展并且永久存储在数据字典中。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值