select 'alter database datafile '||file_id||' autoextend on next 100m maxsize '||to_char(trunc(bytes/1024/1024,-3))||'M;'
from dba_data_files where maxbytes=0;
select 'alter database datafile '||file_id||' autoextend on next 100m maxsize '||to_char(trunc(maxbytes/1024/1024,-3))||'M;'
from dba_data_files where mod(maxbytes,1000) > 0;
