IT源码网

Oracle查看表空间使用率

xmjava 2021年04月03日 程序员 377 0

set pagesize 500; set linesize 1000;col PER format a10;col NAME format a20;SELECT UPPER(F.TABLESPACE_NAME) "NAME",D.TOT_GROOTTE_MB "TSIZE(M)",D.TOT_GROOTTE_MB - F.TOTAL_BYTES "USIZE(M)",TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB 100, 2), '990.99') "PER",F.TOTAL_BYTES "FREE(M)",F.MAX_BYTES "MAX(M)"FROM (SELECT TABLESPACE_NAME,ROUND(SUM(BYTES) / (1024 1024), 2) TOTAL_BYTES,ROUND(MAX(BYTES) / (1024 1024), 2) MAX_BYTESFROM SYS.DBA_FREE_SPACEGROUP BY TABLESPACE_NAME) F,(SELECT DD.TABLESPACE_NAME,ROUND(SUM(DD.BYTES) / (1024 1024), 2) TOT_GROOTTE_MBFROM SYS.DBA_DATA_FILES DDGROUP BY DD.TABLESPACE_NAME) DWHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME ORDER BY 4 DESC;

转载于:https://blog.51cto.com/13032607/2402202


评论关闭
IT源码网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!