5. Check the size of a database

Size of an Oracle database is the sum of the size of its Data files, Temporary files, Redo logs and Control files.

SELECT ROUND( SUM(Q1."Data Files" + Q2."Temp Files" + Q3."Redo Logs" + Q4."Control Files" )/1024/1024/1024, 2) AS "Total Size (GB)" FROM (SELECT SUM(bytes) "Data Files" from DBA_DATA_FILES) Q1, (SELECT SUM(bytes) "Temp Files" from DBA_TEMP_FILES) Q2, (SELECT SUM(bytes) "Redo Logs" from V_$LOG) Q3, (SELECT SUM(BLOCK_SIZE * FILE_SIZE_BLKS)"Control Files" FROM V$CONTROLFILE) Q4;