Oracle之查询索引、索引列等信息
2017-04-17 14:43
232 查看
用user_indexes和user_ind_columns系统表查看已经存在的索引
user_indexes: 系统视图存放是索引的名称以及该索引是否是唯一索引等信息。
user_ind_column: 系统视图存放的是索引名称,对应的表和列等。
完整性约束
DBA_CONSTRAINTS、ALL_CONSTRAINTS和USER_CONSTRAINST 显示有关约束的一般信息。
查询数据库列级的约束信息
DBA_CONS_COLUMNS、ALL_CONS_COLUMNS和USER_CONS_COLUMNS 显示有关列的相关约束的一般信息。
ALL_CONS_COLUMNS 视图能够显示用户可以访问的所有表上约束的列信息,而不管所有者是谁。
DBA_CONS_COLUMNS 视图列出了整个数据库的列级约束信息。
USER_CONS_COLUMNS
数据字典表列说明:
---------------------------------------------------------------------------------
desc user_constraints
Name Comments
----------------- ---------------------------------------------------------------------------
OWNER Owner of the table
CONSTRAINT_NAME Name associated with constraint definition
CONSTRAINT_TYPE Type of constraint definition
TABLE_NAME Name associated with table with constraint definition
SEARCH_CONDITION Text of search condition for table check
c926
R_OWNER Owner of table used in referential constraint
R_CONSTRAINT_NAME Name of unique constraint definition for referenced table
DELETE_RULE The delete rule for a referential constraint
STATUS Enforcement status of constraint - ENABLED or DISABLED
DEFERRABLE Is the constraint deferrable - DEFERRABLE or NOT DEFERRABLE
DEFERRED Is the constraint deferred by default - DEFERRED or IMMEDIATE
VALIDATED Was this constraint system validated? - VALIDATED or NOT VALIDATED
GENERATED Was the constraint name system generated? - GENERATED NAME or USER NAME
BAD Creating this constraint should give ORA-02436. Rewrite it before 2000 AD.
RELY If set, this flag will be used in optimizer
LAST_CHANGE The date when this column was last enabled or disabled
INDEX_OWNER The owner of the index used by the constraint
INDEX_NAME The index used by the constraint
INVALID
VIEW_RELATED
-------------------------------------------------------------------------------------------------------------------------------------------------
desc user_cons_columns;
Name Comments
--------------- -------------- -------- ------- ------------------------------------------------------------------------------------------------
OWNER Owner of the constraint definition
CONSTRAINT_NAME Name associated with the constraint definition
TABLE_NAME Name associated with table with constraint definition
COLUMN_NAME Name associated with column or attribute of object column specified in the constraint definition
POSITION Original position of column or attribute in definition
user_indexes: 系统视图存放是索引的名称以及该索引是否是唯一索引等信息。
user_ind_column: 系统视图存放的是索引名称,对应的表和列等。
完整性约束
DBA_CONSTRAINTS、ALL_CONSTRAINTS和USER_CONSTRAINST 显示有关约束的一般信息。
查询数据库列级的约束信息
DBA_CONS_COLUMNS、ALL_CONS_COLUMNS和USER_CONS_COLUMNS 显示有关列的相关约束的一般信息。
ALL_CONS_COLUMNS 视图能够显示用户可以访问的所有表上约束的列信息,而不管所有者是谁。
DBA_CONS_COLUMNS 视图列出了整个数据库的列级约束信息。
USER_CONS_COLUMNS
数据字典表列说明:
---------------------------------------------------------------------------------
desc user_constraints
Name Comments
----------------- ---------------------------------------------------------------------------
OWNER Owner of the table
CONSTRAINT_NAME Name associated with constraint definition
CONSTRAINT_TYPE Type of constraint definition
TABLE_NAME Name associated with table with constraint definition
SEARCH_CONDITION Text of search condition for table check
c926
R_OWNER Owner of table used in referential constraint
R_CONSTRAINT_NAME Name of unique constraint definition for referenced table
DELETE_RULE The delete rule for a referential constraint
STATUS Enforcement status of constraint - ENABLED or DISABLED
DEFERRABLE Is the constraint deferrable - DEFERRABLE or NOT DEFERRABLE
DEFERRED Is the constraint deferred by default - DEFERRED or IMMEDIATE
VALIDATED Was this constraint system validated? - VALIDATED or NOT VALIDATED
GENERATED Was the constraint name system generated? - GENERATED NAME or USER NAME
BAD Creating this constraint should give ORA-02436. Rewrite it before 2000 AD.
RELY If set, this flag will be used in optimizer
LAST_CHANGE The date when this column was last enabled or disabled
INDEX_OWNER The owner of the index used by the constraint
INDEX_NAME The index used by the constraint
INVALID
VIEW_RELATED
-------------------------------------------------------------------------------------------------------------------------------------------------
desc user_cons_columns;
Name Comments
--------------- -------------- -------- ------- ------------------------------------------------------------------------------------------------
OWNER Owner of the constraint definition
CONSTRAINT_NAME Name associated with the constraint definition
TABLE_NAME Name associated with table with constraint definition
COLUMN_NAME Name associated with column or attribute of object column specified in the constraint definition
POSITION Original position of column or attribute in definition
相关文章推荐
- oracle查询对象(表、索引)空间信息
- oracle如何查询表的主键,外键,索引等信息
- oracle查询表信息(索引,外键,列等)
- 查询oracle表的信息(表,字段,约束,索引) 按列名+表名查询约束名称
- oracle查询表信息(索引,外键,列等......)
- 查询oracle表的信息(表,字段,约束,索引)
- oracle查询表信息、查询索引信息、查询外键信息、查询列信息等
- oracle查询表信息(索引,外键,列等)
- oracle查询表 索引、唯一约束、字段等相关信息
- oracle查询表信息(索引,外键,列等。。) 转帖
- oracle 查询表相关信息(索引、列等)
- oracle查询表信息(索引,外键,列等)
- 查询oracle表的信息(表,字段,约束,索引) 按列名+表名查询约束名称
- oracle查询表信息(索引,外键,列等)
- 查询oracle表的信息(表,字段,约束,索引)按列名+表名查询约束名称
- oracle查询表信息(索引,外键,列等)
- 查询oracle表的信息(表,字段,约束,索引)
- oracle查询表 索引、唯一约束、字段等相关信息
- oracle查询表信息(索引,外键,列等)
- oracle查询表信息(索引,外键,列等)