温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2021-08-13 11:03:48 来源:亿速云 阅读:342 作者:Leah 栏目:数据库

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

获取表

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

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI