共計 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 行業資訊頻道。