背景:两套同样的测试环境,一套数据库Undo使用率一直处于99%,已经持续了很长一段时间,而另外一套几乎为0
排查手段:
1. 查看占用高的undo表空间使用情况,发现都是unexpired的状态
-- 整体undo使用情况
select b.tablespace_name,
nvl(used_undo, 0) "USED_UNDO(M)",
total_undo "Total_undo(M)",
trunc(nvl(used_undo, 0) / total_undo * 100, 2) used_PCT
from (select nvl(sum(bytes / 1024 / 1024), 0) used_undo, tablespace_name
from dba_undo_extents
where status in ('ACTIVE', 'UNEXPIRED')
and tablespace_name in
(select value from v$parameter where name = 'undo_tablespace')
group by tablespace_name) a,
(select tablespace_name, sum(bytes / 1024 / 1024) total_undo
from dba_data_files
where tablespace_name in
(select value from v$parameter where name = 'undo_tablespace')
group by tablespace_nam