Oracle中怎么查看所有表和字段

62次阅读
没有评论

共计 1498 个字符,预计需要花费 4 分钟才能阅读完成。

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

获取表

#当前用户拥有的表  select table_name from user_tables; #所有用户的表  select table_name from all_tables; # 包括系统表  select table_name from dba_tables; select table_name from dba_tables where owner= 用户名  #描述当前用户有访问权限的所有对象  ALL_OBJECTS describes all objects accessible to the current user. #描述了数据库中的所有对象  DBA_OBJECTS describes all objects in the database. # 描述了当前用户所拥有的所有对象  USER_OBJECTS describes all objects owned by the current user.

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 * from user_tab_columns where Table_Name= 用户表  select * from all_tab_columns where Table_Name= 用户表  select * from dba_tab_columns where Table_Name= 用户表 

获取表注释

user_tab_comments; 表注释  select * from user_tab_comments

user_tab_comments:table_name,table_type,comments。

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

获取字段注释

select * from user_col_comments user_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 中怎么查看所有表和字段,丸趣 TV 小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注丸趣 TV 行业资讯频道。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-03发表,共计1498字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)