set echo off
set heading off
set feedback off

prompt ---------------------------------
prompt - Coalesce tous les tablespaces -
prompt ---------------------------------

set term off
spool tbs_coalesce.tmp

SELECT 'set echo on' FROM dual;
SELECT 'set feedback on' FROM dual;

SELECT 
   'alter tablespace '||tablespace_name||' coalesce;'
FROM 
   dba_tablespaces
WHERE 
   contents not in ('TEMPORARY','UNDO');

spool off
set term on

@tbs_coalesce.tmp