Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Buffer busy wait clarification
"Chintu" <agarwalp_at_eeism.com> wrote in message
news:1143111766.779488.314280_at_z34g2000cwc.googlegroups.com...
> Thanks to all, but I still have some doubts
>
>>>A process that wants to insert a row reads the
>>>pointer and locates the block identified by the
>>>pointer, and tries to insert the row in that block.
>
> IS this block in the buffer cache or in the datafile currently? I
> assume in the buffer cache.
>
Which block do you mean by 'this block'. If you mean the segment header block, it has to be in the buffer to be examined. If you mean the block that is first in the freelist, then it may be on disc, and would then have to be read into the buffer.
> My understanding is whenever you are inserting in a table, a block
> pertaing to that segemnt is read, If it finds space in that block that
> use it. It updates the buffered segment header with the freelist info.
>
> 1. Is my understanding right?
Not quite. If the block that has been used still has more usable space, there is no need to update the segment header in anyway. The used block stays as the first on the freelist.
> 2. What happens if the block does not have enough space for the new
> insert. Where does it get the space from for sucessful insert in the
> BUFFER CACHE ???
>
If the block does not have enough space (and usually it does, because that's why it is on the freelist at all), then the process may update the segment header to remove that block from the top of the list and replace - which means replaces the pointer with a new value that points to the next block in the freelist. (The next block would previously be pointed to by a pointer in the block that has just been discarded as full).
> Thanks
> Chintu
>
-- Regards Jonathan Lewis http://www.oracle.com/technology/community/oracle_ace/ace1.html#lewis The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html Cost Based Oracle: Fundamentals http://www.jlcomp.demon.co.uk/cbo_book/ind_book.htmlReceived on Thu Mar 23 2006 - 05:51:35 CST