本文共 535 字,大约阅读时间需要 1 分钟。
以下演示均在oracle数据库环境下。
管理员通常用来管理数据库。所以我们用之前创建的普通用户test1。参见(test1建了两个表tank,student)首先连接数据库 查询本用户的所有表:select table_name from user_tables; 查询本用户下所有列:select table_name,column_name from user_tab_columns;
sql语句:
查询数据库中所有用户的所有表:select user,table_name from all_tables; 查询所有用户的表,视图等:select * from all_tab_comments; 查询本用户的表,视图等:select * from user_tab_comments; 查询所有用户的表的列名和注释:select * from all_col_comments; 查询本用户的表的列名和注释:select * from user_col_comments; 查询所有用户的表的列名等信息:select * from all_tab_columns; 查询本用户的表的列名等信息:select * from user_tab_columns ;转载地址:http://dzwzb.baihongyu.com/