1.查看Oracle System表空间使用率​​​

select 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
and b.tablespace_name = 'SYSTEM'
group by b.tablespace_name, b.file_name, b.bytes
order by b.tablespace_name;

表空间 大小M 已使用M 利用率
------------------------------ ---------- ---------- --------------------
SYSTEM 910 900.875 98.99

2.查看占用表空间前十的对象

SELECT *
FROM (SELECT SEGMENT_NAME, SUM(BYTES) / 1024 / 1024 MB
FROM DBA_SEGMENTS
WHERE TABLESPACE_NAME = 'SYSTEM'
GROUP BY SEGMENT_NAME
ORDER BY 2 DESC)
WHERE ROWNUM < 10;

3.如果是审计相关的表SYS.AUD$

sys@CXMTDB 22:49:00>  truncate table SYS.AUD$;

Table truncated.

版权声明:本文为博主原创文章,未经博主允许不得转载。

Linux,oracle