Oracle、MySQL、SQLserver 元数据查询

关系型数据库 - 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值