select t.TABLESPACE_NAME,t.FILE_ID,t.FILE_NAME,trunc(t.BYTES/1024/1024/1024),t.MAXBYTES,
t.AUTOEXTENSIBLE from dba_data_files t -------------查看表空间,autoextensible
select * from dba_tablespaces ---------------------查看表空间
Select a.Tablespace_Name,a.file_id, (a.Total - b.Free) || ‘M’ Used_Space, To_Char((a.Total - b.Free) / a.Total * 100, ‘99.9999’) || ‘%’ Pct_Used,autoextensible, maxsize
From
(Select Tablespace_Name,file_name,autoextensible,file_id, Sum(Bytes) / 1024 / 1024 Total,sum(maxbytes/1024/1024) maxsize From Dba_Data_Files Group By tablespace_Name,file_name,autoextensible,file_id) a,
(Select Tablespace_Name,file_id, Sum(Bytes) / 1024 / 1024 Free From Dba_Free_Space Group By Tablespace_Name,file_id) b
where a.file_id = b.file_id
order by tablespace_name, pct_used desc ,file_name ; -----------------查看表空间使用率
alter tablespace UFHIS
add datafile ‘+DG/ktyydb/datafile/ufhis_data05.dbf’ size 31g
autoextend on next 100m; -------------------------增加UFHIS表空间,注意名称和路径
alter tablespace SYSAUX
add datafile ‘+DG/ktyydb/datafile/sysaux01.260906346485’ size 31g
autoextend on next 50m; ------------------增加数据文件,来扩展SYSAUX表空间,注意名称和路径