您的位置:首页 > 其它

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

2013-02-17 16:03 483 查看
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查询,因为定义查询在视

图创建时已经自动扩展并且永久存储在数据字典中。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: