日期:2014-05-16  浏览次数:20445 次

Oracle常用语句--统计每个表空间的使用信息
SELECT a.tablespace_name , a.bytes bytes_used , b.largest , round(((a.bytes - b.bytes) / a.bytes)  * 100,2)  percent_used  FROM
(SELECT tablespace_name,sum(bytes) bytes FROM dba_data_files GROUP BY tablespace_name) a,
(SELECT tablespace_name,sum(bytes) bytes,max(bytes) largest FROM dba_free_space GROUP BY tablespace_name) b WHERE a.tablespace_name = b.tablespace_name
ORDER BY ((a.bytes-b.bytes)/a.bytes) DESC