表空間sql

chenzhen232發表於2010-02-24
COL use_rage FOR a10
SELECT UPPER(f.tablespace_name) tablespace_name,
d.Tot_grootte_Mb total_Mb,
d.Tot_grootte_Mb - f.total_bytes used_Mb,
TO_CHAR(ROUND((d.Tot_grootte_Mb - f.total_bytes) / d.Tot_grootte_Mb * 100,2),'990.99')
use_rage,
f.total_bytes free_Mb,
f.max_bytes max_block
FROM
(SELECT tablespace_name,
ROUND(SUM(bytes)/(1024*1024),2) total_bytes,
ROUND(MAX(bytes)/(1024*1024),2) max_bytes
FROM sys.DBA_FREE_SPACE
GROUP BY tablespace_name) f,
(SELECT dd.tablespace_name, ROUND(SUM(dd.bytes)/(1024*1024),2) Tot_grootte_Mb
FROM sys.DBA_DATA_FILES dd
GROUP BY dd.tablespace_name) d
WHERE d.tablespace_name = f.tablespace_name
ORDER BY 4 ;[@more@]

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

相關文章