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: AJG <noemail_at_noemail.noemail>
Date: 6 Dec 1998 19:41:23 GMT
Message-ID: <366ADB02.F5B5B44@noemail.noemail>


Thank you everyone,

I have some more clarifying questions in the text below, based on Roger's response.

Thanks!

Alan.

Roger Snowden wrote:

> 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.

Are you describing a third action which triggers a flush to of the log buffer to disk? (besides commit or 1/3 full)

When your saying "checkpoint" here, your not refering to the normal CHECKPOINT operation, but a mini-operation that ensures that changes to the block, which are still in the log buffer, are written out for the block which DBWR is about to write out?

>
>
> 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.

I had envisioned a scenario where, for some reason, the changed data block would be written out before the changes in the log buffer (newly changed block steps into path of occuring checkpoint, db_block_buffers really small and log_buffers really big, DBWR writing out dirty blocks because of free block requests, etc.).

But, to make your point again, DBWR checks up on the log_buffer to see if changes to a block are still in log buffer, and if so: flush log buffer, wait for that to finish, then write data block to disk.

Correct?

>
>
> 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

--
Alan Gano
http://home.att.net/~alangano/index.html Received on Sun Dec 06 1998 - 13:41:23 CST

Original text of this message

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