7

我知道 Oracle 数据库中的视图、物化视图、强制视图等。今天当我不得不调整我在下面看到的一个包时

CREATE OR REPLACE FORCE EDITIONABLE VIEW "IMCAPPS"."PJM_EID_ONHAND_VALUES_V"

谁能告诉我FORCE EDITIONABLE VIEW当我们使用它时它是什么以及它提供的好处。

4

1 回答 1

13

FORCE and EDITIONABLE are two different things.

FORCE instructs the database to create the view regardless of whether the query is valid. Default behaviour is for a CREATE VIEW statement to fail if its query does not compile for any reason (e.g. invalid syntax, missing privileges on a referenced object). However, this is not always desirable, especially when we're running a long build script with lots of statements. Using FORCE means the view is created but with USER_OBJECTS.STATUS of INVALID. The view exists but we cannot use it until we fix the underlying issue. However, at least our build script can run to completion.

EDITIONABLE is a keyword relating to Edition-based Redefinition. This is a mechanism Oracle provides which allows us to support multiple versions of the same object in our database. This can be very useful for wrangling complex deployments in live environments. In my experience very few places avail themselves of this capability. Find out more.

于 2020-10-12T12:03:27.913 回答