Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Thursday, July 1, 2010

Size of the local individual index partitions

If you know the index name then go to PART-2 if not use PART-1 to get the index name using table name

PART-1
First find the index names for the given table and partition names:
select DISTINCT ''''||A.INDEX_NAME||''''||',' FROM dba_ind_partitions A,
BA_PART_INDEXES B
WHERE
A.INDEX_OWNER=B.OWNER
AND A.INDEX_NAME=B.INDEX_NAME
AND A.INDEX_OWNER='ISA' AND
B.TABLE_NAME IN
('ADJUSTMENT_REASON_CODE_PRE')
AND A.PARTITION_NAME IN
('P_CHARLOTTE')

PART-2:

select SEGMENT_NAME,PARTITION_NAME,sum(bytes)/1024/1024 size_in_mb
FROM DBA_SEGMENTS
WHERE owner='USER1'
AND SEGMENT_name in ('INDEX1')
AND SEGMENT_TYPE='INDEX PARTITION'
AND PARTITION_NAME IN
('P_CHARLOTTE')
GROUP BY SEGMENT_NAME,PARTITION_NAME
ORDER BY 1,2

No comments: