oracle查看所有表信息和字段信息以及注釋信息等


1、獲取表:

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等

2、獲取表字段:

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列。

3、獲取表注釋:

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列。

4、獲取字段注釋:

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 已經為該列輸入的注釋

5、查表字段注釋事例:

查看JH表中字段的注釋:
select table_name,column_name,comments from user_col_comments where table_name='JH';


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM