Master Note: High Undo Space Usage (Doc ID 1578639.1)


Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.


This troubleshooting guide is to identify high undo usage and correct them. This also lists various known issues on high undo usage and their workarounds.


This also explains the method for Sizing Undo Tablespace appropriately.



Sizing Undo Tablespace  调整undo表空间的大小

Sizing the undo tablespace plays vital role in most of the undo issues.  You can either use Auto-extensible tablespace or use undo advisor to determine the size of the fixed size undo tablespace


When the undo tablespace is auto-extensible, Oracle automatically increases the size of the tablespace when more space is needed. By combining automatic extension of the undo tablespace with automatically tuned undo retention, you can ensure that long-running queries succeed by guaranteeing the undo for such queries.


If using Fixed size Undo tablespace, use Undo Advisor to size the tablespace. The Undo Advisor helps you analyze various scenarios to determine an appropriate undo tablespace size for different values of maximum undo retention.


Always allow 10 to 20% extra space in your undo tablespace to provide for some fluctuation in your workload


With AUM in place, UNDO size can be controlled with the undo_retention parameter and the size of the UNDO tablespace, and the setting for these are determined by the level of DML activity in the database


Refer: How To Size UNDO Tablespace For Automatic Undo Management (Doc ID 262066.1)

Determining Space Requirement:  确定空间要求

V$UNDOSTAT displays a histogram of statistical data to show how well the system is working. The available  include undo space consumption, transaction concurrency, and length of queries executed in the instance. You can use this view to estimate the amount of undo space required for the current workload. Oracle uses this view to tune undo usage in the system. This view is available in both automatic undo management mode and manual undo management mode.

V$UNDOSTAT 显示统计数据的直方图,以显示系统的运行状况。可用的包括undo空间消耗,事务并发以及在实例中执行的查询的长度。您可以使用此视图来估计当前工作负载所需的undo空间量。Oracle使用此视图来调整系统中的undo使用情况。该视图在自动undo管理模式和手动undo管理模式下均可用

Shrink Undo Datafiles  缩小undo数据文件

Refer the document  How to Shrink the datafile of Undo Tablespace (Doc ID 268870.1)

Troubleshooting High Space Usage  解决空间使用高的情况

Check the freespace avialable in the undo tablespace:  检查undo表空间中可用的可用空间


The high space usage can be mainly because:  高空间使用率可能主要是因为

a. A huge transaction that requires more space  巨大的事务需要更多空间

b. Lots of Unexpired extents (the extents that are required for undo retention)  许多未到期的扩展区(undo保留所需的扩展区)

c. Expired extents not being re-used (mostly due to some bugs)  过期的扩展区无法重复使用(主要是由于某些错误)

d. Other reported bugs.  其他报告的错误

To proceed with the analysis, we need to know the status of the undo extents :  要进行分析,我们需要知道undo范围的状态

select sum(bytes /(1024*1024)) from dba_undo_extents where status='EXPIRED';
select sum(bytes /(1024*1024)) from dba_undo_extents where status='ACTIVE';
select sum(bytes /(1024*1024)) from dba_undo_extents where status='UNEXPIRED';

DBA_UNDO_EXTENTS describes the extents comprising the segments in all undo tablespaces in the database.  This view shows the status and size of each extent in the undo tablespace.

DBA_UNDO_EXTENTS 描述了组成数据库中所有undo表空间中的段的范围。此视图显示undo表空间中每个扩展区的状态和大小

To tune SQL queries or to check on runaway queries, use the value of the SQLID column provided in the long query or in the V$UNDOSTAT or WRH$_UNDOSTAT views to retrieve SQL text and other details on the SQL from V$SQL view.

要调整SQL查询或检查失控查询,请使用长查询或 V$UNDOSTAT or WRH$_UNDOSTAT 视图中提供的SQLID列的值,以从 V$SQL 视图中检索SQL文本和有关SQL的其他详细信息

Case 1. Active transaction consuming space (Undo extents are marked Active)  情况1.活动事务消耗空间(undo范围标记为活动)

If there is a huge transaction then high space usage is expected. You can verify the same using the above output, where the Undo extents will be mostly 'Active'.


Case 2. High Space Usage by Committed transactions (Undo extents are marked Unexpired)  情况2:已提交事务的高空间使用率(undo范围标记为未过期)

In this case, the Undo blocks for the committed transactions are kept to honour the undo retention time. This is controlled either by a high Undo_Retention parameter set or by the high value for tuned_undoretention.

在这种情况下,将保留已提交事务的“undo”块以兑现undo保留时间。这由较高的 Undo_Retention 参数集或 tuned_undoretention 的较高值控制

select max(maxquerylen),max(tuned_undoretention) from v$undostat;

In case of non autoextensible Undo tablespace, the tuned_undoretention is calculated in such a way that we try to provide the maximum retention utilizing the space available. Hence, the Undo blocks are retained for a longer time and this inturn makes the Undo tablespace to appear as if its full. The tuned undoretention will be adjusted when there is a space requirement.

在非自动扩展的Undo表空间的情况下,tuned_undoretention 的计算方式是我们试图利用可用空间来提供最大的保留。因此,undo块保留了更长的时间,这反过来使undo表空间看起来像是已满。有空间需求时,将调整调整后的未保留时间

Refer: Full UNDO Tablespace In 10gR2 and above (Doc ID 413732.1)

When undo tablespace is using NON-AUTOEXTEND datafiles,V$UNDOSTAT.TUNED_UNDORETENTION may be calculated too high preventing undo block from being expired and reused.

当undo表空间正在使用NON-AUTOEXTEND数据文件时,V$UNDOSTAT.TUNED_UNDORETENTION 可能计算得太高,从而导致undo块过期和重用

Refer: Automatic Tuning of Undo_retention Causes Space Problems (Doc ID 420525.1)

Case 3: Lots of Expired blocks  情况3:大量过期块

The Expired blocks will be reused and hence this should be counted as 'availabe' space in the Undo segment.


Known Issues

a) If there is a heavy workload before shutdown then there may have been a lot of undo produced in a short space of time giving a low tuned retention. If DB is then shutdown and restarted the in-memory information starts afresh, but there can be a lot of blocks in undo segments from before the shutdown which are not expired , and will not now expire for a long time as they fall inside the new higher tuned_undoretention period.

a) 如果关机前工作量很大,则可能会在很短的时间内产生大量undo,从而导致调整后的保留率较低。如果然后关闭数据库并重新启动,则内存中信息将重新开始,但是从关闭之前起,undo段中可能有很多块未到期,并且由于它们属于新内存,因此现在很长一段时间都不会到期较高的tuned_undo保留期。

Fixed in 12.1

Workaround : Setting _highthreshold_undoretention

This helps them limit the tuned undo retention to any particular value. @alter system set  "_highthreshold_undoretention" =  10800;  (set to 10800 seconds if undo_retention value is less than 3 hours. Otherwise go with max  of (undo_retention, 10800 seconds))

这有助于他们将调整后的undo保留限制为任何特定值。@alter system set  "_highthreshold_undoretention" =  10800; (如果undo_retention值小于3小时,则设置为10800秒。否则,最大值为(undo_retention,10800秒))

In 12g the above parameter will be set by default  在12g中,默认情况下将设置上述参数

Refer:Undo Remains Unexpired When Using Non-autoextensible Datafiles For The Undo Tablespace (Doc ID 1112431.1)

b) High undo usage seen when import by impdp is done to the table where the index is created. It seems to consume UNDO with the split of the index.When import is done without creating the index, the consumption of UNDO is a little.

b) 通过impdp导入到创建索引的表时,会看到较高的undo使用率。似乎使用了索引拆分消耗了UNDO。在未创建索引的情况下完成导入时,UNDO的消耗很小

impdp maintenance index during import as default, and does not use direct_path if table and index is already created.


But, if there is no index who enforce constraint, and specify access_method=direct_path at impdp command line, we can use direct path method to import.

但是,如果没有索引执行约束,并在impdp命令行上指定 access_method = direct_path,则可以使用直接路径方法导入

Workaround: load data by direct path by disabling primary key constraint (using ALTER TABLE ... MODIFY CONSTRAINT ... DISABLE NOVALIDATE) and using access_method=direct_path.

解决方法:通过禁用主键约束(使用ALTER TABLE ... MODIFY CONSTRAINT ... DISABLE NOVALIDATE)并使用access_method = direct_path来通过直接路径加载数据。

- after loading data, enable primary key constraint (using ALTER TABLE ... MODIFY CONSTRAINT ... ENABLE VALIDATE)


Refer: Error ORA-30036 DataPump Import (IMPDP) Exhausts Undo Tablespace (Doc ID 727894.1)

c) Active Undo segments without actual transactions  没有实际的活动undo段交易

Issue 1: There exist active undo segments without actual transaction presence. 95-98% of undo space is consuming by ACTIVE undo segments, and consumed space continues to increase despite the absence of transactions)


It is caused by the fact that the active undo had touched flashback enabled tables but there was no active flashback data archiver (FBDA) process to handle the archiving of those transactions.

这是由于活动undo已触及启用了闪回功能的表,但没有活动的闪回数据存档器( FBDA)流程来处理这些交易的归档

The instance parameter "_disable_flashback_archiver" is set, so the FBDA processs was not starting. This must be reset and the instance must be restarted.

实例参数“ _disable_flashback_archiver”已设置,因此FBDA进程未启动。必须将其重置,并且必须重新启动实例

Refer : Undo Continuously Growing And Not Releasing Active Segments (Doc ID 1476614.1)

Issue 2:


A rapidly growing number of active undo extents may be seen in a non-RAC (or former RAC) environment if Flashback Archive is being used.


Its due to Bug 16196536  Many active undo extents with flashback Archive 由错误16196536引起的许多带有闪回的活动undo范围存档
If the amount of active undo segments is growing very rapidly AND select * from SYS_FBA_BARRIERSCN shows more than one instance (INST_ID) in a non-RAC environment, then you have likely hit this issue.


Try the following workaround: 请尝试以下解决方法

a)  backup the current record in sys_fba_barrierscn table
SQL> create table csdba.sys_fba_barrierscn as select * from sys_fba_barrierscn; b) Deleting information in the sys.sys_fba_barrierscn table where inst_id = 1
SQL> alter system set "_fbda_debug_mode"=8;
SQL> delete from sys.sys_fba_barrierscn where inst_id = 1;
SQL> commit;
SQL> alter system set "_fbda_debug_mode"=0; c) flush the shared pool to make sure the memory is clean
SQL> alter system flush shared_pool;


This issue is fixed in and above. 此问题已在11.2.0.4及更高版本中修复

Diagnostic Information Required While Raising a Service Request  提出服务请求时需要的诊断信息

Provide the following information while raising a Service Request with Oracle Support

在通过Oracle Support持提出服务请求时提供以下信息

1. Provide the outputs of the following queries: 提供以下查询的输出

Status of the undo blocks: undo块的状态

 col segment_name format a30 head "Segment Name"
col "ACT BYTES" format 999,999,999,999 head "Active Bytes"
col "UNEXP BYTES" format 999,999,999,999 head "Unexpired Bytes"
col "EXP BYTES" format 999,999,999,999 head "Expired Bytes" select segment_name, nvl(sum(act),0) "ACT BYTES",
nvl(sum(unexp),0) "UNEXP BYTES",
nvl(sum(exp),0) "EXP BYTES"
from (select segment_name, nvl(sum(bytes),0) act,00 unexp, 00 exp
from dba_undo_extents where status='ACTIVE' group by segment_name
select segment_name, 00 act, nvl(sum(bytes),0) unexp, 00 exp
from dba_undo_extents where status='UNEXPIRED' group by segment_name
select segment_name, 00 act, 00 unexp, nvl(sum(bytes),0) exp
from dba_undo_extents where status='EXPIRED' group by segment_name)
group by segment_name
order by 1

Free space available within the Undo tablespace:  undo表空间中的可用空间


SELECT autoextensible FROM dba_data_files WHERE tablespace_name='&UNDOTBS';

Undo Retention and the tuned_undoretention  undo保留和tuned_undoretention

Show parameter Undo

Select max(maxquerylen),max(tuned_undoretention) from v$undostat;


NOTE:16196536.8 - Bug 16196536 - Many active undo extents with flashback Archive

