Understanding the buffer cache architecture

1st Question :
When we want to modify a single record in block ( which has multiple records), does the oracle process reads that particular record into the buffer cache or it will read the entire block into the buffer cache?
2nd Question : Metalink note 62172.1 says --- The cache may hold more than one copy of a block from different points in time . Can some one explain me why it is architected in this manner.
3rd Question : By increasing the pctfree , how can we over come the 'cache buffers chains' latch . How the less rows per block will reduce the contention to 'cache buffers chains' latch .
Thanks
Naveen
Edited by: Naveen Sangam on Jul 15, 2009 8:07 AM

Naveen Sangam wrote:
1st Question :
When we want to modify a single record in block ( which has multiple records), does the oracle process reads that particular record into the buffer cache or it will read the entire block into the buffer cache?It will be always a block by block access. That's why it is suggested that choose your block size properly so that you wont' waste the memory of the cache. Oh god, what did I just write :-) ?
>
2nd Question : Metalink note 62172.1 says --- The cache may hold more than one copy of a block from different points in time . Can some one explain me why it is architected in this manner.Yes, that's correct. This is the concept that makes Oracle, well Oracle. In Oracle. the isolation level is set to Read Committed which means, any dirty read wont' be allowed within oracle. So when you change a buffer and its still haven't got a commit, oracle would not let anyone else read the same buffer in its current state. This buffer's old image would be used by oracle to satisfy the read request of the user. For this, the concept of Multiversoning or Read Consitancy comes into the picture. For an dirty buffer, oralce prepares a Snapshot/Consistent Read(CR) buffer in the same hash bucket. This buffer is given to the user. That's why there can be more than one copy of the changed buffer be there in the cache , depending on the requests issued by the users.
3rd Question : By increasing the pctfree , how can we over come the 'cache buffers chains' latch . How the less rows per block will reduce the contention to 'cache buffers chains' latch .I am not sure how did you make up this link? The only thing that ML note is saying that there should be less number of rows within a block so that a single block doesn't become a "hot spot" . The less number of rows, the less contention would be there over it. How did you link up this with the CBC Chain lathc?
HTH
Aman....

