Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: recovery and resetlogs
"Charles J. Fisher" <cfisher_at_rhadmin.org> wrote in message
news:Pine.LNX.4.44.0205230944170.14395-100000_at_galt.rhadmin.org...
> I have a question regarding instance and database recovery and their
> interaction with a resetlogs operation.
>
> I understand that instance recovery is a two-phase process, where SMON
> first rolls-forward all redo, opens the database, and then goes into a
> low-priority background state and rolls-back all uncommitted redo.
>
> However, when the database is recovered from backup datafiles without
> online redo logs (by rolling through archived logs), and the database is
> opened with a resetlogs operation, how does SMON know about the
> uncommitted transactions?
Because in the process of applying the archived redo, SMON has re-performed the original transactions -and therefore locked various records, just as you would have locked them when first performing the transactions. Anything that is left with a lock at the end of the recovery process must, by definition, be uncommitted.
Now then the question is what you roll it back to: but that's sorted, too. The archive log records would have allowed SMON to see what the before and after images of the data were, and the before image would have been placed in rollback segments (again, just as you would have done when first performing the transactions). Having determined that a record still has a 'recovery lock' on it at the point of resetlogs, it's not too hard to fetch the before-images out of the rollback segments, and roll the uncommitted transactions back as per normal.
>
> I imagine that rolling-forward through the redo built all required
> versioning blocks in the rollback segments, but when all redo records are
> erased, how does SMON still retain knowledge of uncommitted transactions?
>
Locks. And the rollback segments tells it what to rollback to.
Regards
HJR
> ----------------------------------------------------------------------
![]() |
![]() |