oracle中檢視所有表、欄位、表註釋、欄位註釋
阿新 • • 發佈:2018-11-10
oracle中檢視所有表、欄位、表註釋、欄位註釋
檢視所有表
select table_name from user_tables; //檢視當前使用者擁有的表
select table_name from all_tables; //檢視所有使用者的表
select table_name from dba_tables; //檢視所有使用者的表包括系統表
檢視所有表字段
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_columns:
table_name,column_name,data_type,data_length,data_precision,data_scale,nullable,column_id等
all_tab_columns ,dba_tab_columns比user_tab_columns多了一個ower
查看錶註釋和欄位註釋
select * from user_tab_comments //檢視當前使用者下所有表註釋 select * from user_col_comments where TABLE_NAME='某表名稱'; //檢視當前使用者下某表所有欄位註釋
user_tab_comments:
table_name,table_type,comments
user_col_comments:
table_name,column_name,comments