By
Kamran Agayev A.
Every Oracle Database must have a method of
maintaining information that is used to roll back, or undo, changes
to the database. Such information consists of records of the actions
of transactions, primarily before they are committed. These records
are collectively referred to as undo
Undo records are used to:
- Rollback transactions when a ROLLBACK statement is issued
When a ROLLBACK statement is issued, undo records are used to
undo changes that were made to the database by the uncommitted
transaction. During database recovery, undo records are used to undo
any uncommitted changes applied from the redo log to the datafiles.
Undo records provide read consistency by maintaining the before
image of the data for users who are accessing the data at the same
time that another user is changing it.
In automatic undo management mode, you create an undo
tablespace, and the server automatically manages undo segments and
space among the various active sessions
When the instance starts, the database automatically
selects the first available undo tablespace. If no undo tablespace
is available, then the instance starts without an undo tablespace
and stores undo records in the SYSTEM tablespace.
Undo Retention
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. For these reasons, it is desirable to retain the old
undo information for as long as possible.
When automatic undo management is enabled, there is
always a current undo retention period, which is the minimum amount
of time that Oracle Dataabase attempts to retain old undo
information before overwriting it. Old (commiteed) undo information
that is older than the current undo retention period is said to be
expired. Old undo information with an age that is less than the
current undo retention period is said to be unexpired.
Oracle database automatically tunes the undo retention
period based on undo tablespace size and system activity. You can
specify a minimum undo retention period (in seconds) by setting the
UNDO_RETENTION parameter. The database makes its best effort to
honor the specified minimum undo retention period, provided that the
undo tablespace has space available for new transactions. When
available space for new transactions becomes short, the databsae
begins to overwrite expired undo. If the undo tbalespace has no
space for new transactions after all expired undo is overwritten,
the databsae may begin overwriting unexpired undo information. If
any of this overwritten undo information is required for consistent
read in a current long-running query, the query could fail with the
snapshot too old error message.
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.
You enable retention guarantee by specifying the
RETENTION GUARANTEE clause for the undo tablespace when you create it
with either the CREATE DATABASE or CREATE UNDO TABLESPACE statement.
|
|
|
|
Get the Complete
Oracle Tuning Details
The landmark book
"Oracle
Tuning: The Definitive Reference Second Edition" has been
updated with over 1,150 pages of expert performance tuning tips.
It's packed with scripts and tools to hypercharge Oracle 11g
performance and you can
buy it for 40% off directly from the publisher.
|
|
|
Download your Oracle scripts now:
www.oracle-script.com
The
definitive Oracle Script collection for every Oracle professional DBA
|
|
| |
| |

Copyright ©
1996 -2011 by Burleson Enterprises. All rights reserved.
Oracle® is the registered trademark of Oracle
Corporation. SQL Server® is the registered trademark of Microsoft
Corporation. Many of the designations used by computer vendors to distinguish their
products are claimed as Trademarks
|
|