Oracle常用语句--统计每个表空间的使用信息

2014-11-24 12:48:39 · 作者: · 浏览: 0

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
www.2cto.com