REM Etat des extents des tables
REM ---------------------------

SET FLUSH OFF
SET TERM OFF
SET LINESIZE 94
SET PAGES 100
REM
set pages 100
set linesize 94
column tablespace      heading Tablespace format a20
column segment_name    heading Segment    format a20
column segment_type    heading Type       format a5
column alloues         heading 'Blocks'
column occupes         heading 'Blocks Used'
column extents         heading 'Extents'
column max             heading 'Max_Extents'
column HOST_NAME new_value host

select HOST_NAME from v$INSTANCE;

prompt "ETAT DES EXTENTS DES TABLES"
define output = $ORACLE_HOME/tmp/EtatExtentsTables.lis
spool &output
SELECT
        S.TABLESPACE_NAME tablespace,
        SEGMENT_NAME ,
        SEGMENT_TYPE ,
        S.EXTENTS extents ,
        S.MAX_EXTENTS max
FROM dba_segments s --, dba_tables t
WHERE 
      s.tablespace_name not in ('SYSTEM') 
AND   s.tablespace_name not like ('PERFDATA')
AND   s.tablespace_name not like ('SYSAUX')
AND   s.segment_type in ('TABLE','INDEX')
and   S.EXTENTS > $pct_croissance_max/100*S.MAX_EXTENTS 
ORDER BY s.extents desc,s.tablespace_name,s.segment_name;
spool off
clear columns
SET FLUSH ON
SET TERM ON