转:Oracle查询库表列的信息

-- 查看ORACLE 数据库中本用户下的所有表
SELECT table_name FROM user_tables;

-- 查看ORACLE 数据库中所有用户下的所有表
select user,table_name from all_tables;

-- 查看ORACLE 数据库中本用户下的所有列
select table_name,column_name from user_tab_columns;

-- 查看ORACLE 数据库中本用户下的所有列
select user,table_name,column_name from all_tab_columns;
显示数据库中所有的用户列,查询结果包括所属表明,列名,类型,和comments
select   a.TABLE_NAME,a.COLUMN_NAME,a.COMMENTS   from   user_col_comments   a,user_col_comments   b   where   a.TABLE_NAME=b.TABLE_NAME   and   a.COLUMN_NAME=b.COLUMN_NAME;
查询外键约束引用的表。
select * from user_constraints where
R_CONSTRAINT_NAME in (select * from user_constraints where table_name = 'PARTY') ;

猜你喜欢

转载自liuqiang5151.iteye.com/blog/1489254