Database 11g

Sunday, October 2, 2016

How to Calculate Index Size and Table Size in Oracle



Hi Guy's we can calculate all indexes sizes and table size in the below query.
where table name is PHTRNHST and rest of all are the indexes.


SQL> BREAK ON REPORT
SQL> COMPUTE SUM OF SIZE_MB ON REPORT
SQL> SELECT segment_name, SUM (bytes) / (1024 * 1024) size_mb FROM sys.dba_extents WHERE segment_type in('TABLE','INDEX')  AND segment_name in('PHTRNHST', 'X_1','X_TRANSACTION','X_RETURN','X_RET_1','IND_MRM,D_S') and owner='HMIS' group by segment_name;

SEGMENT_NAME                 SIZE_MB
--------------------------------------------------------
X_RETURN                                       80
X_RET_1                                          120
X_1                                                   60
PHTRNHST                                      344
X_TRANSACTION                           128
                                                     ----------
sum                                                   732



Happy Learning...



No comments:

Post a Comment