After a transaction is committed, undo data is no longer needed for rollback or transaction recovery purposes. However, for consistent read purposes, long-running queries may require this old undo information for producing older images of data blocks. Furthermore, the success of several Oracle Flashback features can also depend
upon the availability of older undo information. For these reasons, it is desirable to retain the old undo information for as long as possible.
When automatic undo management is enabled, there is always a current undo retention period, which is the minimum amount of time that Oracle Database attempts to retain old undo information before overwriting it. Old (committed) undo information that is older than the current undo retention period is said to be expired. Old undo information with an age that is less than the current undo retention period is said to be unexpired.
Oracle Database automatically tunes the undo retention period based on undo tablespace size and system activity. You can specify a minimum undo retention period (in seconds) by setting the UNDO_RETENTION initialization parameter. The database makes its best effort to honor the specified minimum undo retention period, provided that the undo tablespace has space available for new transactions. When available space for new transactions becomes short, the database begins to overwrite expired undo. If the undo tablespace has no space for new transactions after all expired undo is overwritten, the database may begin overwriting unexpired undo information. If any of this overwritten undo information is required for consistent read in a current long-running query, the query could fail with the snapshot too old error message.
The following points explain the exact impact of the UNDO_RETENTION parameter on undo retention:
The UNDO_RETENTION parameter is ignored for a fixed size undo tablespace. The database may overwrite nexpired undo information when tablespace space becomes low.For an undo tablespace with the UTOEXTEND option enabled, the database attempts to honor the minimum retention period specified by UNDO_RETENTION. When space is low, instead of overwriting unexpired undo information, the tablespace auto-extends. If the MAXSIZE clause is specified for an auto-extending undo tablespace, when the maximum size is reached, the database may begin to overwrite unexpired undo information.
Retention Guarantee
To guarantee the success of long-running queries or Oracle Flashback operations, you can enable retention guarantee. If retention guarantee is enabled, the specified minimum undo retention is guaranteed; the database never overwrites unexpired undo data even if it means that transactions fail due to lack of space in the undo tablespace. If retention guarantee is not enabled, the database can overwrite unexpired undo when space is low, thus lowering the undo retention for the system. This option is disabled by default.
WARNING: Enabling retention guarantee can cause multiple DML operations to fail. Use with caution.
You enable retention guarantee by specifying the RETENTION GUARANTEE clause for the undo tablespace when you create it with either the CREATE DATABASE or CREATE UNDO TABLESPACE statement. Or, you can later specify this clause in an ALTER TABLESPACE statement. You disable retention guarantee with the RETENTION NOGUARANTEE clause.You can use the DBA_TABLESPACES view to determine the retention guarantee setting for the undo tablespace. A column named RETENTION contains a value of GUARANTEE, NOGUARANTEE, or NOT APPLY (used for tablespaces other than the undo tablespace).
Automatic Tuning of Undo Retention
Oracle Database automatically tunes the undo retention period based on how the
undo tablespace is configured.If the undo tablespace is fixed size, the database tunes the retention period for the
best possible undo retention for that tablespace size and the current system load. This tuned retention period can be significantly greater than the specified minimum retention period.
If the undo tablespace is configured with the AUTOEXTEND option, the database tunes the undo retention period to be somewhat longer than the longest-running query on the system at that time. Again, this tuned retention period can be greater than the specified minimum retention period.Note: Automatic tuning of undo retention is not supported for LOBs. This is because undo information for LOBs is stored in the segment itself and not in the undo tablespace. For LOBs, the database attempts to honor the minimum undo retention period specified by UNDO_RETENTION. However, if space becomes low, unexpired LOB undo information may be overwritten.
You can determine the current retention period by querying the TUNED_UNDORETENTION column of the V$UNDOSTAT view. This view contains one row for each 10-minute statistics collection interval over the last 4 days. (Beyond 4 days, the data is available in the DBA_HIST_UNDOSTAT view.) TUNED_UNDORETENTION is given in seconds.
select to_char(begin_time, 'DD-MON-RR HH24:MI') begin_time,
to_char(end_time, 'DD-MON-RR HH24:MI') end_time, tuned_undoretention
from v$undostat order by end_time;
External Views
Monitor transaction and undo information with V$TRANSACTION and V$ROLLSTAT.
For automatic undo management, the information in V$ROLLSTAT reflects the
behaviors of the automatic undo management undo segments.
The V$UNDOSTAT view displays a histogram of statistical data to show how well the
system is working. You can see statistics such as undo consumption rate, transaction
concurrency, and lengths of queries run in the instance. Using this view, you can better
estimate the amount of undo space required for the current workload.
分享到:
相关推荐
本文将围绕“达梦修改UNDO_RETENTION”这一主题,详细探讨这一设置对数据库性能的影响及其调整方法。 UNDO RETENTION参数在数据库中扮演着至关重要的角色,它定义了撤销段(UNDO SEGMENT)中数据保留的时间长度。...
本文将深入探讨“C# undo/redo框架”的核心概念、设计模式以及如何实现。 1. **命令模式**: 撤销/重做框架通常基于命令模式设计。命令模式是一种行为设计模式,将请求封装为一个对象,使发出请求与执行请求解耦。...
### Oracle的Temp表空间与UNDO表空间处理详解 #### 一、Temp表空间处理 在Oracle数据库中,Temp表空间主要用于存储临时对象,如排序、分组等操作产生的临时数据。这些操作可能会导致Temp表空间迅速增大。然而,...
### 12c 新特性:Temporary Undo #### 一、Temporary Undo 概念与优势 在Oracle 12c版本中引入了一项重要的新特性——Temporary Undo,这项技术旨在优化临时表的操作性能,并减少对Redo日志的空间占用。传统的临时...
### 关于Oracle释放过度使用的Undo表空间的知识点 在Oracle数据库管理中,Undo表空间扮演着极其重要的角色。它主要用于存储事务处理过程中产生的Undo记录,这些记录对于事务回滚、一致性读取以及恢复操作至关重要。...
在编程领域,撤销(Undo)和重做(Redo)功能是用户界面中常见的操作,它们允许用户取消或恢复最近的更改。在C#中,我们可以利用.NET框架提供的事件驱动和面向对象特性来实现这样的功能。这篇实验主要探讨了如何在...
### Oracle 12C R2 本地UNDO模式详解 #### 一、概述 Oracle 12C R2 引入了一种新的UNDO管理模式——本地UNDO模式(LOCAL_UNDO_ENABLED),它允许每个可插拔数据库(PDB)拥有独立的UNDO表空间。这一特性显著提升了...
5. **undo.h和undo.txt文件**:在提供的文件列表中,`undo.h`可能包含了自定义undo对象的定义,例如`CMyUndoObject`类。`undo.txt`可能是一个文本文件,其中包含了关于如何实现撤销/重做的更详细说明或示例代码。 ...
在IT行业中,“Undo”是一个非常基础且重要的概念,它广泛应用于各种软件和应用程序中,特别是在文本编辑器、图像处理软件以及编程环境中。这个功能允许用户撤销最近的操作,恢复到操作前的状态,极大地提高了工作...
标题和描述均提到了“undo表空间恢复”,这在Oracle数据库管理中是一个关键主题,尤其对于数据恢复和事务处理有着重要影响。以下是对这一知识点的深入解析: ### 一、Undo表空间概述 Undo表空间是Oracle数据库中...
### 专题之Undo工作原理剖析 #### 一、Oracle 10g中Undo表空间的原理 在深入了解Oracle 10g中Undo的工作原理之前,我们先简要回顾一下Undo的概念及其在数据库中的作用。Undo数据是用于实现事务的一致性、隔离性和...
### 多步Undo/Redo实现详解 #### 一、引言 在现代软件开发中,尤其是图形编辑或文档编辑应用程序中,Undo/Redo功能是用户体验的重要组成部分。它不仅提高了用户的工作效率,还能增强软件的易用性。在本篇文章中,...
在IT行业中,"redo undo"框架是用于实现撤销/重做功能的核心技术,常见于各种软件和应用程序中,如文本编辑器、图像处理软件、数据库系统等。它允许用户取消最近的操作并恢复先前的状态,提供了对用户交互的强大支持...
在Oracle数据库系统中,"undo表空间"是一个至关重要的组成部分,它主要负责存储事务的回滚(rollback)信息。本文将深入探讨undo表空间的概念、作用、管理以及常见问题的处理,帮助你全面理解并有效地解决数据库undo...
### Oracle收缩Undo表空间 #### 一、概述 在Oracle数据库管理中,有时需要对Undo表空间进行管理和优化。特别是当Undo表空间因为历史数据积累而变得过大时,可能会影响数据库性能。本文将详细介绍如何通过新建一个...
在图像编辑软件中,撤销(Undo)功能是用户体验的关键组成部分,它允许用户在操作失误时回退到前一个状态,从而避免了永久性错误或不必要的重新工作。在给定的文件信息中,虽然代码片段主要关注于框架类CChildFrame...
Oracle_Undo与Redo的通俗 Oracle中的Undo和Redo是两个非常重要的概念,它们都是Oracle数据库中事务管理和恢复机制的关键组件。Undo和Redo都是为了确保数据库的一致性和可靠性。 什么是REDO? REDO记录transaction...
GIS软件中的Undo与Redo功能是编辑操作的重要组成部分,它们允许用户撤销和恢复之前的编辑行为。本文深入分析了GIS软件中Undo与Redo操作的设计与实现,其主要内容包括Undo与Redo操作的原理、机制、流程以及实现方法。...