Wednesday, January 21, 2009

To Know The Tables Size In The Database

select s.owner, round(sum(s.bytes) / 1024 / 1024, 2) size_in_m
from sys.dba_segments s, sys.dba_data_files f
where f.tablespace_name = s.tablespace_name
and f.file_id = s.header_file
and s.tablespace_name not in ('SYS','SYSTEM')
-- A good thing to check is for objects in the SYSTEM tablespace that have s.owner <> 'SYS'
group by s.owner
Order by s.owner

No comments: