--ORACLE查詢表空間使用情況
--ORACLE查詢表空間使用情況
select
b.file_id 文件ID號,
b.tablespace_name 表空間名,
b.bytes/1024/1024 字節數M,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用M,
sum(nvl(a.bytes,0))/1024/1024 剩餘空間M,
100 - 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_id,b.bytes
order by b.file_id;
--查詢表空間文件路徑
--查詢表空間文件路徑
SELECT * FROM dba_data_files;
如果覺得有幫助,下方請點贊。