UNDO_RETENTION

本文详细解析了Oracle数据库中UNDO_RETENTION参数的作用,包括其如何影响undo表空间的管理,自动调整undo保留期以满足查询需求,以及与固定大小undo表空间的关系。同时,介绍了参数设置对闪回需求的影响,以及自动调整机制在LOBs上的限制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这是一个动态参数,很脆弱,可以被各种情况弄死,大概就是仅供参考的意思。

For AUTOEXTEND undo tablespaces, the system retains undo for at least the time specified in this parameter, and automatically tunes the undo retention period to satisfy the undo requirements of the queries. For fixed- size undo tablespaces, the system automatically tunes for the maximum possible undo retention period, based on undo tablespace size and usage history, and ignores UNDO_RETENTION unless retention guarantee is enabled.

对于undo 表空间,系统会尽量保留undo数据至少为undo_retention设置的时间,并且也会自动的调整undo 保留期,来满足查询的undo需求。对于固定的undo表空间,系统会根据撤销表空间大小和使用历史自动调整为最大的undo保留期,这个时候会忽略UNDO_RETENTION参数,除非retention guarantee 是可用的。
alter set system set undo_retention=guarantee;强制保留到undo_retention设置的时间。

The setting of this parameter should account for any flashback requirements of the system. Automatic tuning of undo retention is not supported for LOBs. The RETENTION value for LOB columns is set to the value of the UNDO_RETENTION parameter.

这个参数的设置应考虑系统任何的闪回需求。undo retention的自动调整不被LOBs支持。LOB列的RENTENTION值会被设置成undo_retention参数的值。

The UNDO_RETENTION parameter can only be honored if the current undo tablespace has enough space. If an active transaction requires undo space and the undo tablespace does not have available space, then the system starts reusing unexpired undo space. This action can potentially cause some queries to fail with a “snapshot too old” message.

只有当undo表空间有足够的空间时,才能遵守undo_retention参数,如果活动的事务需要undo空间但是undo 表空间没有足够的可用空间,系统就是重用unexpired状态的undo空间,这个行为将会导致某些查询因为“snapshot too old”消息而失败。

undo 有active、unexpired、expired状态。active是事务未被提交,所以不会被覆盖,unexpired是提交了,但是该数据还没有超出undo_retention 设置的保留时间,而expired 则是数据已经提交,而且还超出了undo_retention时间,这个随时可以被覆盖,而且优先被覆盖。
大概就是早提交,早覆盖。

The amount of time for which undo is retained for the Oracle Database for the current undo tablespace can be obtained by querying the TUNED_UNDORETENTION column of the V$UNDOSTAT dynamic performance view.

通过查询V$UNDOSTAT动态性能视图的TUNED_UNDORETENTION列,可以获得当前还原表空间为Oracle数据库保留还原的时间。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值