查看表空间情况
select b.file_id id ,
b.tablespace_name 表空间名,
b.file_name 表空间文件,
b.bytes/1024/1024 表空间大小M ,
(b.bytes - sum(nvl(a.bytes, 0)))/1024/1024 已用表空间大小M,
sum(nvl(a.bytes, 0))/1024/1024 空闲表空间大小M ,
sum(nvl(a.bytes, 0)) / (b.bytes) * 100 空闲表空间占比
from
dba_free_space a,
dba_data_files b
where a.file_id = b.file_id
group by
b.tablespace_name,
b.file_name,
b.file_id,
b.bytes
order by
b.tablespace_name;
新增表空间
alter tablespace SYSMGMT add datafile 'E:\ORACLE\ORADATA\ORCL\SYSMGMT_05.DBF' size 2G;