Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.server -> Re: cbc latch assignment on db_cache resize

Re: cbc latch assignment on db_cache resize

From: Jonathan Lewis <>
Date: Thu, 18 Jul 2002 12:47:52 +0100
Message-ID: <>

Just did a couple more experiments -
the first hypothesis is wrong.

I added a 2k cache sized at 4M in a
96MB limit, and saw 512 latches jump
to 1024 latches -- a reasonable response according to my theory.

But my test with 512MB is not repeatable. (I have to say I was a bit surprised to see 1536 as I was expecting a 1024 or 2048,
not halfway in between).

However the nail in the coffin was:
512MB sga_size
Start at 4M for a 2K cache.
1024 latches allocated on startup.

Increase the 2K cache dynamically
to 320MB - no change in latch count.

Restart the system with 320MB of 2k cache, 2049 latches allocated on startup (as expected using Steve Adams' formula for latch count).


Jonathan Lewis

Next Seminars
 UK  July / Sept
 Australia August
 Malaysia September
 USA (MI) November

Jonathan Lewis wrote in message

>After your first email, I did a couple of quick tests
>on an NT 9.2.
>I happen to have an 8K database with 4K blocks
>Starting with
> sga_max_size = 256Mb
> db_cache_size = 8M
> db_4K_cache-size = 8M
>I see 1024 cbc latches.
>If I restart the database, but change the
>sga_max_size to 512MB, I get 1536 cbc
>So I was going to test the theory that the
>number of cbc latches is determined by
>largest number of buffers you could demand
>given the smallest block size with a defined
>BTW - the number of latches in 9.2 seems
>to revolve around significant powers to 2.
>I think you are thinking of the number of
>hash buckets when you say 'prime number
>close to twice the buffers'.
>Jonathan Lewis
>Next Seminars
>UK July / Sept
>Australia August
>Malaysia September
>USA (MI) November
>Andrew Mobbs wrote in message ...
>>Having now had a chance to play with this, it appears that, at least,
>>the values for _db_block_hash_latches and _db_block_hash_buckets in
>>x$ksppcv stay constant when db_cache_size changes.
>>This, unfortunately for me, means that shrinking the SGA shouldn't make
>>cache buffers chains contention worse. However, should we then be wary
>>of starting with a small SGA and dynamically growing it to something
>>quite large?
>>Interestingly, 9iR2 (at least, maybe 9.0.1 too), _db_block_hash_latches
>>has gone back to being prime but now is a prime "near" (not sure exactly
>>how it's chosen) twice the number of block buffers.
>>Andrew Mobbs -
Received on Thu Jul 18 2002 - 06:47:52 CDT

Original text of this message