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: What exactly is writen in the logs.

Re: What exactly is writen in the logs.

From: Peter Sharman <psharman_at_us.oracle.com>
Date: Wed, 10 Mar 1999 12:44:51 -0800
Message-ID: <36E6D9C3.9B863796@us.oracle.com>


Comments inline

USER wrote:

> < redo holds all after images, after images for data you are modifying as well as
> < after images of rollback (which happen to be before images of your transaction).
> When you say AFTER images of rollback, you mean changes to the rollback segment:
> and only the old data is kept in the rollback segment. Thus, after images of rollback
> are before images of the transaction in question.
>
> So, if you use copies of redo logs during recovery, but have lost the rollback
> segment(s),
> you have the results of phantom transactions that were never meant to be ultimately
> committed.

No, because the after image of the transaction is in the redo log. When the recovery takes place, it rolls forward through the after image of the transaction, then rebuilds the rollback segment, then rolls back the uncommitted transaction. Otherwise the loss of a rollback segment could cause inconsistencies in the database.

> Thus, even if you have the AFTER image of the rollback segments, and thus the old
> data, Oracle
> does not know that a rollback occurred, and thus keeps these rows, resulting in data
> inconsistency
> of a different sort.
>
> So this begs the question: Under WHAT specific conditions, can we use ONLY the redo
> logs to reconstruct the rollback segments (as the redo logs have the information
> needed to do this) and ignore the rollback segments altogether? (Say we set up a
> scenario in which we deliberately blow away the
> rollback segs, so as to test recovery.)

Since the rollback segments are in data files and these are written to asynchronously, the approach I've outlaid above is always taken. So the specific conditions that we only use the redo logs and ignore the rollback segments are all situations.

HTH Pete

> Please confirm my humble take on this, and provide a blow-by-blow scenario of an
> update/delete if possible.
>
> Thanks so much!
> Regards
>
> Thomas Kyte wrote:
>
> > Oracle rolls forward using REDO logs (recovering not only regular 'tables' and
> > such but also recovering rollback segments) and then rollsback any uncommitted
> > transactions from the rollback that was just rolled forward.
> >
> > >I thought REDO only captured after images, and the rollback segments
> > >contained before images, which is why if you lost a rollback segment,
> > >you couldn't roll back. Are you saying rollback info is placed in redo
> > >logs as well?
> >
> > the after image of rollback is logged there yes.
> >
> > >If so, which part?
> >
> > all changes to rollback.
> >
> > >You say after images of rollback are indirectly
> > >stored in the redo. Are you meaning that say for 1 transaction - the rollback
> > >holds the before information, and the redo holds info about the transaction,
> > >as well as after images?
> >
> > redo holds all after images, after images for data you are modifying as well as
> > after images of rollback (which happen to be before images of your transaction).
> >
> > rollback holds before images.
> >
> > >In that case, no before image or anything from the
> > >rollback segments themselves are really sent to the redo logs -- right?
> > >
> >
> > right, only after images of rollback (which are before images of your
> > transaction) are sent to redo.
> >
> > >- Dc.
> >

--

Regards

Pete


Peter Sharman                             Email: psharman_at_us.oracle.com
WISE Course Development Manager           Phone: +1.650.607.0109 (int'l)
Worldwide Internal Services Education            (650)607 0109 (local)
San Francisco

SQL> select standard_disclaimer, witty_remark   2 from company_requirements;

Opinions are mine and do not necessarily reflect those of Oracle Corporation

"Controlling application developers is like herding cats." Kevin Loney, ORACLE DBA Handbook
"Oh no it's not! It's much harder than that!" Bruce Pihlamae, long term ORACLE DBA



Received on Wed Mar 10 1999 - 14:44:51 CST

Original text of this message

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