How to Know the Size of an Oracle Database
Introduction
As a DBA, one of the most common tasks is checking the size of your Oracle Database. Knowing the size helps in planning storage, troubleshooting, and capacity management. In this guide, I’ll show you simple SQL queries to find the total database size.
1. Check Datafile Size
SELECT SUM(bytes)/1024/1024/1024 AS "Data Size (GB)"
FROM dba_data_files;
2. Check Tempfile Size
SELECT SUM(bytes)/1024/1024/1024 AS "Temp Size (GB)"
FROM dba_temp_files;
3. Check Redo Log Size
SELECT SUM(bytes)/1024/1024/1024 AS "Redo Size (GB)"
FROM v$log;
4. Total Database Size
Add the results of the above queries to get the approximate size of your Oracle database.
Conclusion
With just a few SQL queries, you can easily find the size of your Oracle Database. This is especially important before upgrades, migrations, or storage planning.

Comments
Post a Comment