SELECT total.tablespace_name, ROUND (total.mb, 2) AS total_mb,
       ROUND (total.mb - free.mb, 2) AS used_mb,
       ROUND ((1 - free.mb / total.mb) * 100, 2) || '%' AS used_pct
  FROM (SELECT   tablespace_name, SUM (BYTES) / 1024 / 1024 AS mb
            FROM dba_free_space
        GROUP BY tablespace_name) free,
       (SELECT   tablespace_name, SUM (BYTES) / 1024 / 1024 AS mb
            FROM dba_data_files
        GROUP BY tablespace_name) total
 WHERE free.tablespace_name = total.tablespace_name;


--ALTER DATABASE DATAFILE '/oracle/DEV/db/apps_st/data/sysaux01.dbf' AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;

