Oracle 查询数据库中所有表和字段以及表注释、字段注释等信息
修改字段注释
COMMENT ON COLUMN 表名.字段名 IS '注释内容';
获取表
select table_name from user_tables; //当前用户拥有的表 select table_name from all_tables; //所有用户的表 select table_name from dba_tables; //包括系统表 select table_name from dba_tables where owner='用户名'
获取表字段
select * from user_tab_columns where Table_Name=‘用户表’; select * from all_tab_columns where Table_Name=‘用户表’; select * from dba_tab_columns where Table_Name=‘用户表’;
获取表注释
user_tab_comments; 表注释
select * from user_tab_comments; select * from dba_tab_comments; select * from all_tab_comments;
获取字段注释
user_col_comments;表字段注释(列注释)
select * from user_col_comments select * from dba_col_comments select * from all_col_comments
查表字段注释示例
select table_name,column_name,comments from user_col_comments where table_name='JH';