Autoextend Tablespaces Jp
select 'alter database datafile ' || max(file_id) || ' autoextend on next 10m maxsize 2G;'
from
dba_data_files df
where df.tablespace_name in (select dfs.tablespace_name from dba_free_space dfs
group by dfs.tablespace_name
having sum(dfs.bytes)/(1024*1024) < 100)
group by df.tablespace_name