Friday, January 25, 2013

Oracle [ Size by Partitions ]

How do I know if an object is partitioned or not?


SELECT * FROM dba_tab_partitions WHERE table_name = '<table_name>';

SELECT * FROM dba_ind_partitions WHERE index_name = '<index_name>';

1 -Partitions = NO

select owner, segment_type, segment_name, bytes/1024/1024 mbytes
from dba_segments
where segment_name = 'TABLE_NAME';
 
2 - Partitions = YES
 
select seg.OWNER , seg.PARTITION_NAME, seg.SEGMENT_NAME , seg.BYTES/1024/1024 mbytes from dba_segments seg
inner join dba_tab_partitions part
on seg.SEGMENT_NAME=part.TABLE_NAME
and seg.owner = part.table_owner
where part.TABLE_NAME='TABLE_NAME';

0 comentários:

Post a Comment