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: Question on REDO & SCN

Re: Question on REDO & SCN

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sun, 27 Nov 2005 07:51:56 +0000 (UTC)
Message-ID: <dmbois$64r$1@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com>

"Mladen Gogala" <gogala_at_sbcglobal.net> wrote in message news:pan.2005.11.27.06.32.46.429428_at_sbcglobal.net...
> On Thu, 24 Nov 2005 16:07:43 +0000, Jonathan Lewis wrote:
>
>> It is this change that is 'just another block
>> change' and therefore described by a bit of redo,
>> which the manuals (incorrectly) call the 'commit record'.
>
> But there must be something to distinguish this record from the "normal"
> change records. How would recovery process know which transaction has
> committed? When applying redo ("roll forward") finishes, uncommitted
> changes are rolled back. Without a clear delimiter, it is a bit unclear
> how can recovery know which ones should be rolled back? I believe that
> there must be some kind of flag saying "I am a commit record for
> transaction id=...".
>
> --
> http://www.mgogala.com
>

You didn't quote the sentence before - which explains that your update IS the 'commit record'

> To end a transaction, you update the row (in

      the transaction table in the undo segment) with
> the commit SCN, and flag the row to show that
> it is free.

The following mess is from that table, 1st row: index state cflags wrap# uel scn dba parent-xid nub stmt_num


0x00 9 0x00 0x16af6 0x002a 0x0000.06c04359 0x00000000 0x0000.000.00000000 0x00000000 0x00000000

Note the state is 9 - when I start a transaction, I grab one of these and change the state to 10. When I commit, I change the status back to 9. (I do make several other changes but I'm ignoring them).

The change vector for the last change IS the "commit record". When rollforward completes, smon checks the state flags on all transaction table slots looking for 10's and rolls those back.

-- 
Regards

Jonathan Lewis

http://www.jlcomp.demon.co.uk/faq/ind_faq.html
The Co-operative Oracle Users' FAQ

http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html
Cost Based Oracle: Fundamentals

http://www.jlcomp.demon.co.uk/appearances.html
Public Appearances - schedule updated 22nd Nov 2005
Received on Sun Nov 27 2005 - 01:51:56 CST

Original text of this message

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