1 查看数据库中全部的表
select * from user_tables; --获取当前用户的表
select * from all_tables where owner = 'HS_RPT'; --所有用户的表,可根据用户筛选
select * from dba_tables; --包括系统表
2 获取全部表的字段
select * from user_tab_columns;--获取当前用户
select * from all_tab_columns;--所有用户
select * from dba_tab_columns;--包括系统表
3 获取全部表的注释
select * from user_col_comments;--获取当前用户
select * from all_col_comments where owner='HS_OPT';--所有用户的表的字段注释,可根据用户或表名筛选
select * from dba_col_comments;--包括系统表
用途: 可以根据注释查找查找字段或者表名:
select table_name,column_name,comments from user_col_comments where comments = '查找字段或者表名';
本文详细介绍了如何通过SQL查询获取数据库中的表、字段信息以及注释,包括用户表、所有表、系统表的筛选,以及根据注释搜索特定字段或表名的方法,是数据库管理者的实用工具。
4613

被折叠的 条评论
为什么被折叠?



