Databases Reference
In-Depth Information
When Oracle updates data, it first attempts to update the data in the same data block.
If there is not enough room in the data block for the new information, Oracle will write
the data to a new data block that could be in a different extent.
For more information on segments and extents and how they affect performance, refer
to the section on “What About Database Fragmentation?” on page 145 in Chapter 5 . This
discussion is especially important if you are running an older release of Oracle. Oracle
Database 10 g added a Segment Advisor that greatly simplifies reclaiming unused space
in current database versions.
Redo Logfiles
Redo logfiles contain a “recording” of the changes made to the database as a result of
transactions and internal Oracle activities. Since Oracle usually caches changed blocks
in memory, when instance failure occurs, some changed blocks might not have been
written out to the datafiles. The recording of the changes in the redo logs can be used
to play back the changes lost when the failure occurred, thus protecting transactional
consistency.
These files are sometimes confused with rollback buffers supporting
concurrency, described in Chapter 8 . They are not the same!
In addition, redo logfiles are used for “undo” operations when a ROLLBACK state‐
ment is issued. Uncommitted changes to the database are rolled back to the database
image at the last commit.
Suppressing Redo Logging
By default, Oracle logs all changes made to the database. The generation of redo logs
adds a certain amount of overhead. You can suppress redo log generation to speed up
specific operations, but doing so means the operation in question won't be logged in the
redo logs and you will not be able to recover that operation in the event of a failure.
If you do decide to suppress redo logging for certain operations, you would include the
NOLOGGING keyword in the SQL statement for the operation. (Note that prior to
Oracle8, the keyword was UNRECOVERABLE.) If a failure occurred during the oper‐
ation, you would need to repeat the operation. For example, you might build an index
on a table without generating redo information. In the event that a database failure
occurs and the database is recovered, the index will not be re-created because it wasn't
logged. You'd simply execute the script originally intended to create the index again.
 
Search WWH ::




Custom Search