首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

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

2013-02-04 
Oracle常用语句--统计每个表空间的使用信息SELECT a.tablespace_name , a.bytes bytes_used , b.largest ,

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

热点排行