Master Note: Undo 空间使用率高 (Doc ID 1578639.1)的更多相关文章

  1. 使用 TSPITR 恢复删除的表空间的步骤 (Doc ID 1277795.1)

    Steps To Recover A Dropped Tablespace Using TSPITR (Doc ID 1277795.1) APPLIES TO: Oracle Database - ...

  2. 如何为 Automatic Undo Management 调整 UNDO Tablespace 的大小 (Doc ID 262066.1)

    How To Size UNDO Tablespace For Automatic Undo Management (Doc ID 262066.1) APPLIES TO: Oracle Datab ...

  3. 12C-使用跨平台增量备份减少可移动表空间的停机时间 (Doc ID 2005729.1)

    12C - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 20057 ...

  4. SYSAUX表空间使用率高问题处理

    SYSAUX表空间做为SYSTEM表空间的辅助表空间,主要存放EM相关的内容以及表统计信息,AWR快照,审计信息等,而假设SYSAUX表空间在默认条件下你假设不做不论什么配置,随着时间的推移.会膨胀的 ...

  5. Automatic Tuning of Undo Retention 常见问题 (Doc ID 1579779.1)

    Automatic Tuning of Undo Retention Common Issues (Doc ID 1579779.1) APPLIES TO: Oracle Database - En ...

  6. Troubleshooting ORA-30036 - Unable To Extend Undo Tablespace (Doc ID 460481.1)

    Troubleshooting ORA-30036 - Unable To Extend Undo Tablespace (Doc ID 460481.1) APPLIES TO: Oracle Da ...

  7. Troubleshooting ORA-1628 - max # extents (32765) reached for rollback segment <SEGMENT_NAME> (Doc ID 1580182.1)

    Troubleshooting ORA-1628 - max # extents (32765) reached for rollback segment <SEGMENT_NAME> ( ...

  8. Troubleshooting ORA-01555 - Snapshot Too Old: Rollback Segment Number "String" With Name "String" Too Small (Doc ID 1580790.1)

    Troubleshooting ORA-01555 - Snapshot Too Old: Rollback Segment Number "String" With Name & ...

  9. Troubleshooting ORA-01555/ORA-01628/ORA-30036 During Export and Import (Doc ID 1579437.1)

    Troubleshooting ORA-01555/ORA-01628/ORA-30036 During Export and Import (Doc ID 1579437.1) APPLIES TO ...


  1. Mac VMware Fusion CentOS7配置静态IP

    目录 安装CentOS7 配置静态IP 安装CentOS7 这里我们要安装CentOS7 64位,所以选择CentOS7 64位配置 我们点击存储后,vmware会自动帮我们创建一个虚拟机,但是我们还 ...

  2. Zuul 详解,带视频

    疯狂创客圈 Java 高并发[ 亿级流量聊天室实战]实战系列 [博客园总入口 ] 架构师成长+面试必备之 高并发基础书籍 [Netty Zookeeper Redis 高并发实战 ] 前言 Crazy ...

  3. python基础(36):pymysql模块

    1. pymysql模块 在使用pymysql模块前需要学习数据库MySQL:<MySQL基础>. 1.1 pymysql的下载和使用 看完MySQL基础,我们都是通过MySQL自带的命令 ...

  4. Java学习 1.1——(JVM介绍)Java为什么能够跨平台?

    首先介绍一下Java的各个层级,先放一张图: 硬件,操作系统和操作系统接口:这三级不说大家都知道,操作系统有很多种,比如Windows,Linux.Windows又分为win7,win10,win x ...

  5. [转]UiPath Invoke Code

    本文转自: We will learn step by step tutorial for ...

  6. Go Modules使用教程

    Go Modules 不完全教程 文章转载自公众号 Golang 成神之路 , 作者 L Go Modules 是 Golang 官方最近几个版本推出的原生的包管理方式,在此之前,社区也不乏多种包管理 ...

  7. 使用可移动表空间(TTS)的最佳做法 (Doc ID 1457876.1)

    Best Practices for Using Transportable Tablespaces (TTS) (Doc ID 1457876.1) APPLIES TO: Oracle Datab ...

  8. LeetCode刷题-最长公共前缀(简单)

    题目描述 编写一个函数来查找字符串数组中的最长公共前缀. 如果不存在公共前缀,返回空字符串 "". 示例 1: 输入: ["flower","flow ...

  9. 池化技术(二)HikariCP是如何管理数据库连接的?

    基于依赖程序的版本信息:HikariCP:3.3.1               驱动程序mysql-connector-java:8.0.17 上一篇:Druid是如何管理数据库连接的 零.类图和流 ...

  10. 洛谷 P4396 (离散化+莫队+树状数组)

    ### 洛谷P4396  题目链接 ### 题目大意: 有 n 个整数组成的数组,m 次询问,每次询问中有四个参数 l ,r,a,b .问你在[l,r] 的区间内的所有数中,值属于[a,b] 的数的个 ...