Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: What exactly is writen in the logs.
The redo log files capture changes ('after images') to datablocks. Before a data row
is changed, undo data ('before image') is stored in the rollback segment. Since the
rollback segment itself is stored in datablocks, the changes to the rollback segment
are also captured in the redo log.
The 'after image' of the rollback segment is actually the 'before image' of the changed row.
The net effect is that both undo and redo data is in the redo log file. In other words, the redo log file contains both 'before images' and 'after images'.
I have used the DB Log Master for Oracle (from BMC) to examine the contents of the redo log file. They can show you both the undo and the redo details for any transaction. They can even format this into SQL to redo or undo the transaction.
I'm not pushing the BMC product. I just offer it a proof that both undo and redo are logged.
Doug Cowles wrote:
> 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? If so, which part? 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? In that case, no before image or anything from the
> rollback segments themselves are really sent to the redo logs -- right?
>
> - Dc.
>
> Thomas Kyte wrote:
>
> > A copy of this was sent to Simmo <famine_at_death.iinet.net.au>
> > (if that email address didn't require changing)
> > On Mon, 08 Mar 1999 10:58:37 +0800, you wrote:
> >
> > >Hi all,
> > >
> > >When data is modified and written out to the logs, is it the before and
> > >after value of the field(s) that are written or the contents of the
> > >block(s) (defined by db_block_size) held in the data buffer cache that
> > >were modified ?
> > >
> >
> > as the name implies -- REDO is written to redo logs, AFTER IMAGEs are written to
> > the logs. BEFORE IMAGES (UNDO) are written to the rollback segments.
> >
> > Some will say that both before and after are written to the redo logs. This is
> > technically not accurate but a common statement. The reason they say this is
> > because rollback is logged as well. Since rollback contains before images, the
> > before images for a change are indirectly stored in the redo however it is after
> > images of rollback, not before images of data blocks.
> >
> > Oracle rolls forward from REDO and then always ROLLS BACK from rollback. It
> > never uses REDO to rollback.
> >
> > redo contains changed bytes typically unless you are in hot backup mode in which
> > case full blocks may be logged in some circumstances (eg: you generate more log
> > while in backup mode typically).
> >
> > >sys info
> > >Sol 2.6 Oracle: 7.3.4
> > >
> > >Regards
> > >
> > >Paul Simmons
> > >Aspiring DBA
> >
> >
> > Thomas Kyte
> > tkyte_at_us.oracle.com
> > Oracle Service Industries
> > Reston, VA USA
> >
> > --
> > http://govt.us.oracle.com/ -- downloadable utilities
> >
> > ----------------------------------------------------------------------------
> > Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Tue Mar 09 1999 - 16:58:41 CST
![]() |
![]() |