Thursday, April 2, 2015

Oracle : Find Database Size

compute sum of size_in_mb on dummy
compute sum of size_in_gb on dummy
break on dummy

col dummy noprint
col size_in_mb format 99,999,999        heading "Size MB"
col size_in_gb format 999,999.9         heading "Size GB"
col nbr_of_files format 99,999,999      heading "Nbr of Files"

select null dummy,
       tablespace_name,
       count(*)                         nbr_of_files,
       sum(bytes/1024/1024)             size_in_mb,
       sum(bytes/1024/1024/1024)        size_in_gb
from dba_data_files
group by tablespace_name
/

No comments:

Post a Comment