SYSTEM表空间使用率达到了99%, 经查出,是审计表AUD$占用绝大部分的空间。
-- 占用表空间system对象大小排名 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 < 100;
经查, 是 AUD$占用最多, 而且占用绝大多数.
查询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;
-- truncate表AUD$, 要用 sys才有权限操作 truncate table sys.AUD$;
再次查询表空间使用率, 降低90%