问题:上周有个表数据全给delete了,通过闪回恢复到两个小时前的数据,有个问题:我们UNDO默认只有15分钟,为什么可以恢复到2个小时的数据呢?而且闪回也是没有开启的。

依据官方文档的描述,该参数在自动扩展的undo表空间中,在表空间容量充足的前提下,代表的是至少保留的时间。也就是说在表空间充足且没有太多新增的undo信息的话,是有这个可能可以查到几个小时前的信息的。


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.
可以看下官方的参数解释,当undo表空间设置了很大之后,会忽略UNDO_RETENTION参数


前两位的答复都提到了要分undo表空间是否自动扩展来说明。补充下,对于固定大小的undo 表空间,需要开启retention guarantee才能出现你描述的忽略UNDO_RETENTION 的情况,这是undo类表空间的属性,默认是不开启的。


