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

Home -> Community -> Mailing Lists -> Oracle-L -> Redo log question

Redo log question

From: Peter Dixon <peterdixon001_at_hotmail.com>
Date: Thu, 22 Sep 2005 14:11:13 +0000
Message-ID: <BAY101-F160F987F06C4D43D4267EAFC970@phx.gbl>


I'm studying for my 9i OCP and I'm struggling to understand how transactions, redo and rollback all fit together.

My understanding of the process is as follows:

I issue an insert/update/delete, basically some DML. This grabs a slot in the transaction table slot in a rollback segment header which is initially flagged as ACTIVE (i.e. uncommitted) so the undo shouldn't be overwritten.

The "before" image of the blocks that are changed by the DML statement are written into blocks in the rollback segment.

Because these constitute changes to the rollback segment blocks these change vectors are written to the redo log buffer.

An ITL entry is created in the headers of the data blocks that are changed by the DML. This ITL contains a pointer to the transaction table slot in the rollback segment.

These changes to the data blocks are written to the redo log buffer.

Let's now say the user has not yet committed these changes, and LGWR now writes the redo log buffer contents to the online redo log files.

At this point I think I am OK. If the instance crashed then, on recovery SMON would firstly reconstruct the undo from the change vectors to the rollback block and reconstruct the changes to the data blocks but would then rollback the changes because the transaction table slot in the rollback segment header shows that this transaction is not comitted.

Is this correct?

OK moving on - what exactly happens when the user issues a COMMIT? The 9i concepts states that it writes the SCN to online redo log files? How exactly is this achieved - is it just a "line" in the redo log file and not a change vector?

My guess is that this is what happens:

When the user issues a commit, the transaction table slot in the rollback segment is changed from ACTIVE (uncommitted) to INACTIVE (committed). This constitutes a change to the block containing the rollback segment header. And this change is written away to the redo log buffers.

So when rolling forward using the online redo log files, for this transaction we have:

  1. rollback segment header(uncommitted)
  2. change vectors to reconstruct "before image" undo blocks
  3. change vectors to change data blocks
  4. rollback segment header(committed)

I'm sure this is an over simplified (and probably wrong) version. Can someone please clarify this for me?

My other major area of confusion in all of this is where do SCN's fit in, when are they allocated?

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Sep 22 2005 - 09:13:35 CDT

Original text of this message

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