Database Reference
In-Depth Information
(because it is not enabled or it has reached the MAXSIZE ), Oracle must make a choice. It
can either forego the retention period by removing unexpired data or honor the retention
period, thereby causing the new transaction to fail. By default, Oracle will choose to
sacrifice the unexpired data to make room for the new transaction.
In the following sections, you will learn how an undo retention period can be established
and what effect it will have. You will also learn about the power and the pitfalls of guarantee-
ing undo retention.
Establishing an Undo Retention Period
As part of its management duties, AUM monitors system activity and available undo space
to derive an optimum undo retention time. This setting may change over time as activity
and available space change. Since AUM takes care of this, there is no action required by the
DBA to establish an undo retention period.
However, AUM will also allow you to specify the retention period yourself. It can be done
by setting the UNDO_RETENTION initialization parameter, as shown here:
SQL> ALTER SYSTEM SET UNDO_RETENTION=14400
SCOPE=BOTH;
System altered
When AUM encounters a manual undo retention setting, it will honor the setting only if
it is using an autoextending tablespace. If AUM is configured with a fixed-size tablespace, it
will ignore the setting and will instead follow its default behavior of dynamically setting the
retention time based on system activity and available disk space.
Because of this behavior, it is highly recommended that you allow AUM to use an
autoextending undo tablespace. If you are concerned that an errant long-running query
could cause it to extend too much, use the MAXSIZE option to limit its growth.
Guaranteeing Retention
As mentioned previously, Oracle will violate the undo retention period if it is required to pre-
vent transactions from failing. For most users, it is a fair trade-off. However, there may be
situations where it is more important to guarantee the retention period, even at the expense of
failed transactions. This can be accomplished by specifying the RETENTION GUARANTEE clause
on the undo tablespace. This can be done either when initially creating the tablespace or by
altering the tablespace, as shown here:
SQL> ALTER TABLESPACE UNDOTBS1 RETENTION
GUARANTEE;
Tablespace altered.
When the clause is invoked on the undo tablespace, Oracle will never remove unexpired
data from the undo tablespace, even if it means allowing new transactions to fail.
Search WWH ::




Custom Search