Thursday, November 14, 2013

How to find the table size in Oracle.

Sometimes you may have to find the list of tables size or specific table size to do cleanup or know the  growth.
In this scenario I want to find the backup tables residing in the database and size of each tables occupied in the database. 


Query: 

select a.owner,a.table_name,b.created,c.bytes/1024/1024 MB from dba_tables a, dba_objects b, dba_segments c 
where a.owner='SYSADM' and table_name like '%BACKUP%' 
and a.table_name=b.object_name and a.table_name=c.segment_name and segment_type='TABLE' order by c.bytes desc


You can add or modify the query according to your needs. 

No comments: