一、查看表空间物理文件的名称及大小
SELECT tablespace_name, file_id, file_name,
round(bytes/(1024*1024*1024), 2)||' GB' total_space
FROM dba_data_files
ORDER BY tablespace_name;
二、查看表空间的使用情况
SELECT round(SUM(bytes)/(1024*1024*1024),2)||' GB' AS free_space, tablespace_name
FROM dba_free_space
GROUP BY tablespace_name;
三、查看表空间的使用情况
SELECT a.tablespace_name,
round(a.bytes/(1024*1024*1024),2)||' GB' total,
round(b.bytes/(1024*1024*1024),2)||' GB' used,
round(c.bytes/(1024*1024*1024),2)||' GB' free,
round((b.bytes * 100) / a.bytes)||'%' "% USED ",
round((c.bytes * 100) / a.bytes)||'%' "% FREE "
FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c
WHERE a.tablespace_name = b.tablespace_name
AND a.tablespace_name = c.tablespace_name;
Oralce查看表空间使用情况方法
最新推荐文章于 2023-06-25 17:53:37 发布