SET FLUSH OFF
SET TERM OFF
set pages 100
set linesize 150
column tablespace heading 'Tablespace' format a30
column HOST_NAME new_value host

select HOST_NAME from v$INSTANCE;

ACCEPT pct_occupation_max CHAR PROMPT "Taux d'occupation max (de tous les datafiles) : "

PROMPT "TABLESPACES DONT TOUS LES DATAFILES AUTOEXTENTS SONT A $pct_occupation_max% DU MAXSIZE"
spool $ORACLE_HOME/tmp/TablespaceDontTousDatafilesAutoextentsSontAuTauxOccupMaxDuMaxsize.lis 
select 
count(file_name),
tablespace_name 
from dba_data_files d
where  d.maxbytes>0  
  and d.autoextensible='YES' 
and d.bytes/d.maxbytes > $pct_occupation_max/100 
group by 
tablespace_name 
having count(file_name) = 
(
select count(e.file_name)
from 
dba_data_files e
where
e.tablespace_name=d.tablespace_name
and e.autoextensible='YES'
);
spool off
clear columns
SET FLUSH ON
SET TERM ON