Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: redo log groups vs. rollback segments

Re: redo log groups vs. rollback segments

From: Mark D Powell <markp7832_at_my-deja.com>
Date: 2000/05/28
Message-ID: <8grnjv$8k$1@nnrp1.deja.com>#1/1

In article <8gq4k9$vds$1_at_nnrp1.deja.com>,   orauser_at_my-deja.com wrote:
>
>
> From the docs I understand that redo logs are used to
> log all changes to the database while rollback segments are
> used to log changes that occur within a transaction?? Is that
> correct? Does that mean that redo logs grow much more than
> rollback segs?
>
> Can someone please explain the difference and perhaps point
> out some configuration guidelines for redo logs vs. rollback
> segs, in terms of size, number, placement, etc?
>
> Many Thanks :-)
>

Point 1 - redo logs
a) exist to provide database recovery in the event of instance and/or media failure
b) contain after images of database block changes which includes the database data files and rollback segment blocks c) redo logs are fixed in size at creation and when one log one fills a redo log switch is done. The redo log switch process includes a system checkpoint being taken. The system checkpoint causes all dirty [changed] data blocks to be written to disk and the file headers to be updated.

Point 2 - rollback segments [rbs]
a) exist to provide rollback of failed transactions and provide snapshots of data at specific points in time using the system change number, scn. This is often refered to as a consistent read. b) contain before images of changed data c) are segments that are assigned to tablespaces. It is recommended, but not required that this tablespace be dedicated to rollback segments. These segments are made up of extents just like table and index segments but when the last allocated extent in a rbs segment is used instead of allocating another extent Oracle overlays the first extent in the segment unless it is currently being used to hold uncommited data.

Simplified explanation:

Now when a select statement is issued all data returned to the select is at the point in time of when the select started. If another process modifies a row before you read it then when your process reads this block Oracle recognizes via the scn number that the block has been changed since your query started and reads the rbs segments to find the before change data. If Oracle finds the data your process continues on just fine, but if Oracle can not locate the change data then a 01555 'snapshot too old' error is issued.

[Since archive logs are only needed for media recovery we will just talk about instance recovery. The recovery process is the same, roll forward followed by rollback]

In order to perform recovery Oracle compares the file headers to the control file and applies all redo blocks in the on-line redo log to the database datasets that are newer than the checkpoint (including rbs). Some of these blocks may have been uncommited at the time of the crash. Once forward recovery using the redo log is complete the rollback using the rbs segments takes place.

You can find all of this in the Concepts manual. There is a chapter on rollback segments and one on recovery which explains the roll forward/rollback.

--
Mark D. Powell  -- The only advice that counts is the advice that
 you follow so follow your own advice --


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sun May 28 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US