/*
* Tablespace Size
*/
SELECT a.tablespace_name,
a.bytes/1024/1024 total_M,
b.bytes/1024/1024 as free_M,
a.bytes/1024/1024- b.bytes/1024/1024 used_M,
round(((a.bytes - b.bytes) / a.bytes) * 100, 2) percent_used,
b.largest
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 tablespace_name
--ORDER BY bytes_free DESC
-- ((a.bytes - b.bytes) / a.bytes) DESC
阅读(582) | 评论(0) | 转发(0) |