Similar Messages

  • 10G NEW FEATURE-HOW TO FLUSH THE BUFFER CACHE

    제품 : ORACLE SERVER
    작성날짜 : 2004-05-25
    10G NEW FEATURE-HOW TO FLUSH THE BUFFER CACHE
    ===============================================
    PURPOSE
    이 자료는 Oracle 10g new feature 로 manual 하게
    buffer cache 를 flush 할 수 있는 기능에 대하여 알아보도록 한다.
    Explanation
    Oracle 10g 에서 new feature 로 소개된 내용으로 SGA 내 buffer cache 의
    모든 data 를 command 수행으로 clear 할 수 있다.
    이 작업을 위해서는 "alter system" privileges 가 있어야 한다.
    Buffer cache flush 를 위한 command 는 다음과 같다.
    주의) 이 작업은 database performance 에 영향을 줄 수 있으므로 주의하여 사용하여야 한다.
    SQL > alter system flush buffer_cache;
    Example
    x$bh 를 query 하여 buffer cache 내 존재하는 정보를 확인한다.
    x$bh view 는 buffer cache headers 정보를 확인할 수 있는 view 이다.
    우선 test 로 table 을 생성하고 insert 를 수행하고
    x$bh 에서 barfil column(Relative file number of block) 과 file# 를 조회한다.
    1) Test table 생성
    SQL> Create table Test_buffer (a number)
    2 tablespace USERS;
    Table created.
    2) Test table 에 insert
    SQL> begin
    2 for i in 1..1000
    3 loop
    4 insert into test_buffer values (i);
    5 end loop;
    6 commit;
    7 end;
    8 /
    PL/SQL procedure successfully completed.
    3) Object_id 확인
    SQL> select OBJECT_id from dba_objects
    2 where object_name='TEST_BUFFER';
    OBJECT_ID
    42817
    4) x$bh 에서 buffer cache 내에 올라와 있는 DBARFIL(file number of block) 를 조회한다.
    SQL> select ts#,file#,dbarfil,dbablk,class,state,mode_held,obj
    2 from x$bh where obj= 42817;
    TS# FILE# DBARFIL DBABLK CLASS STATE MODE_HELD J
    9 23 23 1297 8 1 0 7
    9 23 23 1298 9 1 0 7
    9 23 23 1299 4 1 0 7
    9 23 23 1300 1 1 0 7
    9 23 23 1301 1 1 0 7
    9 23 23 1302 1 1 0 7
    9 23 23 1303 1 1 0 7
    9 23 23 1304 1 1 0 7
    8 rows selected.
    5) 다음과 같이 buffer cache 를 flush 하고 위 query 를 재수행한다.
    SQL > alter system flush buffer_cache ;
    SQL> select ts#,file#,dbarfil,dbablk,class,state,mode_held,obj
    2 from x$bh where obj= 42817;
    6) x$bh 에서 state column 이 0 인지 확인한다.
    0 은 free buffer 를 의미한다. flush 이후에 state 가 0 인지 확인함으로써
    flushing 이 command 를 통해 manual 하게 수행되었음을 확인할 수 있다.
    Reference Documents
    <NOTE. 251326.1>

    I am also having the same issue. Can this be addressed or does BEA provide 'almost'
    working code for the bargin price of $80k/cpu?
    "Prashanth " <[email protected]> wrote:
    >
    Hi ALL,
    I am using wl:cache tag for caching purpose. My reqmnt is such that I
    have to
    flush the cache based on user activity.
    I have tried all the combinations, but could not achieve the desired
    result.
    Can somebody guide me on how can we flush the cache??
    TIA, Prashanth Bhat.

  • " unable to allocate space from the buffer cache" Message

    Hi
    I am trying to delete a large volume or records from a BTREE database. I have used the DB_SET_RANGE with a cursor to locate the desired records. After that the Dbc::get() with DB_NEXT is called. After deleting a considerable amount of records I am receiving a message in the error callback function as "unable to allocate space from the buffer cache".
    What might be the reason for such a message.
    Regards
    Nisam

    Nisam,
    This means that the cache is full and there are no pages that BDB can evict to make space. Are you running with the default cache size? You can increase the cache size by calling: dbenv->set_cachesize or db->set_cachesize.
    Related docs:
    Selecting a cache size: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am_conf/cachesize.html
    Bogdan Coman

  • Unused tables in the buffer cache

    I have a program that queries the V$BH view every hour and stores the name of every table in the buffer cache. There is a set of tables that are never used which are appearing in the buffer cache every hour. I did a case insensitive search of the V$SQL and V$SQLTEXT views for these table names, but found nothing. How can tables be put in the buffer cache if there is no SQL statement refering to them? I'd like to find the session and program which is using these tables that no one is supposed to be using.
    Kevin Tyson

    This can be due to recursive SQL. Means the SQL not fired directly by the app but fired by oracle to satistfy some requirment. It can be related to some system tables or other users tables.
    Example of system tables:
    Oracle use system tables to reflect the current state of the database like when you insert records it update the extent information and when you create the object it update the data dictionary so that object reflect in that etc etc etc
    Example of users tables:
    you fired an insert statement to insert one record in table emp but to insert that record oracle has to check the state of foreign key data by querying dept and other tables so enev if you didn't specify dept table oracle use it internally to check the integrity constraint.
    Daljit Singh

  • Pinning blocks to the Buffer Cache

    Does any one remember how you can pin data buffers to the buffer cache so they don't get cycled out ? The shared pool has dbms_shared_pool.KEEP for library caches. I thought there was something like this for the buffer cache as well ? Can't find it.
    thx,
    RP.

    Does any one remember how you can pin data buffers to the buffer cache so they don't get cycled out ? The shared pool has dbms_shared_pool.KEEP for library caches. I thought there was something like this for the buffer cache as well ? Can't find it.
    thx,
    RP. Use ALTER TABLE <table_name> CACHE;
    and that will cache the table in the buffer pool. Or in the future (or if you recreate the table as CREATE TABLE . . . AS SELECT) the CACHE argument can be added to the CREATE TABLE statement;

  • How to tune effectively to the buffer cache hit ratio?

    We have a database with following sga sizes;
    shared pool : 256 MB
    Buffer Cache: 880 MB
    Large pool: 32 MB
    Java pool: 32 MB
    Total SGA: 1201.435 mb. From the health check, i found Buffer Cache Hit Ratio is giving the trouble. so, i need advice from dba gurus, should Buffer Cache Hit ratio be increase or decreasee, in order to improve the performance?
    Please help me
    Ateeq

    I will generate statspack tommorrow morning when there will be lot of activity on the database. In the meantime, some output from Health check toad are:
    ->!Buffer Cache Hit Ratio : 82.3246
    -->[Segments with > 100 extents] Exec Time 1 seconds
    ! TABLE IN_CHIYODA.SPEC_REVISION_DOCUMENT_MAIN: 107 Extents
    ! TABLE EF2_DATA.N3RGRPRGRP: 126 Extents
    ! TABLE EF2_DATA.N3OBJATTR: 192 Extents
    ! TABLE EF2_DATA.EFT_UID: 119 Extents
    ! TABLE EF2_DATA.N2FILEOBJ: 121 Extents
    ! TABLE EF2_DATA.N2IFOBJ: 211 Extents
    ! TABLE EF2_DATA.N2REVGRP: 128 Extents
    ! INDEX EF2_DATA.N3OBJATTR_RLTLEFTRELINDEX: 122 Extents
    ! INDEX EF2_DATA.N3OBJATTR_RLTRIGHTRELINDEX: 114 Extents
    ! INDEX EF2_DATA.PK_N3OBJATTR: 119 Extents
    ! INDEX EF2_DATA.EFI_UID_N1UID: 120 Extents
    ! INDEX EF2_DATA.EFI_UID_N1OBJOBID: 103 Extents
    ! INDEX EF2_DATA.N1BOBJOBID_N2IFOBJ: 186 Extents
    ! INDEX EF2_DATA.N2IFOBJ_N1BOBJOBID: 159 Extents
    ! INDEX EF2_DATA.N2IFOBJ_N1NAME: 115 Extents
    ! INDEX EF2_DATA.PK_N2IFOBJ: 158 Extents
    ! INDEX EF2_DATA.N2IFOBJ_MYINDEX: 187 Extents
    Can you advice anthing based on these results.
    Thanks

  • Need help understanding the local caching of jnlp when creating it via jsp

    I'm trying to deploy an app via Web Start. I have occasions when I need to pass arguments, so I'm using JSP to create the JNLP and optionally write arguments.
    I need some help in figuring out how to cover my different use cases with as few different jnlps as possible and am confused about the local cacheing logic.
    Use 1
    Initial install: I pass an init=yes url param which writes a preferences file <argument> to be passed to my app. I don't want this argument cached in my jnlp, as this will overwrite the user's preferences on subsequent launches.
    Use 2
    Subsequent offline launches: no url params passed.
    Use 3
    Launch via html link (in a CMS): passes a file=<filename> url param which creates a file <argument> for my app to open. Again, I don't want this argument cached, otherwise launching from, say, the desktop shortcut will reopen this file.
    Can anyone explain how best to cover these three use cases?
    TIA!

    Did you solve this cache problem? I have a similar issue where I don't want it to use the arguments over again...

  • Trying to understand the basics of architecture

    Hi there, that's my first post here.
    I began working with Oracle SGBD, started using Oracle 11g, then I have installed it on a computer and created sucessufully an user/database, the question is: I don't understand clearly
    yet the difference between tablesapce, schema, instance , database/user (is an user a database and vice-versa) and other question is about view, trigger, procedure and profile?
    Could you help me on understanding both questions?
    André AS.

    user13002323 wrote:
    hmm, very good, liked it... thanks for sharing the reference EdStevens.Good, but you haven't had time to do more than scan the TOC. Go back and start reading
    >
    I have read some tips now that helped me out too, let me try saying the concepts I've got and being more specific on questioning:
    1 - When I created the user, it also meant I've created the database by creating the user, I wanted to say, on Oracle user and database are the same?
    Absolutely untrue. Sounds like you are trying to apply SQL Server concepts to Oracle. The very term 'database' means different concepts between the two products.
    In oracle, the 'database' is the all-encompassing structure. EVERYTHING else exists inside the database - including users. Go back and
    2 - The Oracle's instance is a scope where someone could find the schemas that hierarchically are the databases linked to a tablespace (directory to record data)?The instance is the memory space and processes that operate the database.
    >
    3 - Every user/database I generate will use some profile? Every user you created will have a profile. Creating a user is NOT the same as creating a database.
    >
    4 - What's the difference between procedure, trigger and view?
    What is the difference between a car, a truck, and a duck?
    A procedure is a named and stored set of sql and plsql statements, that can be executed on-demand by referencing the name of the procedure.
    A trigger is a special kind of procedure, that executes when a defined event occurs.
    A view is a pre-defined and name query that can be SELECTed as if it were a table.
    hope that's clearer.
    Please spend some time actually reading the Concepts Guide, and specifically looking for the answers to your questions. We don't mind answering questions -- that's why we're here -- but we expect you to do some reading and thinking on your own.
    =================================================
    Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
    Go to tahiti.oracle.com.
    Drill down to your product and version.
    <b><i><u>BOOKMARK THAT LOCATION</u></i></b>
    Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab you will find the complete documentation library.
    Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
    Do the same with the SQL Reference Manual.
    Do the same with the Utilities manual.
    You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
    Then set yourself a plan to dig deeper.
    - Read a chapter a day from the Concepts Manual.
    - Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
    - Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
    - When you have finished reading the Concepts Manual, do it again.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    =================================
    Edited by: user13002323 on 10/01/2013 05:02

  • Will Oracle look into the database buffer cache in this scenario?

    hi guys,
    say I have a table with a million rows, there are no indexes on it, and I did a
    select * from t where t.id=522,000.
    About 5 minutes later (while that particular (call it blockA) block is still in the database buffer cache) I do a
    select * from t where t.id >400,000 and t.id < 600,000
    Would Oracle still pick blockA up from the database buffer cache? if so, how? How would it know that that block is part of our query?
    thanks

    Without an Index, Oracle would have done a FullTableScan on the first query. The blocks would be very quickly aged out of the buffer cache as they have been retrieved for an FTS on a large table. It is unlikely that block 'A' would be in the buffer_cache after 5minutes.
    However, assuming that block 'A' is still in the buffer_cache, how does Oracle know that records for the second query are in block 'A' ? It doesn't. Oracle will attempt another FullTableScan for the second query -- even if, as in the first query -- the resultset returned is only 1 row.
    Now, if the table were indexed and rows were being retrieved via the Index, Oracle would use the ROWID to get the "DBA" (DataBlockAddress) and get the hash value of that DBA to identify the 'cache buffers chain' where the block is likely to be found. Oracle will make a read request if the block is not present in the expected location.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • How to clear file cache (or buffer cache?) in the system

    i found that after copying a large file, say >200M the system's memory drop 200M exactly until i delete the file. it is suspected that the memory is used for file cache.
    After installing memtool, the prtmem command shows the following:
    Total memory: 983 Megabytes
    Kernel Memory: 106 Megabytes
    Application: 193 Megabytes
    Executable & libs: 40 Megabytes
    File Cache: 495 Megabytes
    Free, file cache: 60 Megabytes
    Free, free: 87 Megabytes
    It shows that nearly 500M of system's memory is used for file cache.
    The temporary solution i use now is to copy a large file, say 300M, and delete that file.
    eg
    cp temp1.txt temp2.txt
    rm temp2.txtAnd then most of the file cache will be freed out.
    is there any way to release this file cache?
    I've checked the system use the default value for the bufhwm parameter. ie, about 20M. however, as i know, this bufhwm parameter is related to buffer cache. is it really related to file cache?

    To answer your question directly - delete the file or unmount the file system.
    To answer your question indirectly - You are worrying about the wrong thing here. Also the buffer cache is slightly different the file system page cache. The file system page cache is behaving exactly as it should as is the virtual memory subsystem. When a system is operating for some period of time, the amount of free memory will always drop towards LOTSFREE and, if allowed, stay right above LOTSFREE - forever - if the work behavior of the machine stays about the same. This is usually because of the file system page cache.
    Its nothing to worry about. Actually you want that to happen. Otherwise your disks would be getting the crap kicked out of them all the time.

  • Buffer cache hit ration found 99.7%,still the app users complains.

    Here in my database,i querey the v$sysstat and found the buffer cache hit ration 99.7% ,by looking that hit ration there is room improvements.
    what are the other things which can examine here ?
    hare krishna
    Alok

    As others have said, buffer cache hit ratio is only one of the measurements - and it is often improperly applied, making it worse than useless.
    Since this is in production,. it's too late to do anything about the design. So we skip that very important step and go to the SQL statements ...
    What are the users complaining about, in detail? Is it the system, or is it a specific operation? Use that knowledge to attempt to define a single SQL statement or a small set of SQL statements, and then start tuning those.
    The other possibility, seen A LOT these days, is that the app was written in Visual Basic, .Net or Java and uses the "build the statement on the fly and execute immediate" method. In that case, your server is probably sitting at very high CPU useage and your shared pool is used very inefficiently. Use the V$PGA_TARGET_ADVICE and V$SHARED_POOL_ADVICE views (described in the Administrator's manual and the Performance Tuning manual) to adjust these memory segments properly. All youi can do is alleviate the result of bad development.
    And finally, you may simply have gone into swapping or paging, the evil that occurs when you attempt to a) put multiple instances on a server, or b) put the instance and the application background tasks on the same server, or c) do not use PGA_AGGREGATE_TARGET properly.

  • Unexpected CR copies in buffer cache

    Hello,
    While trying to understand the mechanisms of the Oracle buffer cache I ran a small experiment and observed an unexpected outcome. I believe that my expectation was wrong and I would therefore appreciate, if someone could explain me what I misunderstood.
    From what I understood, a consistent read (CR) copy of a buffer in the cache is created, when the old content of a buffer is to be read, e.g. in order to ignore the changes made by a yet uncommitted transaction when querying a table. I also thought, that CR copies in the buffer cache may be reused by subsequent queries that need a rolled back image of the corresponding block.
    Now I ran the following experiment on an otherwise idle 10.2 DB.
    1. I create a table BC_TEST (in a non-ASSM tablespace)
    -> V$BH shows one buffer A with status XCUR for this table - V$BH.CLASS# is 4, which indicates a segment header according to various sources on the internet.
    2. Session 1 inserts a row in the table (and doesn't commit)
    -> Now V$BH shows 8 buffers with status XCUR belongig to table BC_TEST. I believe this is the blocks from an extent being allocated to the table (I would have expected only one data block to be loaded into the cache in addition to the header that was already there from step 1). There is still the buffer A with CLASS# = 4 from step 1, one buffer B with status XCUR and CLASS# = 1, which indicates a data block according to various sources on the internet, and 6 additional blocks with status FREE and CLASS# = 14 (this value is decoded differently in various internet sources).
    3. Session 2 issues a "select * from bc_test"
    -> V$BH shows 2 additional buffers with status CR and the identical FILE#/BLOCK# as buffer B from step 2. I understand that one consistent read copy needs to be done in order to revert the uncommitted changes from step 2 - I don't however understand why *2* such copies are created.
    Note: With a small variation of the experiment, if I run "select * from bc_test" in Session 2 between step 1 and 2, then I will subsequently only get 1 CR copy in step 3 (as I would expect).
    4. Session 2 issues "select * from bc_test" again
    -> V$BH shows yet another additional buffer with status CR and the identical FILE#/BLOCK# as buffer B from step 2 (i.e. 3 such buffers in total). Here I don't understand, why the query can't reuse the CR copy already created in step 3 (which already shows buffer B without the changes from the uncommitted transaction in step 2).
    5. Session 2 repeatedly issues "select * from bc_test" again
    -> The number of buffers with status CR and the identical FILE#/BLOCK# as buffer B from step 2 increases by one with each dditional query up to a total number of 5. After that the number of those buffers remains constant after the further queries. However various statistics for session 2 ('consistent gets', 'CR blocks created', 'consistent changes' ,'data blocks consistent reads - undo records applied' ,'no work - consistent read gets') suggest, that session 2 continues to generate current read copies with every "select * from bc_test" (are the buffers in the buffer cache maybe just reused from that point on?).
    To summarize I have the following question:
    (I) Why does the insert of a single row (in step 2) load 8 blocks into the buffer cache - and what does the CLASS# = 14 indicate?
    (II) Why does the first select on the table (step 3) create 2 CR copies of the (single used) data block of the table (rather than one as I would expect)?
    (III)) Why do further queries create CR copies of that single data block (rather than reusing the CR copy created by the first select statement)?
    (IV) What limits the number of created CR copies to 5 (is there some parameter controlling this value, is it depending on some cache sizing or is it simply hardcoded)?
    (V) What exactly triggers the creation of a CR copy of a buffer in the buffer cache?
    Thanks a lot for any reply
    kind regards
    Martin
    P.S. Please find below the protocol of my experiment
    Control Session
    SQL> drop table bc_test;
    Table dropped.
    SQL> create table bc_test (col number(9)) tablespace local01;
    Table created.
    SQL> SELECT bh.file#, bh.block#, bh.class#, bh.status, bh.dirty, bh.temp, bh.ping, bh.stale, bh.direct, bh.new
    2 FROM V$BH bh
    3 ,dba_objects o
    4 WHERE bh.OBJD = o.data_object_id
    5 and o.object_name = 'BC_TEST'
    6 order by bh.block#;
    FILE# BLOCK#     CLASS# STATUS D T P S D N
         5     209     4 xcur     Y N N N N N
    Session 1
    SQL> insert into bc_test values (1);
    1 row created.
    Control Session
    SQL> /
    FILE# BLOCK#     CLASS# STATUS D T P S D N
         5     209     4 xcur     Y N N N N N
         5     210     1 xcur     Y N N N N N
         5     211     14 free     N N N N N N
         5     212     14 free     N N N N N N
         5     213     14 free     N N N N N N
         5     214     14 free     N N N N N N
         5     215     14 free     N N N N N N
         5     216     14 free     N N N N N N
    8 rows selected.
    Session 2
    SQL> select * from bc_test;
    no rows selected
    Statistics
         28 recursive calls
         0 db block gets
         13 consistent gets
         0 physical reads
         172 redo size
         272 bytes sent via SQL*Net to client
         374 bytes received via SQL*Net from client
         1 SQL*Net roundtrips to/from client
         0 sorts (memory)
         0 sorts (disk)
         0 rows processed
    Control Session
    SQL> /
    FILE# BLOCK#     CLASS# STATUS D T P S D N
         5     209     4 xcur     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 xcur     N N N N N N
         5     211     14 free     N N N N N N
         5     212     14 free     N N N N N N
         5     213     14 free     N N N N N N
         5     214     14 free     N N N N N N
    8 rows selected.
    Session 2
    SQL> /
    no rows selected
    Statistics
         0 recursive calls
         0 db block gets
         5 consistent gets
         0 physical reads
         108 redo size
         272 bytes sent via SQL*Net to client
         374 bytes received via SQL*Net from client
         1 SQL*Net roundtrips to/from client
         0 sorts (memory)
         0 sorts (disk)
         0 rows processed
    SQL>
    Control Session
    SQL> /
    FILE# BLOCK#     CLASS# STATUS D T P S D N
         5     209     4 xcur     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 xcur     Y N N N N N
         5     211     14 free     N N N N N N
         5     213     14 free     N N N N N N
         5     214     14 free     N N N N N N
    8 rows selected.
    SQL>
    Session 2
    SQL> select * from bc_test;
    no rows selected
    Statistics
         0 recursive calls
         0 db block gets
         5 consistent gets
         0 physical reads
         108 redo size
         272 bytes sent via SQL*Net to client
         374 bytes received via SQL*Net from client
         1 SQL*Net roundtrips to/from client
         0 sorts (memory)
         0 sorts (disk)
         0 rows processed
    SQL>
    Control Session
    SQL> /
    FILE# BLOCK#     CLASS# STATUS D T P S D N
         5     209     4 xcur     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 xcur     Y N N N N N
         5     211     14 free     N N N N N N
         5     213     14 free     N N N N N N
    8 rows selected.
    Session 2
    SQL> select * from bc_test;
    no rows selected
    Statistics
         0 recursive calls
         0 db block gets
         5 consistent gets
         0 physical reads
         108 redo size
         272 bytes sent via SQL*Net to client
         374 bytes received via SQL*Net from client
         1 SQL*Net roundtrips to/from client
         0 sorts (memory)
         0 sorts (disk)
         0 rows processed
    Control Session
    SQL> /
    FILE# BLOCK#     CLASS# STATUS D T P S D N
         5     209     4 xcur     N N N N N N
         5     210     1 xcur     Y N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     211     14 free     N N N N N N
         5     213     14 free     N N N N N N
    9 rows selected.
    Session 2
    SQL> select * from bc_test;
    no rows selected
    Statistics
         0 recursive calls
         0 db block gets
         5 consistent gets
         0 physical reads
         108 redo size
         272 bytes sent via SQL*Net to client
         374 bytes received via SQL*Net from client
         1 SQL*Net roundtrips to/from client
         0 sorts (memory)
         0 sorts (disk)
         0 rows processed
    SQL>
    Control Session
    SQL> /
    FILE# BLOCK#     CLASS# STATUS D T P S D N
         5     209     4 xcur     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 xcur     Y N N N N N
    7 rows selected.
    Session 2
    SQL> /
    no rows selected
    Statistics
         0 recursive calls
         0 db block gets
         5 consistent gets
         0 physical reads
         108 redo size
         272 bytes sent via SQL*Net to client
         374 bytes received via SQL*Net from client
         1 SQL*Net roundtrips to/from client
         0 sorts (memory)
         0 sorts (disk)
         0 rows processed
    SQL>
    Control Session
    SQL> /
    FILE# BLOCK#     CLASS# STATUS D T P S D N
         5     209     4 xcur     N N N N N N
         5     210     1 xcur     Y N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
         5     210     1 cr     N N N N N N
    7 rows selected.

    hi,
    To make your code/query results more readable, please enclose it in tag.
    I also thought, that CR copies in the buffer cache may be reused by subsequent queries that need a rolled back image of the >corresponding block.I don't think there is any CR copy in cache. Every time a new query reads a consistent image of data, it will read rollback blocks from the buffer cache to generate a consistent image, so there is not any CR copy which could be reused. For testing this, with every "select * from BC_TEST" from second session, every time you will see a new CR in v$bh
    There is quite difficult to comment on the topics about merely an iota of resources available on internet.
    (I) Why does the insert of a single row (in step 2) load 8 blocks into the buffer cache - and what does the CLASS# = 14 indicate?Difficult go say about class#14 as you know there is not official documentation available.
    To insert a row in a block, oracle is picking up the blocks which are free for dta insertion. How and hoe many blocks to pick up, don't know as nothing about this is documented.
    (II) Why does the first select on the table (step 3) create 2 CR copies of the (single used) data block of the table (rather than one as I would expect)?Quite difficult to answer, some person like tom Kyte can answer on this i think. First time there are 2 Cr but later only one CR per select statement.
    (III)) Why do further queries create CR copies of that single data block (rather than reusing the CR copy created by the first select statement)?Because at a given point in time, a single block may have many versions available in the cache (one session update one row, creating a version of block. Other session inserting a row in the same block, creating another version). At every read, oracle is required to create the latest read consistent image for the session wanting to access the block.
    (IV) What limits the number of created CR copies to 5 (is there some parameter controlling this value, is it depending on some cache sizing or is it simply hard coded)?
    As far as i know, no parameter is for this and this is oracle internal architecture which is undocumented.
    (V) What exactly triggers the creation of a CR copy of a buffer in the buffer cache?As you know that when a session changes a data block (by performing DML on any single or multiple rows), the old image of block is sent to the rollback blocks in the buffer cache and data is modified in the actual block in cache. Another session wants to access the data from the same block but this session should not see the data which has not been committed by the first session so oracle needs to build an image of this datablock for session 2 with its original shape with only the committed data.
    If this session 2 will also modify some rows in the block, there is another version of this block in the cache and for session 3, there is required to be another read consistent image to be built.
    Salman                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Database Buffer Cache Contents

    Hello everyone,
    I have a doubt that I could not find any anwer over the metalink.
    I'm running 10.2.0.1.0 on a Windows2003EE using VLM (PAE). I've allocated to DB_CACHE_BUFFER about 7GB.
    My questions is:
    DO I need to do something to fill up that area of the most recent used data ?
    Can I see tha data blocks or something that indicates which data are placed in there ? to see if its entire filled up of data.
    Also, when using PAE you cannot use multiple buffers, as RECYCLE or KEEP. Can I place a table in momery on the default buffer using this feature ?
    Tks for any help, tips or links.

    No sure that I understand the questions first of all.
    1) thereis no parameter called db_cache_buffer.It is db_cache_size.
    2)
    DO I need to do something to fill up that area of the most recent used data ?
    Well yes and no.Yes coz you need to just select the data with a proper conditon so that oracle can cache and than keep the cached data for some time until unless LRU doesnt kick in.
    No coz this whole caching stuff is automatic.Select the data and than assume it will be there provided you are not using full table scans or some thing like that.
    3)
    Can I see tha data blocks or something that indicates which data are placed in there ? to see if its entire filled up of data.
    You want to see the conents of the buffer cache is it?What for?What is the need of doing that?Secondly I havent come across anything that can show you that with a straight forward way.There are ways but not recommended and not useful for day to day to use.
    About PAE,I dnt have idea.
    Aman....

  • JNI interface - error creating buffer caches 1GB

    Hi,
    I seem to be having a problem creating environments with a buffer cache of larger than 1GB. I get the following error, or similar:
    (BDB v 4.3.29)
    MapViewOfFile: Not enough space
    PANIC: Not enough space
    PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
    (and on BDB v 4.7.25)
    MapViewOfFile: Not enough storage is available to process this command.
    PANIC: Not enough space
    PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
    unable to join the environment
    I definitely have enough storage space available on the hard drive. This occurs whether I set the size of the buffer cache in code, or in the DB_CONFIG file. I have had the problem on both Linux and Windows and with BDB 4.3.29 and 4.7.25. I have also tried splitting the buffer cache into multiple files, this doesn't help, although in some situations I get a floating point error originating from inside the JNI library (I can provide more info on this if necessary).
    Any suggestions? Is there a hard limit of 1GB that I've missed for buffer caches created over the BDB JNI interface? I wrote a quick C program to test this out, and managed to get the buffer cache up to ~2.5GB before I hit similar errors.
    Thanks in advance for any advice.

    Hi,
    Thanks for the reply Sandra. Below is an example that causes this issue for me. As a quick aside, could this be an O/S / architecture limitation? I'm running a 32 bit O/S (XP SP2, Linux), could it be an issue with allocating that much addressable memory to a single process?
    Many thanks
    Code starts:
    package main;
    import java.io.File;
    import java.io.FileNotFoundException;
    import com.sleepycat.db.Database;
    import com.sleepycat.db.DatabaseConfig;
    import com.sleepycat.db.DatabaseException;
    import com.sleepycat.db.DatabaseType;
    import com.sleepycat.db.Environment;
    import com.sleepycat.db.EnvironmentConfig;
    public class TestBDB {
    public static void main(String[] args)
    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setInitializeCache(true);
    envConfig.setAllowCreate(true);
    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setType(DatabaseType.BTREE);
    dbConfig.setAllowCreate(true);
    Database db;
    Environment env;
    try
    env = new Environment(new File("D:\\test"), envConfig);
    db = env.openDatabase(null, "test.db", "test.db", dbConfig);
    if (db != null)
    db.close();
    if (env != null)
    env.close();
    catch(FileNotFoundException e) {
    e.printStackTrace();
    catch (DatabaseException e) {
    e.printStackTrace();
    }

  • Decument about buffer cache mechanism

    hi gurus
    I want some documentations about the buffer cache internal mechanism,for example the internal structure of the buffer cache,how does the buffer cache works and the LRU mechanism.The more detailed the better.
    I have searched on Oracle Documentation Linrary with buffer head or buffer descriptor as keywords.I did not get what i want.
    many thanks in advance.

    Hi Kevin,
    I believe information which you are looking is not published by Oracle and is avaialable only to Oracle Support and other employees. You can refer to Note:62172.1 for buffer cache mechanism. It mentioned about a note with "@" in beginning meaning the remark was supposed to be unpublished.
    "@ See Note 104937.1 for a description "
    May be the above note has got some description. Anyways I will suggest you to go through the Note:62172.1 and get basic understanding which should be sufficient for dba's.
    Cheers
    Amit

Maybe you are looking for

  • Can I make a calendar in iPhoto '09 using my Aperture 3.0 library?

    I've just doanloaded a trial of Aperture 3 and am generally very impressed. I decided I wanted to make a wall calendar, which is not supported but it says somewhere you can work from your Aperture library from within iPhoto. Is this only supported in

  • Backing file???

    Hi, Is their any place where i can found more detailed documentation of the "Backing File"? Specifically the significance of the methods of the Backing file. I know that the backing file is called before the JSP is called but in my case the method "i

  • Computation in between items in a region

    Hi, I have three items on a region Item 1 Item 2 item 3 10 20 30 As soon as i enter 10 in item1 and 20 in item2 then item3 needs to be pupulated with the total of it. Could any one guide me the processs of doing this. Please advice Kris

  • How to filter data in BIP Report fetched from Integration Object

    Hi, I have a requirement where I am extracting data of Account records of a Customer. Customer can have multiple types of Accounts. In BIP report, I want to different types of Customer Accounts in different tables. Is it possible? I tried but Conditi

  • Saml.audience.uri property

    Hi! I'm begin working with Oracle Fusion Middleware. I'm use Oracle Weblogic Server + Oracle Service Bus + Oracle Web Service Manager. I have a test web service with saml_token_service_policy. I'm trying call test service from Oracle Service Bus Test