类一.user_XXX :当前用户的系统视图
[b]1.user_tables:当前用户的所有表[/b]
[b]2.user_constraints:当前用户的表约束[/b]
SQL> desc user_constraints;
Name Type Nullable Default Comments
----------------- ------------ -------- ------- ---------------------------------------------------------------------------
OWNER VARCHAR2(30) Owner of the table
CONSTRAINT_NAME VARCHAR2(30) Name associated with constraint definition
CONSTRAINT_TYPE VARCHAR2(1) Y Type of constraint definition
TABLE_NAME VARCHAR2(30) Name associated with table with constraint definition
SEARCH_CONDITION LONG Y Text of search condition for table check
R_OWNER VARCHAR2(30) Y Owner of table used in referential constraint
R_CONSTRAINT_NAME VARCHAR2(30) Y Name of unique constraint definition for referenced table
DELETE_RULE VARCHAR2(9) Y The delete rule for a referential constraint
STATUS VARCHAR2(8) Y Enforcement status of constraint - ENABLED or DISABLED
DEFERRABLE VARCHAR2(14) Y Is the constraint deferrable - DEFERRABLE or NOT DEFERRABLE
DEFERRED VARCHAR2(9) Y Is the constraint deferred by default - DEFERRED or IMMEDIATE
VALIDATED VARCHAR2(13) Y Was this constraint system validated? - VALIDATED or NOT VALIDATED
GENERATED VARCHAR2(14) Y Was the constraint name system generated? - GENERATED NAME or USER NAME
BAD VARCHAR2(3) Y Creating this constraint should give ORA-02436. Rewrite it before 2000 AD.
RELY VARCHAR2(4) Y If set, this flag will be used in optimizer
LAST_CHANGE DATE Y The date when this column was last enabled or disabled
INDEX_OWNER VARCHAR2(30) Y The owner of the index used by the constraint
INDEX_NAME VARCHAR2(30) Y The index used by the constraint
INVALID VARCHAR2(7) Y
VIEW_RELATED VARCHAR2(14) Y
[b]3.user_cons_columns :是表约束字段的视图,说明表中的和约束相关的列参与了哪些约束。这些约束有主键约束,外键约束,索引约束[/b]
desc user_cons_columns;
Name Type Nullable Default Comments
--------------- -------------- -------- ------- ------------------------------------------------------------------------------------------------
OWNER VARCHAR2(30) Owner of the constraint definition
CONSTRAINT_NAME VARCHAR2(30) Name associated with the constraint definition
TABLE_NAME VARCHAR2(30) Name associated with table with constraint definition
COLUMN_NAME VARCHAR2(4000) Y Name associated with column or attribute of object column specified in the constraint definition
POSITION NUMBER Y Original position of column or attribute in definition
[b]1.user_tables:当前用户的所有表[/b]
[b]2.user_constraints:当前用户的表约束[/b]
SQL> desc user_constraints;
Name Type Nullable Default Comments
----------------- ------------ -------- ------- ---------------------------------------------------------------------------
OWNER VARCHAR2(30) Owner of the table
CONSTRAINT_NAME VARCHAR2(30) Name associated with constraint definition
CONSTRAINT_TYPE VARCHAR2(1) Y Type of constraint definition
TABLE_NAME VARCHAR2(30) Name associated with table with constraint definition
SEARCH_CONDITION LONG Y Text of search condition for table check
R_OWNER VARCHAR2(30) Y Owner of table used in referential constraint
R_CONSTRAINT_NAME VARCHAR2(30) Y Name of unique constraint definition for referenced table
DELETE_RULE VARCHAR2(9) Y The delete rule for a referential constraint
STATUS VARCHAR2(8) Y Enforcement status of constraint - ENABLED or DISABLED
DEFERRABLE VARCHAR2(14) Y Is the constraint deferrable - DEFERRABLE or NOT DEFERRABLE
DEFERRED VARCHAR2(9) Y Is the constraint deferred by default - DEFERRED or IMMEDIATE
VALIDATED VARCHAR2(13) Y Was this constraint system validated? - VALIDATED or NOT VALIDATED
GENERATED VARCHAR2(14) Y Was the constraint name system generated? - GENERATED NAME or USER NAME
BAD VARCHAR2(3) Y Creating this constraint should give ORA-02436. Rewrite it before 2000 AD.
RELY VARCHAR2(4) Y If set, this flag will be used in optimizer
LAST_CHANGE DATE Y The date when this column was last enabled or disabled
INDEX_OWNER VARCHAR2(30) Y The owner of the index used by the constraint
INDEX_NAME VARCHAR2(30) Y The index used by the constraint
INVALID VARCHAR2(7) Y
VIEW_RELATED VARCHAR2(14) Y
[b]3.user_cons_columns :是表约束字段的视图,说明表中的和约束相关的列参与了哪些约束。这些约束有主键约束,外键约束,索引约束[/b]
desc user_cons_columns;
Name Type Nullable Default Comments
--------------- -------------- -------- ------- ------------------------------------------------------------------------------------------------
OWNER VARCHAR2(30) Owner of the constraint definition
CONSTRAINT_NAME VARCHAR2(30) Name associated with the constraint definition
TABLE_NAME VARCHAR2(30) Name associated with table with constraint definition
COLUMN_NAME VARCHAR2(4000) Y Name associated with column or attribute of object column specified in the constraint definition
POSITION NUMBER Y Original position of column or attribute in definition