oracle 如果 FORCED 视图的基表不存在,它们的重要性如何?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1699830/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 19:23:41  来源:igfitidea点击:

How are FORCED views significant if their base tables don't exist?

oracleviews

提问by Sachin Chourasiya

In context of Oracle 9i database, usually for a view to be created an underlying base table is mandatory, however this constraint can be violated if the FORCED clause is used while creating the view. What is the significance of these views if their base tables does not exist? In which conditions these views will be of help?

在 Oracle 9i 数据库的上下文中,通常对于要创建的视图,底层基表是强制性的,但是如果在创建视图时使用 FORCED 子句,则可能违反此约束。如果它们的基表不存在,这些视图有什么意义?在哪些情况下这些观点会有所帮助?

回答by Vincent Malgrat

you would use the FORCE keyword if you are creating several views that reference each other and you don't want to spend time to determine in which order they should be created.

如果要创建多个相互引用的视图,并且不想花时间确定它们的创建顺序,则可以使用 FORCE 关键字。

See also:

也可以看看:

streamlining creating of packages and views

简化包和视图的创建

回答by Tony Andrews

On a large project this can be very useful: I create a table, someone else creates a packaged function, and you create a view that accesses the table and the packaged function. We then all put our DDL into the source control / release system and the DBA installs all the code on the test / production system. The FORCE keyword ensures that the view gets created, though possibly in an invalid state, even if its DDL is run before the table and/or package DDL.

在大型项目中,这可能非常有用:我创建一个表,其他人创建一个打包函数,然后您创建一个访问该表和打包函数的视图。然后我们都将我们的 DDL 放入源代码控制/发布系统,DBA 将所有代码安装在测试/生产系统上。FORCE 关键字确保视图被创建,尽管可能处于无效状态,即使它的 DDL 在表和/或包 DDL 之前运行。