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

Home -> Community -> Usenet -> comp.databases.theory -> Re: why do you apply undo before redo?

Re: why do you apply undo before redo?

From: Dan <guntermannxxx_at_verizon.com>
Date: Tue, 20 Apr 2004 10:01:57 GMT
Message-ID: <py6hc.24496$L31.6318@nwrddc01.gnilink.net>

"Ryan" <rgaffuri_at_cox.net> wrote in message news:U1Dgc.5069$uF3.247_at_lakeread04...
>
> "Jan Hidders" <jan.hidders_at_REMOVETHIS.pandora.be> wrote in message
> news:anCgc.77108$TZ5.5226557_at_phobos.telenet-ops.be...
> > Ryan wrote:
> > > "Jan Hidders" <jan.hidders_at_REMOVETHIS.pandora.be> wrote in message
> > > news:Cwzgc.76768$nU5.5168180_at_phobos.telenet-ops.be...
> > >
> > >>Ryan wrote:
> > >>
> > >>>"Jan Hidders" <jan.hidders_at_REMOVETHIS.pandora.be> wrote in message
> > >>>news:Isugc.75959$VI4.5039222_at_phobos.telenet-ops.be...
> > >>>
> > >>>>Ryan wrote:
> > >>>>
> > >>>>>I'm reading a generic database textbook and it states that when
> > >
> > > databases
> > >
> > >>>>>are recovering undo is applied before redo.
> > >>>>
> > >>>>Any specific reason why you would like the title of the book to
remain
> a
> > >>>>secret? :-)
> > >>>
> > >>>I didn't want to type it. Its 'Database Systems Concepts'. The one
used
> > >>>everywhere.
> > >>
> > >>Good book. But I don't know many universities around here that use it.
> > >>Would you happen to have any statistics on that?
> > >
> > >
> > >>>>>It doesn't say why. Does anyone know?
> > >>>>
> > >>>>Because some of the operations of the transactions of the UNDO list
> > >>>>might conflict with those in the REDO list. So if you did the
> undo-phase
> > >>>>last you might be erasing the result of some operations that you
first
> > >>>>did in the redo-phase.
> > >>>
> > >>>don't quite get this. Oracle applies redo, then rollsback all open
> > >>>transactions? This is why that statement intrigued me since one
> database
> > >>>system does it the opposite way.
> > >>>
> > >>>Not quite sure how the undo can conflict. You roll forward and apply
> all
> > >>>change vectors, then rollback and remove what was never committed.
> > >>
> > >>Suppose that in the REDO list there is a transaction with an operation
> > >>that changed a field from "yes" to "no", and in the UNDO list there is
a
> > >>transaction with also an operation that changed the same field also
from
> > >>"yes" to "no". Then what is the result of the field after REDO - UNDO
> > >>and what after UNDO - REDO?\
> > >
> > > I do not see why this matters. It does not matter what the state of
the
> > > tuple is during recovery, only when it is complete.
> >
> > That is what I'm talking about. What is the result of the field after
> > recovery has completed in the two cases? The first case being first REDO
> > and then UNDO and the second being the reverse.
>
> undo only takes place for uncomitted transactions. undo for committed
> transactions are ignored. are you telling me the author is assuming that
ALL
> undo is applied even for committed transactions?
> >

I believe this is only true for commited transactions where the checkpoint has flushed the buffers. You should ask in the comp.databases.oracle newsgroup for confirmation. It's been a while since I last checked.

There are many approaches (as I reference in another post to Jan) and it is difficult to know which approach the author is referring to.

Regards,

> > > I'm at a loss on your statement. Also, oracle does it the opposite
way?
> >
> > I don't know enough about Oracle to comment on that.
> >
> > -- Jan Hidders
>
>
Received on Tue Apr 20 2004 - 05:01:57 CDT

Original text of this message

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