Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: database buffer cache / SGA

Re: database buffer cache / SGA

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 20 Jul 2001 06:40:35 -0700
Message-ID: <9j9ccj0alr@drn.newsguy.com>

In article <3B580587.9937BBCC_at_att.net>, stevek says...
>
>Thanks Thomas
>
>So I was correct that if 1 block actually contains 8 rows, all 8 rows
>are read into memory. The system puts a general lock on the table and an
>exclusive lock on the block? If this is true and someone wants one of
>the rows that were read into buffer cache, does the system wait for the
>first transaction to be finished before it can get this additional row?
>

no, you must be thinking of other databases ;)

you want to read:

http://technet.oracle.com/doc/oracle8i_816/server.816/a76965/toc.htm

from cover to cover and specifically for this:

http://technet.oracle.com/doc/oracle8i_816/server.816/a76965/c23cnsis.htm#2841

Oracle does row level locking, we do not lock at the page/block.

>As to your statement that only bytes are recorded as changed, could you
>explain how that works or point me to a text that would do so.
>

well, i said "only bytes that are changed are recorded" which is different then what you say above...

umm, redo has the bytes to REDO -- if you update ename and change it from X to Y, redo will have Y in it. rollback will have X in it. Additional information telling us where to reapply these changed bytes is there as well.

>Thanks for your help.
>
>
>Thomas Kyte wrote:
>>
>> In article <3B577825.1BB18144_at_att.net>, stevek says...
>> >
>> >Oracle server receives a request from a client, run sql through sqlarea
>> >in cache, if there runs,if not runs through plan process then executes,
>> >if data in buffer cache uses that data otherwise get block(s) from
>> >tablespace.
>> >
>> >Question: oracle deals with data in blocks only, block 8K, record 1K.
>> >Does oracle take 7 additional records on the block read? Does it use the
>> >same block size/number of records when it puts changed data in redo logs
>> >and rbs?
>>
>>data is cached in blocks, you get the block cached, even if you want just 1 of
>> the rows on that block.
>>
>> redo -- changed bytes (not even entire rows), unless the tablespace is in HOT
>>backup mode then the first time a block is modified the entire block is written
>> to redo and then changed bytes only after that.
>>
>> rollback -- changed bytes only.
>>
>> --
>> Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/
>> Expert one on one Oracle, programming techniques and solutions for Oracle.
>> http://www.amazon.com/exec/obidos/ASIN/1861004826/
>> Opinions are mine and do not necessarily reflect those of Oracle Corp

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Fri Jul 20 2001 - 08:40:35 CDT

Original text of this message

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