This content has been marked as final. Show 12 replies
What do you really mean by 'database size'?
I'm sure we can give you a lot of code - but I, for one, do not know which of the several different possible meanings you want code to calculate.
And (out of curiosity): Why should we - volunteers, and not Oracle employees - provide it ASAP? What is the urgency?
nice one Yoann :)
here is the code I've used previously
col tablespace_name format a15
col file_name format a35
col file_size format "999,999,999,999"
compute sum of file_size on tablespace_name
col fragments format "99,999"
compute sum of fragments on tablespace_name
col free_space format "999,999,999,999"
compute sum of free_space on tablespace_name
col free_pct format "999.00" heading "% Free"
col largest format "999,999,999,999"
col max_pct format "999.00" heading "% max"
break on tablespace_name skip 1
select fs.tablespace_name,df.file_name,df.bytes file_size,
count(fs.bytes) fragments,sum(fs.bytes) free_space,(sum(fs.bytes)/df.bytes)*100 free_pct,
max(fs.bytes) largest,(max(fs.bytes)/df.bytes)*100 max_pct
from dba_free_space fs,dba_data_files df
group by fs.tablespace_name,df.file_name,df.bytes