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: redo records

Re: redo records

From: kyle hailey <oraperf_at_yahoo.com>
Date: Sat, 10 Feb 2001 04:44:25 -0800
Message-ID: <8aaa8tsb4t49319rb7aai3mppph7sbb0s6@4ax.com>

The orignal poster's questions were:

  1. >If a rollback occurs how does Oracle do to process it?
  2. > I mean it must have stored somewhere the information that a
    > modification has not been commited yet.
    > Where is stored this information?
  3. If something is rolled back is needed, the you read the rollback entries and apply them to the data blocks. Not sure what the question here is. Do you want more info on how a rollback undo operation is applied to a datablock? The rollback segment contains logical information for rolling back a change in a datablock. This is a little different from the redo log which contains a physical change vector.
  4. Oracle stores the fact that things are commited.. A commited transaction either marks the datablock as commited or commit information is kept in the rollback segment. The need to rollback either occures at recovery when the redo is applied and then the rollback is read through and applied as needed or its applied because the transaction failed or was explicity rolled back. It sounds like the original poster is wondering about recovery. In recovery all the physical datablock changes are applied from the redo logs, even ones that are not committed, and then the rollback segments are read to tell what was left uncommited and then those datablock changes are rolled back.

Your question:

 > Isn't a redo file supposed to contain only valid data change?

If by valid you mean commited, then no. Oracle stores all the data block vector changes (including rollback segments) to the redo log. The only changes that are guarenteed to be on disk are commited transactions. This is for reasons of logical data integrity. I think you might be asking, "why does Oracle bother to write uncommited changes to the redo log - isn't it a waste, I mean you don't need them to reconstruct a commited version of the database?" If this is your question, it seems like it is a whole lot easier to guarentee that all of the info needed for a long running change is in the redo log on disk if all changes are written out, because in that case we know if we flush our last changes to disk, because redo is sequential, we are guarenteed that the description of the entire transaction is on disk. If Oracle was waiting until a commit happened to store information about the commited changes the the wait could be quite a while for a large transaction, but because changes are logged as they happen then a commit can be rapid on the order of 5-20/1000ths of a second.

I might be assuming alot about the reader in this discussion. Let me know if you'd like more. Its a pretty big subject. I'm assuming that the idea that datablock from datafiles are not guarentted to be written on disk. They are changed in memory so if the machine goes down they are lost (except for those written out by the DBWR and the discusion of log file switches and checkpoints), but Oracle does guarentee that all we need to reconstruct the databse changes that were lost in live memory are in the redo logs.

> At rollback, will Oracle go into the
>redo file and find the record and change it or delete it?

No, as explained above there is no need to do such a thing

Best
Kyle
www.geocities.com/oraperf Received on Sat Feb 10 2001 - 06:44:25 CST

Original text of this message

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