Oracle query table column comment

Query Table

1
2
3
4
5
6
7
8
9
10
-- current user's table
select table_name from user_tables;

-- all user's table
select table_name from all_tables;

-- contain system's table
select table_name from dba_tables;
-- filter
select table_name from dba_tables where owner='用户名'

user_tables

Query Column

1
2
3
select * from user_tab_columns where Table_Name='xxx';
select * from all_tab_columns where Table_Name='xxx';
select * from dba_tab_columns where Table_Name='xxx';

user_tab_columns

Query Comment

1
2
3
4
5
6
7
8

select * from user_tab_comments;
select * from user_tab_comments t where t.COMMENTS like '%shit%' order by t.TABLE_NAME;

select * from user_col_comments;
select * from user_col_comments t where t.COLUMN_NAME='xxx';

select * from user_tab_comments t1, user_col_comments t2 where t1.TABLE_NAME = t2.TABLE_NAME and t2.COMMENTS like '%shit%';

user_tab_comments

user_col_comments