本篇文章给大家分享的是有关Oracle中怎么查看所有表和字段,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

获取表

#当前用户拥有的表selecttable_namefromuser_tables;#所有用户的表selecttable_namefromall_tables;#包括系统表selecttable_namefromdba_tables;selecttable_namefromdba_tableswhereowner='用户名'#描述当前用户有访问权限的所有对象ALL_OBJECTSdescribesallobjectsaccessibletothecurrentuser.#描述了数据库中的所有对象DBA_OBJECTSdescribesallobjectsinthedatabase.#描述了当前用户所拥有的所有对象USER_OBJECTSdescribesallobjectsownedbythecurrentuser.

user_tables:TABLE_NAME,TABLESPACE_NAME,LAST_ANALYZED等

dba_tables:ower,table_name,tablespace_name,last_analyzed等

all_tables:ower,table_name,tablespace_name,last_analyzed等

all_objects:ower,object_name,subobject_name,object_id,created,last_ddl_time,timestamp,status等

获取表字段

select*fromuser_tab_columnswhereTable_Name='用户表';select*fromall_tab_columnswhereTable_Name='用户表';select*fromdba_tab_columnswhereTable_Name='用户表';

获取表注释

user_tab_comments;表注释select*fromuser_tab_comments

user_tab_comments:table_name,table_type,comments。

相应的还有dba_tab_comments,all_tab_comments,这两个比user_tab_comments多了ower列。

获取字段注释

select*fromuser_col_commentsuser_col_comments:table_name,column_name,comments

相应的还有dba_col_comments,all_col_comments,这两个比user_col_comments多了ower列。

user_col_comments;表字段注释(列注释)

user_col_comments视图显示已经为表中的列输入的注释。这些注释通过comment命令添加到数据库中。user_col_comments视图包含3 列:

Table_Name 表名或视图名

Column_Name 列名

Comments 已经为该列输入的注释

以上就是Oracle中怎么查看所有表和字段,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注亿速云行业资讯频道。