一、查看表空间是否为自动扩展
select tablespace_name,AUTOEXTENSIBLE,INCREMENT_BY from dba_data_files;
TABLESPACE_NAME AUTOEXTENSIBLE INCREMENT_BY
------------------------------ -------------- ------------
USERS YES 260
SYSAUX YES 822
UNDOTBS1 YES 312
-----------------------------------
二、查看数据文件存在使用空间
set linesize 200
col file_name for a50
select file_name,file_id,tablespace_name,bytes/1024/1024/1024 from dba_data_files;
单个数据文件最大值为32G
三、新建、扩容数据文件
1.单个数据文件小于32G,对其进行扩容
alter tablespace datafile id号(file_id)resize 20G;
或 alter tablespace datefile 表空间名称(tablespace_name) resize 16G;
EG:alter database datafile 28 resize 25G;
2.单个数据文件使用过大,可新添加数据文件
alter tablespace 表空间名称(tablespace_name)add fatafile '文件名称'(file_name) size 10G;
EG:alter tablespace SUN add datafile '+DATA/sunshine/sun02.dbf' size 12G;