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

猜你喜欢

转载自dqwhappyday.iteye.com/blog/1780104
今日推荐