以下內容摘自oracle 11g 權威指南
tablespace(表空間)---》segment(段)---》extent(盤區)---》block(塊)
一、表空間和數據文件的關係
在oracle系統中,表空間與數據文件是一對不能分開的概念,創建表空間時必須創建數據文件,增加數據文件時必須制定表空間。
1、查詢表空間及其包含的數據文件
select tablespace_name,file_name,bytes from dba_data_files order by tablespace_name;
2、oracle默認表空間列表
example --如果安裝時候選擇實例方案,則此表空間是各樣例賬號的對象
sysaux--system表空間的輔助空間。一些選件的對象都存放在此表空間內以減少system表空間的負荷
system--存儲數據字典、包括表、視圖、存儲過程的定義等
temp--存數sql語句處理的表和索引的信息
undotbs1--存儲撤銷信息的表空間
users--處處數據庫用戶創建的數據庫對象
2.1 查詢system 表空間存放的對象及其擁有者
select distinct segment_type,owner,tablespace_name from dba_sgements where tablespace_name='SYSTEM' order by owner,segment_type
(注意在SQL PLUS查詢時候,tablespace_name 需要大寫,因爲表中存儲的是大寫)
2.2 查詢sysaux表空間存放的用戶對象數
select owner,count(*) from dba_sgements where tablespace_name='SYSAUX' group by owner
sgement /ˈsɛɡmənt/ 段