sql檢視所有表空間使用情況

muxinqing發表於2014-02-11

select dbf.tablespace_name,dbf.totalspace "總量(M)",dbf.totalblocks as 總塊數,dfs.freespace "剩餘總量(M)",dfs.freeblocks "剩餘塊數",
(dfs.freespace / dbf.totalspace) * 100 "空閒比例"  from (select t.tablespace_name,sum(t.bytes) / 1024 / 1024 totalspace,sum(t.blocks) totalblocks from dba_data_files t group by t.tablespace_name) dbf,(select tt.tablespace_name,sum(tt.bytes) / 1024 / 1024 freespace,
sum(tt.blocks) freeblocks from dba_free_space tt group by tt.tablespace_name) dfs where trim(dbf.tablespace_name) = trim(dfs.tablespace_name);

 

 

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

相關文章