Databases Reference
In-Depth Information
Blocks of rollback segments are cached in the SGA just like blocks of tables and
indexes. If rollback segment blocks are unused for a period of time, they may be
aged out of the cache and written to the disk.
Chapter 8 discusses Oracle's method for concurrency manage‐
ment, multiversion read consistency. This method uses rollback
segments to retrieve earlier versions of changed rows. If the re‐
quired blocks are no longer available, Oracle delivers a “snap‐
shot too old” error.
Oracle9 i introduced automatic management of rollback segments. In previous ver‐
sions of the Oracle Database, DBAs had to explicitly create and manage rollback
segments. Since Oracle9 i , you have the ability to specify automatic management of
all rollback segments through the use of an undo tablespace. With automatic undo
management, you can also specify the length of time that you want to keep undo
information; this feature is very helpful if you plan on using flashback queries,
discussed in the following section. Oracle Database 10 g added an undo manage‐
ment retention time advisor.
Fast commits
Because redo logs are written whenever a user commits an Oracle transaction, they
can be used to speed up database operations. When a user commits a transaction,
Oracle can do one of two things to get the changes into the database on the disk:
• Write all the database blocks the transaction changed to their respective
datafiles.
• Write only the redo information, which typically involves much less I/O than
writing the database blocks. This recording of the changes can be replayed to
reproduce all the transaction's changes later, if they are needed due to a failure.
To provide maximum performance without risking transactional integrity, Oracle
writes out only the redo information. When a user commits a transaction, Oracle
guarantees that the redo for those changes writes to the redo logs on disk. The actual
changed database blocks will be written out to the datafiles later. If a failure occurs
before the changed blocks are flushed from the cache to the datafiles, the redo logs
will reproduce the changes in their entirety. Because the slowest part of a computer
system is the physical disk, Oracle's fast-commit approach minimizes the cost of
committing a transaction and provides maximum risk-free performance.
Flashback
In Oracle9 i , rollback segments were also used to implement a feature called Flashback
Query . Remember that rollback segments are used to provide a consistent image of the
Search WWH ::




Custom Search