Views and Base Tables (243)
A view depends on the base tables or views referenced in its defining query. If the
defining query of a view is not explicit about which columns are referenced, for
example, SELECT * FROM table, then the defining query is expanded when stored
in the data dictionary to include all columns in the referenced base table at that time.
If a base table or view of a view is altered, renamed, or dropped, then the view is
invalidated, but its definition remains in the data dictionary along with the privileges,
synonyms, other objects, and other views that reference the invalid view.
Note: Whenever you create a table, index, and view, and then drop
the table, all objects dependent on that table are invalidated, including
views, packages, package bodies, functions, and procedures.
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:
■ 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.
■ 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.
檢視和基表
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-983759/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Validating Tables, Indexes, Clusters, and Materialized ViewsIndexZedView
- Structure of the Data Dictionary : Base Tables (258)Struct
- ORA-02030: can only select from fixed tables/viewsView
- Oracle 12C新特性-資料泵新引數(VIEWS_AS_TABLES)OracleView
- Oracle:ORA-01219:database not open:queries allowed on fixed tables/views onlyOracleDatabaseView
- [20121101]物化檢視與表(Materialized Views and Tables).txtZedView
- DML ViewsView
- dba_tables,dba_all_tables,user_tables,all_tables有什麼區別
- 8.1.1 V$ ViewsView
- 8.1.2 GV$ ViewsView
- Parallel query & viewsParallelView
- External Views (33)View
- Overview of Views (174)View
- 【12C】資料泵新特性(DISABLE_ARCHIVE_LOGGING+VIEWS_AS_TABLES匯出檢視+LOGTIME)HiveView
- Oracle TablesOracle
- barbajs-ViewsJSView
- Some Dictionary Views For ASMViewASM
- How Views are Stored (175)View
- How Views Are Used (176)View
- Mechanics of Views (177)View
- Dependencies and Views (180)View
- Object Views (182)ObjectView
- [LeetCode] 243. Shortest Word DistanceLeetCode
- 人工智障?243個機器人被裁機器人
- TSC 243pro印表機偏移問題
- Oracle Externale TablesOracle
- Oracle - Tables/IndexesOracleIndex
- Oracle X$TablesOracle
- Oracle X$ TablesOracle
- Edit SAP tables
- Oracle Partitioned TablesOracle
- MySQL 5.5 LOCK TABLES 和 UNLOCK TABLES 語句介紹MySql
- The differences between index-organized tables and ordinary tables (228)IndexZed
- Oracle's V$ Views(轉)OracleView
- About Static Data Dictionary ViewsView
- Views with the Prefix USER (267)View
- Views with the Prefix ALL (268)View
- Views with the Prefix DBA (269)View