why does oracle recovery redo before undo?

  • From: "Ryan" <ryan.gaffuri@xxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 19 Apr 2004 17:28:27 -0400

I know how it works. I know that it works. I can't find 'why'? I'm taking a 
university database class and my professor says the optimal way to recover is 
with undo before redo and so does my book.
Anyone know why Oracle does it the other way?

Here is how I think Oracle performs recovery.

1. Oracle scans the redo log from the end back to the last checkpoint. 
2. Oracle takes notes of all open transactions at the time of the checkpoint. 
Why it was scanning backwards it noted all 'commits' 
3. If there are any open transactions at the time of the last checkpoint oracle 
continues to scan back until it reaches the earliest one.
4. Oracle rolls forward and applies all redo from that point to the end of the 
log.
5. Oracle Rollsback all open transactions.

Now my book says the optimal way to do this is to check for all open 
transactions at the time of the last checkpoint that have committed after that 
checkpoint.

Anyone know more? In particularly know 'why'? 
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: