top of page

Get size of an oracle database

  • shiva ram
  • Oct 3, 2024
  • 1 min read

Use below query to get the size of a database.

col "Database Size" format a20
col "Free space" format a20
col "Used space" format a20
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
/
Database Size Used space Free space
-------------------- -------------------- --------------------
8 GB 5 GB 3 GB

Recent Posts

See All
Monitor tablespace usage

Use below query to check all the space related details of tablespaces. set feedback off set pagesize 70; set linesize 2000 set head on...

 
 
 
Monitor UNDO tablespace usage

Use below script to get the details about undo tablespace usage. select a.tablespace_name, SIZEMB, USAGEMB, (SIZEMB - USAGEMB) FREEMB...

 
 
 

Comments


CONTACT US

Join our mailing list

bottom of page