set ver off;
set define on;

col owner format a15
col segment_name format a30

define v_fr_owner=&1 ;
define v_fr_table=&2;

select a.owner,a.segment_name,round(a.bytes/1024/1024,2) "Current Size (Mb)", round((b.num_rows*b.avg_row_len/1024/1024),2) "Estimated Size(Mb)",
round(a.bytes/1024/1024,2) - round((b.num_rows*b.avg_row_len/1024/1024),2) "Reclaimable size (Mb)",
round(((round(a.bytes/1024/1024,2) - round((b.num_rows*b.avg_row_len/1024/1024),2))/round(a.bytes/1024/1024,2))*100,2)"% Reclaimable"
--, round(b.initial_extent/1024,2) "initial_extent (Kb)",
,b.pct_free
from dba_segments a, dba_tables b
where a.segment_name = b.table_name
and a.segment_type = 'TABLE'
and a.owner = b.owner
and a.owner like upper ('&v_fr_owner')
and a.segment_name like upper ('&v_fr_table')
order by 3 desc;

--order by a.owner,a.segment_name asc;