資料庫物件、表空間、表、檢視、索引、同義詞序列等的字典

skyin_1603發表於2016-12-22

----物件資料字典:

---1檢視相關字典的源字典

select * from dict;

 

---2查看所有物件objects

sys@PROD>select * from all_objects;

sys@PROD>select * from dba_objects;

sys@PROD>select * from user_objects;

#檢視各個使用者的所有物件。

---3檢視tab的資訊:

susu@PROD>select * from tab;

#檢視各個使用者的表與檢視物件。

 

---4檢視錶物件Tables

sys@PROD>select * from all_tables;

sys@PROD>select * from all_all_tables;

#兩個字典查詢的資訊差不多相同。

 

sys@PROD>select * from dba_tables;

sys@PROD>select * from dba_all_tables;

 

sys@PROD>select * from user_tables;

sys@PROD>select * from user_all_tables;

 

---5檢視索引Indexes:

sys@PROD>select * from all_indexes;

sys@PROD>select * from dba_indexes;

sys@PROD>select * from user_indexes;

 

---6檢視欄位cols:

sys@PROD>select * from dba_tab_cols;

sys@PROD>select * from all_tab_cols;

sys@PROD>select * from user_tab_cols;

 

---7檢視錶空間tablespace

sys@PROD>select * from dba_tablespaces;

sys@PROD>select * from dba_tablespace_groups;

sys@PROD>select * from user_tablespaces;

sys@PROD>select * from v$tablespace;

---8檢視檢視views

sys@PROD>select * from all_views;

sys@PROD>select * from dba_views;

sys@PROD>select * from user_views;

---9檢視序列sequences的資訊:

Select * from dba_sequences;

Select * from all_sequences;

Select * from user_sequences;

 

---10檢視同義詞synonyms的資訊:

Select * from dba_synonyms;

Select * from all_synonyms;

Select * from user_synonyms;


---11檢視資料庫的database links的資訊:

Select * from dba_db_links;

sys@PROD>desc dba_db_links

 Name                                      Null?    Type

 ----------------------------------------- -------- ----------------------------

 OWNER                                     NOT NULL VARCHAR2(30)

 DB_LINK                                   NOT NULL VARCHAR2(128)

 USERNAME                                           VARCHAR2(30)

 HOST                                               VARCHAR2(2000)

 CREATED                                   NOT NULL DATE


--當然還有很多的檢視在日常資料庫管理中運用到的,其中還包括過程、函式、包與觸發器的檢視字典。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2131194/,如需轉載,請註明出處,否則將追究法律責任。

相關文章