我们先看看对于UNDO_RETENTIOIN的解释:

10G的解释:

The UNDO_RETENTION parameter is ignored for a fixed size undo tablespace. The database may overwrite unexpired undo information when tablespace space becomes low.
For an undo tablespace with the AUTOEXTEND 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.
UNDO_RETENTION参数对于固定大小的undo表空间是被忽略的。当undo表空间不足时,oracle会重写未过期的undo区。对于能够自动扩展的undo表空间,数据库尽量保证UNDO_RETENTION参数设置的undo空间保留的最小时间。当undo空间不足时,数据库会去自动扩展undo表空间的大小,而不是去重写未过期的undo空间。对于自动扩展的undo表空间的配额达到了MAXSIZE指定的最大值时,数据库就会去重写未过期的undo空间。
11G的解释:

UNDO_RETENTION specifies (in seconds) the low threshold value of undo retention. 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.

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_RETENTION参数指定了undo空间保留时间的最低阈值。对于自动扩展的undo表空间,系统至少会保存这个参数指定的undo空间,会自动调整undo的保存时间来满足一些对undo有要求的查询。对于固定大小的undo表空间,会忽略UNDO_RETENTION参数的设置,系统会根据undo表空间的大小和使用的历史情况,去自动调整到undo保存的最大时间,除非 undo表空间设置了retention guarantee。

只有当undo表空间有足够的空间时,UNDO_RETENTION指定的undo保留时间才能被保证。如果一个正在执行的事务需要undo空间,但是undo表空间又没有这么大的可用空间时,系统就会重用未过期的undo空间。这样的操作就可能会引起查询出现快照过旧的问题。

通过上面10G,11G对UNDO_RETENTION的解释,我们可以解释一些现象:

1. 为什么DBA_UNDO_EXTENTS里老是有那么多EXPIRED的区不回收?--因为oracle在空间足够的情况下,只保证UNDO_RETENTIOIN参数指定的最小保留时间,至于最长保留多久就是它自己管理的,我们管不着。

2. 如果保证undo的保留时间?alter tablespace UNDOTBS1 retention guarantee;alter tablespace UNDOTBS1 retention noguarantee;

3. undo空间的使用顺序是什么?

如果空间足够的情况下(包括能够自动扩展):使用多余的空间(包括过期的undo空间);

如果过期的undo空间也用完,则看undo表空间guarantee的设置(看dba_tablespace),如果有保障,则不会用未过期的undo空间(操作很可能就会失败),如果没有保障则使用未过期的undo空间

UNDO_RETENTIOIN相关推荐

  1. oracle闪回某个时间点的数据库,Oracle 闪回总结

    一.闪回查询(Flashback Query) 1.闪回查询技术 1.1 闪回查询机制 闪回查询是指利用数据库回滚段存放的信息查看指定表中过去某个时间点的数据信息,或过去某个时间段数据的变化情况,或某 ...

最新文章

  1. 16进制 hbase phoenix_【建议收藏】HBase表的RowKey设计
  2. 中年程序员,有哪些关于保护身体健康的知识分享给同行的你?
  3. Eclipse自动注册Servlet:web.xml注册和@Servlet注解 实现注册
  4. IOS8 兼容本地推送
  5. css expression
  6. instanceof的用法①
  7. 【一天一个C++小知识】005. C++中的句柄类(智能指针)
  8. 程序猿趣图几张,第一张就亮瞎了..
  9. 使用Bitmap font generator工具生成fnt文件
  10. go语言加解密算法 md5 sha256
  11. java 正则 竖线_Java 中正则表达式如何匹配竖线(|) , 以及在 Kotlin 中是如何改进的?...
  12. form表单回车会自动提交
  13. asp.net 打印html文件,关于ASP.NET页面打印技术的常用方法总结
  14. iptables设置映射通过外网端口代理ssh登录内网服务器
  15. 最适合小白的编程语言是什么?网友直呼:那当然是Python!
  16. Eclipse方式: Processes that Adapt (part I)
  17. 无线测温模块在轧钢厂的应用
  18. http协议学习系列
  19. AUC的置信区间和两个AUC的差异性比较
  20. 浅析嵌入式系统的发展趋势

热门文章

  1. matlab打靶法,打靶法(含Matlab程序).doc
  2. React学习笔记-2-什么是jsx?如何使用jsx?
  3. EXCEL——DOI实现屏幕嵌套EXCEL表格
  4. 鸿蒙系统不是PC系统,【图片】华为鸿蒙系统的厉害之处在于 你可能非用不可 !【手机吧】_百度贴吧...
  5. No module named natsort 错误(顺便更新conda)
  6. 快速分辨订单号生成工具
  7. 联想小新潮7000触摸板失灵_联想 小新潮7000鼠标失灵怎么办?
  8. 快递邮费计算器 update
  9. word论文页码格式如何前后不一样?如何设置和调整格式(两步即可)
  10. 微信小程序vue+nodejs个人理财运动健身打卡uniapp+python+springboot