Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: why does oracle recovery redo before undo?
hi,Ryan
you can not determine the transaction would be commit or= rollback until you apply all the redo to the datafile. checkpoint(last checkpoint) is not the point , if server crash= ,dbms must apply all the redo from the end of the current log ,= then it can determine which transaction (from the undo segment= header ,v$transaction) will be rollback.at any time before= apply the redo from the end of the current log ,it is not = sure which open transaction would be rollback. if it rollback= the trans, it would be lost data(such as incomplete= recovry,current log corrupt,etc).
Best regards
yahoo id: feng_chunpei
msn: biti_rainy_at_hotmail.com
=3D=3D=3D=3D=3D=3D from the mail=3D=3D=3D=3D=3D=3D=3D=3D=3D
>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_at_freelists.org
>put 'unsubscribe' in the subject line.
>--
>Archives are at http://www.freelists.org/archives/oracle-l/
>FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
>----------------------------------------------------------------=
-
>
>.
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Mon Apr 19 2004 - 20:30:54 CDT
![]() |
![]() |