查询表空间明、路径名称、大小、是否自动增长、最大大小、下一次增长大小:
select a.tablespace_name,a.FILE_NAME,bytes/1024/1024||'M' "size",a.AUTOEXTENSIBLE,a.MAXBYTES,a.INCREMENT_BY from dba_data_files a order by a.FILE_NAME;

开启表空间文件大小自动增长:
alter database datafile '+ORADATA/orcl/datafile/“上一语句查询到的表空间文件名”.dbf' autoextend on;

开启表空间文件大小自动增长并设置最大值为最大
alter database datafile '+ORADATA/orcl/datafile/上一语句查询到的表空间文件名.dbf' autoextend on maxsize unlimited;

新增表空间文件并开启自动增长,最大值为最大:
alter tablespace 第一条语句查询到的表空间 add datafile '+ORADATA/orcl/datafile/新命名一个表空间文件名.dbf' SIZE 10240M AUTOEXTEND ON NEXT 500M;

查询表空间使用率:
SELECT UPPER(F.TABLESPACE_NAME) AS "表空间名称",
ROUND(D.AVAILB_BYTES ,2) AS "表空间大小(G)",
ROUND(D.MAX_BYTES,2) AS "最终表空间大小(G)",
ROUND((D.AVAILB_BYTES - F.USED_BYTES),2) AS "已使用空间(G)",
TO_CHAR(ROUND((D.AVAILB_BYTES - F.USED_BYTES) / D.AVAILB_BYTES 100,
2), '999.99') AS "使用比",
ROUND(F.USED_BYTES, 6) AS "空闲空间(G)",
F.MAX_BYTES AS "最大块(M)"
FROM (
SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024
1024 1024), 6) USED_BYTES,
ROUND(MAX(BYTES) / (1024
1024 1024), 6) MAX_BYTES
FROM SYS.DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) F,
(SELECT DD.TABLESPACE_NAME,
ROUND(SUM(DD.BYTES) / (1024
1024 1024), 6) AVAILB_BYTES,
ROUND(SUM(DECODE(DD.MAXBYTES, 0, DD.BYTES, DD.MAXBYTES))/(1024
1024*1024),6) MAX_BYTES
FROM SYS.DBA_DATA_FILES DD
GROUP BY DD.TABLESPACE_NAME) D
WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME
ORDER BY 4 DESC;