Re: how things happen in a commit process to redo log files

From: <sybrandb_at_hccnet.nl>
Date: Fri, 16 May 2008 21:38:26 +0200
Message-ID: <d8or24dnc0cas3cgp0pf694333jfvdc0ed@4ax.com>


On Fri, 16 May 2008 14:59:13 GMT, pellicleundies_at_hotmail.com (obakesan) wrote:

>Hi
>
>as I understand things when a change occurs something writes the change
>from the database buffer cache to the redo log buffer. Then upon commit (I
>suppose its) LGWR copies these changes from the redo log buffer into the redo
>log files. But does it also write the rollback segment relevant to the
>transaction too?
>
>If so, I'm not sure I see why it might be needed?
>
>thanks
>
>See Ya
>(when bandwidth gets better ;-)
>
>Chris Eastwood
>Photographer, Programmer Motorcyclist and dingbat
>blog: http://cjeastwd.blogspot.com/
>
>please remove undies for reply

I don't think so.
One thing to notice is the undo segment (rollback segments are a thing from the past but work the same) contains the before image (ie the record before the change) and is an *ordinary data segment*, so changes to that segment go to the log buffer.

The log buffer is written when it's one third dirty or when 1M is dirty, whichever occurs first.
The log buffer is always written before the data files are written. As the undo segment is an ordinary data segment this applies to the undo segment too.

Upon commit everything is synchronised, a commit marker is placed in the redolog, and the space in the undo segment is released : ie the transaction info is removed, and the segment is a candidate to be overwritten.
However, at rollback you would have needed the undo segment. You need to write the undo segment to the redo log files in order to survive system crash. During crash recovery uncommitted transactions are rolled back using the undo segments and the redo log files.

Hth

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Fri May 16 2008 - 14:38:26 CDT

Original text of this message