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: Instance Recovery Question

Re: Instance Recovery Question

From: Roger Snowden <snowden_at_NOT.com>
Date: Sun, 06 Dec 1998 18:09:20 GMT
Message-ID: <366AC77B.9F74AC8F@NOT.com>


Alan-

Why does conclusion #2 seem so unlikely? It happens to be the correct answer.

There is always great confusion regarding rollback, redo and block updates. Whenever a block is changes, rollback is created and redo is also created. Moreover, both the data block change and the redo block change are written to the redo buffer.

Whenever dbwr wants to flush the blocks to disk, or when a commit occurs, a checkpoint is invoked which ensures that the redo is physically written to disk before the data and rollback blocks get to disk. This is what makes crash (instance) recovery possible.

The scenario you described - having data / rollback on disk without the redo being physically written - can not occur with Oracle. And, raw devices make this even safer, since they permit Oracle to bypass the operating system file buffering and minimize the effects of hardware failures.

Further, to contradict one of the responders to this thread, the data blocks are indeed changed before a commit occurs. That's why we have the transaction layer inside the data blocks and why we maintain the transaction table in the rollback segment headers. You can check this out by starting several sessions and updating some row in a table. Don't commit, but do a checkpoint... 'alter system checkpoint;' I think... then dump out the data blocks. Get a before-checkpoint dump and then after-checkpoint and then after-commit.

You will see the data in the block, plus the itl stuff at the top of the block that describes the transaction table entry and the record within the block that is referenced. This takes some thinking, research and a little finger work, but for those who are interested in the guts of the product, this is the best way to learn. You will own the knowledge and the next time someone tells you otherwise, you can confidently say "Redo this!".

Have fun stormin' the castle!

Roger Snowden
Senior Systems Engineering Specialist
Oracle Corporation
NOTrsnowden_at_NOTus.oracle.com <- remove obvious to reply

AJG wrote:
>
> Hi,
>
> I was training a new DBA on how Oracle handles recovery from instance
> failure (i.e., roll forward, roll back), and I came across this unusual
> little scenario that I am unclear on:
>
> A change is made to a data block
> That change is recorded in a rollback block
> Change also recorded in log buffer
> DBWR writes data block to disk
> Instance crashes
> - Change in log buffer not written to disk yet
> - Rollback information not written to disk yet
> This is a problem
>
> Two Solutions:
> 1) Oracle always writes out the rollback block before the changed data
> block.
> 2) Oracle always waits to flush a change in log buffer to disk before
> writting the changed block (data or rollback)
>
> 2 sounds unlikely to me, so I'm going with 1.
>
> I'm I correct?
>
> Thanks!
>
> Alan.
>
> --
> Alan Gano
> http://home.att.net/~alangano/index.html
Received on Sun Dec 06 1998 - 12:09:20 CST

Original text of this message

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