In this blog I am going to showing to everyone how we can easily check the whole database size in oracle using simple SQL queries there are different ways to calculates the database size and showing to user what is the exact size of db’s.
In the first ways you can check the database size using the below queries.
SQL > select round(sum(used.bytes)/1024/1024) “Database size in MB”
from ( select bytes from v$datafile
union all
select bytes from v$tempfile
union all
select sum(block_size*file_size_blks) bytes from v$controlfile
union all
select bytes from v$log) used;
database size in MB
—————————
45004
And there is also a another queries to check out the whole database using the below statement .
SQL > select ( select sum(bytes)/1024/1024/1024 “datafile_size”
from dba_data_files) +
(select nvl(sum(bytes),0)/1024/1024/1024 temp_size
from dba_temp_files) +
(select sum(bytes)/1024/1024/1024 redo_size
from sys.v_$log) +
(select sum(block_size*file_size_blks)/1024/1024/1024 controlfile_size
from v$controlfile) “Database_size_GB”
from dual;
Database_size_GB
————————-
4.3984
Click here to learn about Check Failed Login attempts count in Oracle Database
Please share this Blog with your colleagues or friends. Your suggestions and feedback are very helpful for everyone who come to this site and learn it from oracleocpworld.com.
Please comment here for your any query related to above post. You can email me on : oracleocpworld@gmail.com.