关于undo_retention

select sum(bytes / 1024 / 1024), status, tablespace_name
from dba_undo_extents group by status, tablespace_name;

该查询将返回以STATUS分组的各状态回滚信息所使用的空间量,一般存在三种STATUS状态:
EXPIRED,UNEXPIRED,ACTIVE。
ACTIVE 表示目前仍活跃的事务相关回滚信息;
UNEXPIRED表示虽然事务已经结束但回滚信息保留的时间仍未超过实例参数 UNDO_RETENTION 所设定的
值;
EXPIRED 表示回滚信息保留时间已超过 UNDO_RETENTION 所设定的值。

在 UNDO 表空间未启用 guarantee 选项的情况下(当前使用情况),新事务的回滚空间分配
遵循以下依据:
<wbr> a) 寻找不存在 ACTIVE 区间的回滚段,若没有则创建一个新的回滚段,若空间不允许生成新段,则返回错误。<br><wbr> b) 如果有一个回滚段被选中,但是其中空闲的空间并不足以存储该事务的回滚信息,那么它将尝试创建区间,如果表空间上没有空间,那么将会进入下一步。<br><wbr> c) 如果创建新区间失败,它将会搜索其他回滚段中的 EXPIRED 区间并重用。<br><wbr> d)<wbr> 如果其他回滚段中没有 EXPIRED 区间可使用,那么它会继续搜索其他回滚段中UNEXPIRED 区间并重用,注意事务不会重用本回滚段中的 UNEXPI RED 区间,故 UNEXPIRED 的回滚空间仅部分可以为 Oracle 重用;若仍得不到所需则返回错误。<br> 结论(warehouse):flashback_transaction_query 中的数据来自 undo datafile,只要 事务对应的 before image 在 undo datafile中存在,flashback_transaction_query 里面就 可以查询到数据...目前没发现受那个参数的制约<br><br> UNDO_RETENTION specifies (in seconds) the low th reshold value of undo retention.<br> For AUTOEXTEND undo tablespaces, the system retains undo for at least the time<br> specified in this parameter, and automatically tunes the undo retention period to<br> satisfy the undo requirements of the queries. For fixed- size undo tablespaces, the<br> system automatically tunes for the maximum possible undo retention period, based on<br> undo tablespace size and usage history, and ignores<wbr> UNDO_RETENTION unless<br> retention guarantee is enabled<br><br> The setting of this parameter should account for any flashback requirements of the<br> system. Automatic tuning of undo retention is not supported for LOBs. The<br> RETENTION value for LOB columns is set to the value of the UNDO_RETENTION<br> parameter.<br> The<wbr> UNDO_RETENTION parameter can only be honored if the current undo tablespace<br> has enough space. If an active transaction requires undo space and the undo<br> tablespace does not have available space,<wbr> then the system starts reusing unexpired<br> undo space. This action can potentially cause some queries to fail with a "snapshot too<br> old" message.<br> The amount of time for which undo is retained for the Oracle Database for the current<br> undo tablespace can be obtained by querying the TUNED_UNDORETENTION column of<br> the<wbr> V$UNDOSTAT dynamic performance view.<br><br></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

你可能感兴趣的:(undo)