----查找非临时表空间中各文件使用情况:
select
b.file_name 物理文件名,
b.tablespace_name 表空间,
b.bytes/1024/1024 大小M,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用M,
substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率
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.bytes
order by b.tablespace_name;
select b.file_name FILE_NAME, b.tablespace_name TABLESPACE_NAME,
b.bytes/1024/1024 SIZE_M,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 USED_M,
substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) USED_percent
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.bytes
order by b.tablespace_name;
----查找临时表空间使用情况:
SELECT a.tablespace_name, a.BYTES total, a.bytes - nvl(b.bytes, 0) free,
nvl(b.bytes, 0)/a.BYTES *100 "used(%)"
FROM (SELECT tablespace_name, SUM (bytes) bytes FROM dba_temp_files GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM (bytes_cached) bytes FROM v$temp_extent_pool GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name(+);
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15962/viewspace-766067/
,如需转载,请注明出处,否则将追究法律责任。