查看表空间使用情况
select sum(SumMB) / 1024,
sum(usedMB) / 1024,
sum(freeMB) / 1024,
(sum(usedMB) / 1024 + sum(freeMB) / 1024)
from (select a.tablespace_name,
a.bytes / 1024 / 1024 SumMB,
(a.bytes - b.bytes) / 1024 / 1024 usedMB,
b.bytes / 1024 / 1024 freeMB,
round(((a.bytes - b.bytes) / a.bytes) * 100, 2) "percent_used"
from (select tablespace_name, sum(bytes) bytes
from dba_data_files
where tablespace_name = 'PORTALS'
group by tablespace_name) a,
(select tablespace_name, sum(bytes) bytes, max(bytes) largest
from dba_free_space
where tablespace_name = 'PORTALS'
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name);