USER_CONSTRAINTS

描述了所有的當前用戶的所擁有的表的所有約束定義。列的內容和all_constraints相同

all_當前用戶可接觸的所有約束
user_當前用戶的表的所有約束
dba_數據庫的所有約束
三種約束情形。

CONSTRAINT_TYPE ,約束類型,本着節省使用空間的設計角度,這種類型的描述基本都是用字母來表示固定的概念。如C表示check constraint,P表示Primary Key,U表示unique,R表示Referential integrity,V表示With check option,O表示Read only,H表示Hash expression, F表示Constraint that involves a REF column,S表示Supplemental logging。(照搬了文檔)
這塊如果要優化的話,可以建議oracle開發插件,直接可以把這些東西和文檔關聯起來,方便新手入門。
SEARCH_CONDITION 檢查約束的搜索條件的文本。得在正確的容器下,不然不能用。也就是說只能看自己的。
R_OWNER Owner of the table referred to in a referential constraint
** R_CONSTRAINT_NAME** Name of the unique constraint definition for the referenced table

** DELETE_RULE** 約束的刪除條件 CASCADE, SET NULL,NO ACTION

STATUS ENABLED.DISABLED 約束的強制執行狀態 大概該約束是否強制執行?
DEFERRABLE 指示約束是否可延遲(DEFERRABLE)(NOT DEFERRABLE
DEFERRED Indicates whether the constraint was initially deferred (DEFERRED) or not (IMMEDIATE) 指示約束剛開始,最初是不是有延遲。
VALIDATEDSTATUS 有着關係,當STATUS=ENABLED

•VALIDATED - All data obeys the constraint (that is, the existing data in the table was validated when the constraint was enabled, as well as any subsequent data entered into the table)

•NOT VALIDATED - All data may not obey the constraint (that is, the existing data in the table was not validated when the constraint was enabled, but subsequent data entered into the table was validated)

STATUS = DISABLED

•VALIDATED - All data obeys the constraint, but the unique index on the constraint has been dropped. This setting is useful in data warehousing environments, but has some restrictions. Refer to Oracle Database Data Warehousing Guide for more information on this setting.

•NOT VALIDATED - All data may not obey the constraint

GENERATED 顯示這個約束的血統問題,是系統自帶的,還是用戶創建的。

Indicates whether the name of the constraint is user-generated (USER NAME) or system-generated (GENERATED NAME)

這個引用感覺弄得不好。
BAD 這個約束表達“世紀” 用一種模糊的方式還是不是用模糊的方式,爲了避免這個錯誤,重寫約束時使用to_date函數時用yyyy,rrrr這種四位數字的年份。 沒搞懂這個參數的意義是什麼。難道是程序員沒事幹了?
RELY 也是分情況的。當 VALIDATED = NOT VALIDATED,這個就表示爲重寫時是否要考慮約束。

When VALIDATED = NOT VALIDATED, this column indicates whether the constraint is to be taken into account(考慮) for query rewrite (RELY) or not (NULL).

When VALIDATED = VALIDATED, this column is not meaningful.

invalid 指出這個約束是否無效。
VIEW_RELATED 指出這個約束是否依賴視圖,這是個什麼場景? (DEPEND ON VIEW or NULL)
ORIGIN_CON_ID 一看就和多租戶有關,不用詳細介紹
oracle
在這裏插入圖片描述

發佈了19 篇原創文章 · 獲贊 15 · 訪問量 1492
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章