Last Updated: February 25, 2016
·
269
· gfkauer

Sinzing Tables

/* Show de size user by each table/tablespace */
select segment_name, tablespace_name, sum(bytes)/1024/1024 as "SIZE(MB)"
  from dba_segments
 Where tablespace_name = nvl('&tablespace_name',tablespace_name)
Group by segment_name, tablespace_name
Order by sum(bytes) desc;

/* remove empty spaces in the tables */
alter table &TABLE_NAME shrink space;