TABLESPACE 조회 및 용량확장

DATABASE/ORACLE 2013. 6. 26. 14:42
-- TABLESPACE 조회
 
SELECT TABLESPACE_NAME
    , FILE_NAME
    , BYTES / 1024 / 1024 AS "TOTAL_SPACE(MB)"
    , RESULT / 1024 / 1024 AS "USED_SPACE(MB)"
    , (BYTES - RESULT) / 1024 / 1024 AS "FREE_SPACE(MB)"
    , ROUND((RESULT / BYTES) * 100, 2) AS "USED_RATIO(%)"
FROM (
    SELECT E.TABLESPACE_NAME, E.FILE_NAME, E.BYTES, (E.BYTES - SUM(F.BYTES)) RESULT
    FROM DBA_DATA_FILES E, DBA_FREE_SPACE F
    WHERE F.FILE_ID = E.FILE_ID
    GROUP BY E.TABLESPACE_NAME, E.FILE_NAME, E.BYTES
    ) X
;
 
-- 용량확장
ALTER DATABASE DATAFILE 'D:\DATABASE\ORACLE\HELTH01.DBF' RESIZE 1536M;
 


: