Database 11g

Monday, May 9, 2016

How to Check the table Size in Oracle


  •  To check table name segment type and table size in MB 

SQL> select segment_name,segment_type,bytes/1024/1024 MB from dba_segments where                                             segment_type='TABLE' and segment_name='OTORDERS'

             SEGMENT_NAME         SEGMENT_TYPE                 MB
           -------------------- ------------------ ---------------------------------------
             OTORDERS                          TABLE                           192


  • To check Table Owner,Table Name and Table Size.
  • You can check here one HMIS owner have multiple tables with different sizes and names.

SQL> select owner,segment_name,sum(bytes)/1024/1024/1024 as "SIZE in GB" from dba_segments                            where owner='HMIS' and segment_type='TABLE' group by owner,segment_name order by                               "SIZE in GB" desc;

OWNER                          SEGMENT_NAME         SIZE in GB              
------------------------------ ---------------------------------------------------------------            
HMIS                                 SHSHTDTA                  1.50683594              
HMIS                                 AHTRNHST                   .984375              
HMIS                                OTOCURNC                   .921875      



Happy Learning ...






1 comment: