set serveroutput on size 99999
declare
total_blocks number;
total_bytes number;
unused_blocks number;
unused_bytes number;
last_used_extent_file_id number;
last_used_extent_block_id number;
last_used_block number;
cursor l_objects is
select segment_name from dba_segments
where segment_type = 'TABLE' and owner = 'SAPPAR' and bytes/1024 > 1000;
l_ordre varchar2(100);
begin
for c_cur in l_objects
loop
DBMS_SPACE.UNUSED_SPACE('SAPPAR',c_cur.segment_name,'TABLE',total_blocks,total_bytes,
unused_blocks, unused_bytes, last_used_extent_file_id,last_used_extent_block_id,last_used_block);
if unused_bytes/1024 > 1000 then
   if unused_bytes/total_bytes > 0.1 then
     dbms_output.put_line ('objet all_bytes/unused_bytes: '||c_cur.segment_name||' '||
     to_char(total_bytes/1024)||'/'||to_char(unused_bytes/1024));
   end if;
end if;
end loop;
exception
    when others then
        dbms_output.put_line (l_ordre||'err: '||sqlerrm);
end;
/

