sqlplus aleph_dba/aleph_dba as sysdba << EOF
set pagesize 0 heading off feedback off verify off echo off trimspool on linesize 255
column file_name format a80
spool  /tmp/extend.sql
select 'alter database datafile ''' || file_name || ''' autoextend on maxsize unlimited;' from dba_data_files where autoextensible='YES' ;
spool off

@/tmp/extend.sql
EOF
