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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How much memory is consumed by cache tables?

RE: How much memory is consumed by cache tables?

From: Orr, Steve <sorr_at_rightnow.com>
Date: Mon, 25 Mar 2002 17:33:18 -0800
Message-ID: <F001.00432B4C.20020325173318@fatcity.com>


Hey Gaja. Good to hear from you!!

It appears small cached tables may occupy more than one buffer. Here's what I did.

  1. Got the file_id and block_id range from dba_extents: select file_id, block_id from dba_extents where owner=? and segment_name=? /
  2. Got the buffers from x$bh: select buf#,file#,dbablk from x$BH where file#=65 and dbablk between 325 and 348 /

      BUF# FILE# DBABLK
---------- ---------- ----------

     10212 65 346

It only returned one row so if I'm interpreting this correctly it must only be using one buffer (16K in my case).

3) To get a list of all the cached tables and the buffers which they occupy I did this:
select t.owner, t.table_name, b.buf#
from x$bh b, dba_extents e, dba_tables t

where   e.owner = t.owner 
and     e.segment_name = t.table_name 
and     e.file_id = b.file# 
and     b.dbablk between e.block_id and e.block_id + e.blocks - 1
and     t.cache = '    Y'

/

When I did this I found a few small cached tables that occupied more than one buffer. Even though the amount of data could easily fit into 16K it took more because the data was spread into multiple dba_extents.block_id's. Static tables that are cached only take up one buffer but the more dynamic cached tables often take more because their data gets spread around into multiple block_id's.

I wonder how O9i handles this? If a buffer corresponds to a block_id then what happens when you use tablespaces with a different db_block_size? The theory would be to put cache tables in tablespaces with a smaller block size.

"Curiouser and curiouser..."
Steve Orr

-----Original Message-----
Sent: Monday, March 25, 2002 3:44 PM
To: Multiple recipients of list ORACLE-L

Steve,

Just curious whether you have already looked at X$BH and V$CACHE? Do these two provide the information that you are looking for? If you find it, please post your findings, so that we all can benefit from it. If not, we just got to keep on looking....;-)

Cheers,

Gaja
--- "Orr, Steve" <sorr_at_rightnow.com> wrote:
> How much memory is consumed by cache tables? For
> example, if you have a
> small amount of data in a lookup table that's
> locally managed with 128K
> uniform extents, does it consume 128K of memory even
> if the data is only in
> one 8k DB block? (If that's the case then it would
> be better to assign it to
> a keep buffer pool.)
>
> Steve Orr
> --



Gaja Krishna Vaidyanatha
Director, Storage Management Products,
Quest Software, Inc.
Co-author - Oracle Performance Tuning 101 http://www.osborne.com/database_erp/0072131454/0072131454.shtml

Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Gaja Krishna Vaidyanatha
  INET: oraperfman_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Orr, Steve
  INET: sorr_at_rightnow.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Mon Mar 25 2002 - 19:33:18 CST

Original text of this message

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