SELECT ROUND(SUM(USED.BYTES) / 1024 / 1024 / 1024 ) || ' GB' "Database Size"
, ROUND(SUM(USED.BYTES) / 1024 / 1024 / 1024 ) -
ROUND(FREE.P / 1024 / 1024 / 1024) || ' GB' "Used space"
, ROUND(FREE.P / 1024 / 1024 / 1024) || ' GB' "Free space"
FROM (SELECT BYTES
FROM V$DATAFILE
UNION ALL
SELECT BYTES
FROM V$TEMPFILE
UNION ALL
SELECT BYTES
FROM V$LOG) USED
, (SELECT SUM(BYTES) AS P
FROM DBA_FREE_SPACE) FREE
GROUP BY FREE.P;
, ROUND(SUM(USED.BYTES) / 1024 / 1024 / 1024 ) -
ROUND(FREE.P / 1024 / 1024 / 1024) || ' GB' "Used space"
, ROUND(FREE.P / 1024 / 1024 / 1024) || ' GB' "Free space"
FROM (SELECT BYTES
FROM V$DATAFILE
UNION ALL
SELECT BYTES
FROM V$TEMPFILE
UNION ALL
SELECT BYTES
FROM V$LOG) USED
, (SELECT SUM(BYTES) AS P
FROM DBA_FREE_SPACE) FREE
GROUP BY FREE.P;
No comments:
Post a Comment