获取所有的表名和标注释

SELECT
a.TABLE_NAME,b.COMMENTS
FROM
all_tables a left join user_tab_comments b on a.TABLE_NAME=b.TABLE_NAME
WHERE
a.OWNER='数据库名称'
ORDER BY
a.TABLE_NAME

 

获取所有的表字段,类型,长度和注释

select distinct a.TABLE_NAME,a.COLumn_name,a.data_type,a.data_length,c.comments from all_tab_columns a
inner join all_tables b on a.TABLE_NAME=b.TABLE_NAME and a.OWNER=b.OWNER

inner join all_col_comments c on a.TABLE_NAME=c.TABLE_NAME and a.COLumn_name=c.COLumn_name
where b.OWNER='数据库名称' order by a.TABLE_NAME;