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.
Old (committed) undo information that is older than the current undo retention period is said to be expired and its space is available to be overwritten by new transactions. Old undo information with an age that is less than the current undo
retention period is said to be unexpired and is retained for consistent read and Oracle Flashback operations.
The UNDO_RETENTION
parameter is ignored for a fixed size undo tablespace.
If the undo tablespace is fixed size, the database dynamically tunes the undo retention period for the best possible retention for that tablespace size and the current system load. This best possible retention time is typically significantly greater than the duration of the longest-running active query.
If you choose an undo tablespace size that is too small, the following two errors could occur:
-
DML could fail because there is not enough space to accommodate undo for new transactions.
-
Long-running queries could fail with a snapshot
too
old
error, which means that there was insufficient undo data for read consistency.
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