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
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
one or more columns in the base table is changed, then most dependent views can
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
dynamically. After replacing the view, the view might be valid or invalid, depending
on the following conditions:
自动尝试使用无效的视图促使O去动态编译视图。当替换视图后,视图有可能有效
或者无效,取决于以下几个条件:
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,视图将
变得无效并且不能被使用。与无效视图相关的将导致相关语句失败。视图可以被编译
仅当基表被重命名回原来的名字或者基表被重新创建。
one or more columns in the base table is changed, then most dependent views can
be recompiled successfully.
#如果基表被修改或者重新创建使用相同的列,但一列或多列在数据类型在基表中被
修改,那么多数依赖视图可以被成功的编译。
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查询,因为定义查询在视
图创建时已经自动扩展并且永久存储在数据字典中。
本文讨论了在数据库中使用和替换视图时,视图的有效性条件及其动态编译过程。详细阐述了视图基表存在性、基表列数据类型变更和基表重命名或创建对视图的影响。
1712

被折叠的 条评论
为什么被折叠?



