第1个回答 2019-08-20
select b.tablespace_name 表空间,
round(b.bytes / 1024 / 1024 / 1024, 2) 总空间GB,
round((b.bytes - sum(nvl(a.bytes, 0))) / 1024 / 1024 / 1024, 2) 已使用GB,
round(sum(nvl(a.bytes, 0)) / 1024 / 1024 / 1024, 2) 剩余GB,
round(sum(nvl(a.bytes, 0)) / (b.bytes) * 100, 2) "剩余%"
from dba_free_space a, dba_data_files b
where a.file_id = b.file_id
and a.tablespace_name = 'DZQD_DATA_01'
group by b.tablespace_name, b.file_name, b.file_id, b.bytes
order by b.tablespace_name