当前位置: 移动技术网 > IT编程>数据库>Oracle > oracle数据库解决system表空间已爆满的问题

oracle数据库解决system表空间已爆满的问题

2019年12月03日  | 移动技术网IT编程  | 我要评论

有时会发现数据库system表空间增长很快,使用以下语句查看system表空间使用量。也可以使用toad直接看。

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;

执行以下语句查看是哪个对象占用较大

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;

一般发现都是发现是aud$审计表占用资源量大。

直接登录数据库,清理掉sys.aud$表。

truncate table  sys.aud$;

 

 

 

如果想关闭数据库审计,可以参考以下链接

http://blog.sina.com.cn/s/blog_b56640170102xbj7.html

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网