关系型数据库 - MySQL及SQLserver
rdbms_table : information_schema.tables
rdbms_column : information_schema.columns
rdbms_index : information_schema.statistics 包含聚簇索引,SQLserver中没有该表,调用存储过程,如 exec sp_statistics 'table_name';
rdbms_foreign_key : information_schema.key_column_usage ,其中 POSITION_IN_UNIQUE_CONSTRAINT != null
rdbms_proc : information_schema.routines , 其中 ROUTINE_TYPE == PROCEDURE
rdbms_fn : information_schema.routines, 其中 ROUTINE_TYPE == FUNCTION
关系型数据库 - Oracle
rdbms_table : USER_TABLES、ALL_TABLES、DBA_TABLES
rdbms_column : USER_TAB_COLUMNS、ALL_TAB_COLUMNS、DBA_TAB_COLUMNS
rdbms_index : USER_INDEXES、ALL_INDEXES、DBA_INDEXES
rdbms_foreign_key : USER_CONSTRAINTS、ALL_CONSTRAINTS、DBA_CONSTRAINTS,其中 CONSTRAINT_TYPE = R 表示 外键约束 (P 表示主键约束)
rdbms_proc : USER_SOURCE、ALL_SOURCE、DBA_SOURCE 其中 TYPE = PROCEDURE
rdbms_fn : USER_SOURCE、ALL_SOURCE、DBA_SOURCE 其中 TYPE = FUNCTION
ps : 关于 ALL_* 、DBA_* 和 USER_* 的查询范围,以 TABLES 为例:
DBA_TABLES describes all relational tables in the database.
ALL_TABLES describes the relational tables accessible to the current user.
USER_TABLES describes the relational tables owned by the current user.