查询Oracle表空间使用情况

--查询表空间使用情况
SELECT 
     total.tablespace_name AS 表空间名称,   
     ROUND(total.MB,2) AS 大小MB,   
     ROUND(total.MB-free.MB, 2) AS 已使用MB,   
     ROUND((1-free.MB/total.MB)*100, 2)||'%' AS 使用率
FROM 
     (SELECT tablespace_name, SUM(bytes)/1024/1024 AS MB FROM dba_free_space GROUP BY tablespace_name) free,
     (SELECT tablespace_name, SUM(bytes)/1024/1024 AS MB FROM dba_data_files GROUP BY tablespace_name) total
WHERE 
      free.tablespace_name=total.tablespace_name
ORDER BY 
      total.tablespace_name



点赞(0) 打赏

Comment list 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部