Check the size of table or partition in Oracle

Check the table size in Oracle

select segment_name,sum(bytes)/1024/1024/1024 GB from dba_segments where segment_name='TABLE_NAME' and segment_type = 'TABLE';

Check the size of table from user_tables

Select table_name, round((blocks*8)/1024,2)||'MB' "size" from USER_tables where table_name = 'EMP';

Check the actual size of table according to row data

select table_name, round((num_rows*avg_row_len/1024/1024),2)||'MB' "size" from user_tables  where table_name = 'EMP';

Check the size of Partition for a table

select PARTITION_NAME,sum(bytes)/1024/1024/1024 GB from dba_segments where SEGMENT_NAME=upper('TABLE_NAME') and PARTITION_NAME=upper('Partiton_name') group by PARTITION_NAME;

This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply