Find free buffers in buffer cache

hi guys,
V$BH view contains the information about each block that is present in the buffer cache. can any one please tell me how to find the information about the free buffers??

Mark D Powell wrote:
select decode(state,0,'Free',
1,'Read and Modified',
2,'Read and Not Modified',
3,'Currently being Modified',
'Other'
) buffer_state,
count(*)  buffer_count
from    sys.xx_bh
group by decode(state,0,'Free',
1,'Read and Modified',
2,'Read and Not Modified',
3,'Currently being Modified',
'Other'
Provided the OP figures out that xx_bh is probably a view defined by sys on top of x$bh this will get him the number of free buffers - which may be what he wants - but apart from that your query is at least 10 years short of complete, and the decode() of state 3 is definitley wrong.
The decode of x$bh.state for 10g is:
     decode(state,
          0,'free',
          1,'xcur',
          2,'scur',
          3,'cr',
          4,'read',
          5,'mrec',
          6,'irec',
          7,'write',
          8,'pi',
          9,'memory',
          10,'mwrite',
          11,'donated'
     ), and for 11g it is:
     decode(state,
           0, 'free',
           1, 'xcur',
           2, 'scur',
           3, 'cr',
           4, 'read',
           5, 'mrec',
           6, 'irec',
           7, 'write',
           8, 'pi',
           9, 'memory',
          10, 'mwrite',
          11, 'donated',
          12, 'protected', 
          13, 'securefile',
          14, 'siop',
          15, 'recckpt',
          16, 'flashfree', 
          17, 'flashcur',
          18, 'flashna'
     ), (At least, that was the last time I looked - they may have changed again in 10.2.0.5 and 11.2.0.2)
Regards
Jonathan Lewis

Similar Messages

  • Find available space in buffer cache

    Hi.
    I want to find available space from buffer cache. First thought was to make it 8i-9i comp, by not using v$bh to calculate sum of memory and available space.
    I have the following pl/sql block to calculate the values:
    declare
    num_free_blck integer;
    num_all_blck integer;
    num_used_blck integer;
    overal_cache number := 0;
    used_cache number := 0;
    free_cache number := 0;
    blck_size integer;
    pct_free number := 0;
    begin
    select count(1) into num_free_blck from v$bh where status='free';
    select count(1) into num_all_blck from v$bh;
    select count(1) into num_used_blck from v$bh where status <> 'free';
    select value into blck_size from v$parameter where name ='db_block_size';
    used_cache := (blck_size * num_used_blck)/(1024*1024);
    free_cache := (blck_size * num_free_blck)/(1024*1024);
    overal_cache := (blck_size * num_all_blck)/(1024*1024);
    pct_free := ((free_cache/overal_cache)*100);
    dbms_output.put_line('There are '||num_free_blck||' free blocks in buffer cache');
    dbms_output.put_line('There are '||num_used_blck||' used block in buffer cache');
    dbms_output.put_line('There are totally '||num_all_blck||' blocks in buffer cache');
    dbms_output.put_line('Overall cache size is '||to_char(overal_cache,'999.9')|| 'mb');
    dbms_output.put_line('Used cache is '||to_char(used_cache,'999.9')||' mb');
    dbms_output.put_line('Free cache is '||to_char(free_cache,'999.9')||' mb');
    dbms_output.put_line('Percent free db_cache is '||to_char(pct_free,'99.9')||' %');
    end;
    The result of the execution is:
    SQL> @c:\temp\bh
    There are 3819 free blocks in buffer cache
    There are 4189 used block in buffer cache
    There are totally 8008 blocks in buffer cache
    Overall cache size is 62.6mb
    Used cache is 32.7 mb
    Free cache is 29.8 mb
    Percent free db_cache is 47.7 %
    PL/SQL-prosedyren ble fullført.
    SQL>
    This is not correct according to the actuall size of the buffer cache:
    SQL> select name,value from v$parameter where name='db_cache_size';
    NAME
    VALUE
    db_cache_size
    67108864
    SQL>
    Anyone that have an idea bout this?
    Thanks
    Kjell Ove

    Mark D Powell wrote:
    select decode(state,0,'Free',
    1,'Read and Modified',
    2,'Read and Not Modified',
    3,'Currently being Modified',
    'Other'
    ) buffer_state,
    count(*)  buffer_count
    from    sys.xx_bh
    group by decode(state,0,'Free',
    1,'Read and Modified',
    2,'Read and Not Modified',
    3,'Currently being Modified',
    'Other'
    Provided the OP figures out that xx_bh is probably a view defined by sys on top of x$bh this will get him the number of free buffers - which may be what he wants - but apart from that your query is at least 10 years short of complete, and the decode() of state 3 is definitley wrong.
    The decode of x$bh.state for 10g is:
         decode(state,
              0,'free',
              1,'xcur',
              2,'scur',
              3,'cr',
              4,'read',
              5,'mrec',
              6,'irec',
              7,'write',
              8,'pi',
              9,'memory',
              10,'mwrite',
              11,'donated'
         ), and for 11g it is:
         decode(state,
               0, 'free',
               1, 'xcur',
               2, 'scur',
               3, 'cr',
               4, 'read',
               5, 'mrec',
               6, 'irec',
               7, 'write',
               8, 'pi',
               9, 'memory',
              10, 'mwrite',
              11, 'donated',
              12, 'protected', 
              13, 'securefile',
              14, 'siop',
              15, 'recckpt',
              16, 'flashfree', 
              17, 'flashcur',
              18, 'flashna'
         ), (At least, that was the last time I looked - they may have changed again in 10.2.0.5 and 11.2.0.2)
    Regards
    Jonathan Lewis

  • Available blocks in buffer cache

    Hi.
    I need to find available blocks in buffer cache. I can not query x$bh as not sysdba user. Anyone that has an idea how to get this information. I tried query the v$bh view but I can not get it right.
    Anyone with a good idea?
    Rgds
    Kjell OVe

    No,
    When you have a 100m buffer cache, it means you can buffer 100m/8k blocks of your database in cache, and you don't need to read them from disk.
    When the cache gets full Oracle will use a modified Least Recently Used algorithm to determine which blocks can be flushed.
    If the block is unmodified (not dirty) it will simply be removed, if it is modified it will be written to disk.
    When you insert a record (you seem to be really obsessed by this)
    - Oracle will look for free space in the current segment.
    When it finds a block and it is not in cache, it will retrieve this in cache.
    - if there is no space, Oracle will allocate a new extent.
    It will retrieve blocks from the new extent in cache. Simply: each block in the cache has a RBA (relative block address). The RBA points to a block on disk.
    - When it can't allocate an extent, Oracle will try to extend the tablespace (actually the datafile)
    If this doesn't succeed Oracle will raise an error, and send the error number and error text to the client program.
    The failing statement will be rolled back automatically.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • No free buffers available in buffer pool default

    We encounter this error ORA00379 No free buffers available in buffer pool default with one of our online transaction system.
    Initially, the errors occur once every 30 sec, and became less frequent (about twice a day) after the buffers has been increased to the size of Oracle's default medium size database.
    Currently, the system is under testing and we have 4 staffs using the same userid to send transactions. Furthermore the size of each transaction is about 3-5mb. Will these issues actually caused Oracle to run out of free buffer spaces?
    Please advise.
    Thankyou,

    Kenny
    I think your are running your server as dedicated server. Make it multi-threaded server if it is applicable. It will use the resources more efficiently. Otherwise, you have to set your pool size, prespawn, etc to their maximums.
    Regards

  • Is dictionary cache double buffered (shared pool, buffer cache)

    Hi,
    I'm trying to get idea about how dictionary cache is buffered .
    Let us say we're talking about dc_objects .
    It is dba_tables view related so all underlying sys.obj$ sys.user$ ... tables block are cached in buffer cache.
    So why we are caching them in dictionary cache space in shared pool additionally ?
    Looks like double buffering and wasting SGA .
    Please explain .
    Regards
    GregG

    HI,
    Dictionary cache will not cache data of tables, rather it will cache the structural information of table (in your case).
    If i will do "select ename from emp", during statement compilation, it needs to check whether "ename" is a real column? and for this it needs to query data dictionary information (from using physical read of system data file or from data dictionary cache if information is there). It also need to check whether i have (logged in user) rights to access this table/column and all this information comes from data dictionary.
    This is a simple example, otherwise dictionary cache need to store a lot of other information also (but purely the information present in data dictionary)
    Salman

  • ORA00379 No free buffers available in buffer pool default

    We encounter this error ORA00379 No free buffers available in buffer pool default with one of our online transaction system.
    Initially, the errors occur once every 30 sec, and became less frequent (about twice a day) after the buffers has been increased to the size of Oracle's default medium size database.
    Currently, the system is under testing and we have 4 staffs using the same userid to send transactions. Furthermore the size of each transaction is about 3-5mb. Will these issues actually caused Oracle to run out of free buffer spaces?
    Please advise.
    null

    kevin,
    i am not sure how big is your database or how big it is going to be.this is a memory issue that you are facing. try increase the db_block_buffers i would say an (ballpark *2) idea would be to size it around 200Mb+
    (assuming you have loads of memory). for a
    50-100 user database typically 200MB + of db_block_buffers and 200Mb+ of shared_pool_size should work.
    oracle's default sizes are too generic to work for all. so may be you shld change the init.ora parameters until you get rid of the errors.
    mukundan.

  • Buffer Cache Flush

    Hi All,
    What is the benefit of Flushing buffer cache. what are its effects and is it advisable to do it on production system.
    Thanks in Advance
    Edited by: Vikas Kohli on Jan 31, 2012 11:13 AM
    Edited by: Vikas Kohli on Jan 31, 2012 11:22 AM

    Asif,
    All blocks which are resides in the buffer cache get flushed. I think this needs correction. "However a buffer cannot become free if it is "pinned" (i.e. actualy in use) or if it is "dirty" (i.e. needs to be written to disc). There's nothing that Oracle can do about the pinned buffers, but it can write the content of the dirty buffers to disk before freeing them." Sir Jonathan @ flush buffer cache
    @ Vikas,
    In the above thread Sir Jonathan has written many most valuable inputs. Please check it.
    I think you will get more details from below link too : (Almost equal to Docs)
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7413988573867
    Flushing cache is generally and mostly used in Testing environment, untill and unless there is such need to do so.
    Flushing the buffer helps to find out more consistent results for sql traces.
    If you want to compare two different cases for performance, flush buffer cache and shared pool before execution of both of them.
    But this won't reduce LIO's (Logical I/O)
    Regards
    Girish Sharma

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • LRU and CKPTQ in database buffer cache

    Hi experts out here,
    This functionality will work out in Database buffer cache of Oracle 10.2 or greater.
    Sources:OTN forums and Concepts 11.2 guide
    As per my readings.To improve the funtionality and make it more good Database Bufer cache is divided into several areas which are called workareasNow further
    zooming this each workarea will store multiple lists to store the buffers inside the database buffer cache.
    Each wrokarea can have one or more then one lists to maintain the wrokordering in there.So the list each workarea will have is LRU list and CKPTQ list.LRU list
    is a list of pinned,free and dirty buffers and CKPTQ is a list of Dirty buffers.We can say CKPTQ is a bundled of dirty buffers in low RBA ordering and ready to be flushed from cache to disk.
    CKPTQ list is maintained in low RBA ordering.
    As being novice let me clear about low RBA and High RBA first
    RBA is stored in the block header and will give us the information about when this block is changed and how many times it is changed.
    Low RBA : the low RBA is the address of the redo for the first change that was applied to the block since it was last clean,
    high RBA : the high RBA is the address of the redo for the most recent change to have been applied to the block.
    Now Back to CKPTQ
    It can be like this (Pathetic diagram of CKPTQ)
    lowRBA==================================High RBA
    (Head Of CKPTQ)                         (Tail Of CKPTQ)
    CKPTQ is a list of Dirty buffers.As per RBA concept.The most recent buffer modified is at the tail of CKPTQ.          
    Now oracle process starts and Try to Get buffer from DB cache if it gets a Buffer it will put a buffer MRU end of the LRU list.and buffer will become the most
    recently used.
    Now if process cant find a required buffer.then first it will try to find out Free buffer in LRU.And if it finds it its over it will place a datablock from datafile to the
    place where free buffer was sitting.(Good enough).
    Now if process cant fnd a Free buffer in LRU then First step would be it will find some Dirty buffers from the LRU end of the LRU list and place them on a
    CKPTQ(Remeber in low order of RBA it will arrange it in CKPT queue). and now oracle process will take required buffer and place it on the MRU end of LRU list.(Because space has been acclaimed by moving Dirty buffers to CKPTQ).
    I am sure that from CKPTQ the buffers(to be more accurate Dirty buffers) will move to datafiles.all the buffers are line up n CKPTQ in lower RBA first manner.But
    will be flushed to datafile how and in which manner and what event?
    This is what i understand after last three days flicking through blogs,forums and concepts guide.Now what i am missing please clear me out and apart from that
    i cant link the following functionalities with this flow..that is
    1)How the incremental checkpoint work with this CKPTQ?
    2)Now what is that 3 seconds timeout?
    (Every 3 seconds DBWR process will wake and find if anything there to write on datafiles for this DBWR will only check CKPTQ).
    3)apart form 3 second funda , when CKPTQ the buffers will be moved??(IS it when Process cant find any space in CKPTQ to keep buffers from LRU.ITs a
    moment when buffer from CKPTQ will be moved to disk)
    4)Can you please relate when control file will be updated with checkpoint so it can reduce recovery time?
    To many ques but i am trying to build up the whole process in mind that how it works may be i can be wrong in any phase in any step please correct me up and
    take me @ the end of flow..
    THANKS
    Kamesh

    Hi Amansir,
    So i m back with my bunch of questions.I cant again ask a single because you know its a flow so i cant end up with single doubt.Thanks for your last reply.
    Yes amansir first doubt clear that was buffer will be inserted at MID point for this i got one nice document (PDF)names "All about oracle touch count algorithm by CRAIG A SHALLAHAMER".That was quite nice PDF allabout hot and cold buffer and buffer movments inside the LRU list.I am prettly much clear with that point.Thank you. and Incremental checkpoint i read from Harald.van.Breederode ppt a person from oracle.You have shared it on one of your thread.that was nice reference
    flicking through threads i came across term REPL and its variations REPL-AUX (thread was for Oracle 9i).Is this variation REPL-AUX deprecated in 10g So i i am not wrong For each work area two main lists that are LRU and CKPTQ exists??not more than that any other types?
    For non-RAC database Thread checkpoint is a Full checkpoint?
    I read about the incremental checkpointing Here incremental checkpointing in my words n brief.Incremental Checkpoints means write only some selected buffer from CKPTQ to Datafiles.FROM CKPTQ few Low orders RBA buffers are selected and chekcpointed *(Buffer will be checkpointed on many conditions)* and When the Next checkpoint occurs that buffers are flushed to disk.Now this thing *(Checkpointing few buffers and flushing them to disk)* can be multiple times within three seconds so after 3 seconds *(This is the 3 second concept i was asking in the starting of the thread,Can this time be changed if yes with which parameter)* the checkpoint RBA and Checkpoint*(the point upto which database buffer has flushed to disk)* will be updated in Control file header *(Datafile also)* by CKPT process.So that Checkpoint will be used for Instance recovery purpose.Which can dramatically down the instance recovery time.
    every 3 seconds control file is updated with checkpoint and that checkpoint is the point from where we have to start the recovery process in oracle from redo log.I m aware that incremental checkpointing is controlled by Fast_start_mttr_target prarameter and now it is autotuned for >10.2 but the smaller value i will keep the less time my instance will take.
    Is above two para right what i understood if wrong correct me??
    What i understand is after three seconds it will take some buffers from the CKPTQ ( from low RBA end ) and flush them to disk.apart from this many other conditions are there when Data will be flushed to disk.
    1) like CKPTQ is full.
    2)Process cant find a free buffer in LRU
    3)to advance checkpoint DBWR writes..
    Correct me if i m wrong?
    THANKS
    Kamesh
    Edited by: Kamy on May 2, 2011 10:55 PM

  • Latches on Buffer Cache

    Hi Everyone,
    Please through some light on the latches to the buffers cache. How do they work?, let say some 10 users are trying to select the data on the same block may be same rows through different sessions. How does the latch come into play in this event. As its a simple select statement (shared lock) do the 10 users get the rows at the same time or it is some thing like one user get the latch and other 9 users spin for the latch? Please clarify how oracle handles such situations.
    Thanks for help in advance.

    user8710159 wrote:
    Hi Everyone,
    Please through some light on the latches to the buffers cache. How do they work?, let say some 10 users are trying to select the data on the same block may be same rows through different sessions. How does the latch come into play in this event. As its a simple select statement (shared lock) do the 10 users get the rows at the same time or it is some thing like one user get the latch and other 9 users spin for the latch? Please clarify how oracle handles such situations. Leave 10 users for a moment since it may confuse the things a little too much.
    There are two latches that come into the picture when the buffer cache is considered, cache buffer lru chain latch and cache buffer chain latch . I hope you do know that buffer cahcei is maintained by LRU algorithm and with LRU and CKPTQ linked lists. In addition to this, the buffer cache is maintained with the help of workarea sets which divide the buffer cache in partitions and each CBC LRU Chain latch is maintaining one set( the number is 2 per set in 11.2 I believe) .
    When the access is requested for the buffer from the buffer cache, first of all the extent map of the segment is loaded. This would tell Oracle about the information that its looking for. Now, since Oracle knows which buffers the need to read, they start to look for it. For this purpose DBA is used. DBA is Data block address which would consist of the file# and block# . This DBA address is hashed by Oracle and a hash key-value pair is generated which would be looked upon in a hash table consisting of hash buckets . The cached buffers are linked in these buckets with their hash values. For doing this search, the CBC chain latch is used using which your server process would scan the hash chains. If the buffer is found, its marked as a logical IO and the buffer is given back to you. If not the CBC chain latch is unpinned and the CBC LRU chain latch is used to find the free buffer in the LRU lists. The free buffer search is carried in all the work area sets one by one if from the previous set , free buffers are not found. If any time, required free buffers are found. the data is read from the disk using the physical io and is loaded into the buffers. If not , DBWR is asked to flush the cache immediately and by the time , its doing that, free buffer wait is reported for your server process.
    Surely , things would go more complex if in this DMLs get involved too. So lets leave this and hope it clears some doubts for you.
    HTH
    Aman....

  • Buffer Cache too big?

    Hello Oracle community!
    I'm having issues because of my current SGA size on a Win 32-bit platform, its measures are normally on 6,811,549,696 bytes. There was another database administrator before me but he left the company, his instructions were that he setup this size because that time RAM memory was not the problem.
    The OS' parameters are set to read the entire 8GB RAM.
    If I set a SGA_TARGET to around 6GB, will I only have -800mb on my db and no problems at all? Is there any way to check things better than just set a SGA_TARGET and pray?
    Thank you very much!

    @Elios
    Oracle Version 10.2.0.3.0
    It's not an OLTP Database.
    @mehmet eser
    NAME BYTES RESIZEABLE
    Fixed SGA Size 1289604 No
    Redo Buffers 7098368 No
    Buffer Cache Size 6442450944 Yes
    Shared Pool Size 343932928 Yes
    Large Pool Size 8388608 Yes
    Java Pool Size 8388608 Yes
    Streams Pool Size 0 Yes
    Granule Size 8388608 No
    Maximum SGA Size 6811549696 No
    Startup overhead in Shared Pool 268435456 No
    Free SGA Memory Available 0
    11 rows selected
    NAME VALUE
    Fixed Size 1289604
    Variable Size 360710780
    Database Buffers 6442450944
    Redo Buffers 7098368
    4 rows selected
    To use more than the basic on 32bit Windows I used /PAE on boot.ini.

  • Oracle RAW / Long / LOBs - Buffer cache?

    Hello guys,
    i think i have read sometime ago something about that LOBs are not cached in the buffer cache? Is this right?
    I also think that i can remember that raw or long are stored in the sga buffer cache?
    I can not find any official documentation about that topic... maybe you can help me...
    Thanks and Regards
    Stefan

    Hi,
    Depends on whether you are on about temporary lobs or lobs that are persisted as a column. If it's as a column then you have the cache/cache read/nocache option which is part of the lob storage clause. If it's nocache it's not put into the buffer cache and if it's cache it is (and I'm sure you can figure out from this what "cache read" means)
    If it's a temporary lob then it exists in the temporary tablespace which if a true temp tablespace (which it should be) will be accessed using direct IO (so not buffered).
    An the official documentation is easily found, Oracle wrote a whole manual dedicated to LOBS...
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/toc.htm
    HTH
    Chris

  • Data Buffer Cache Limit

    Is there any way that I could signal daat buffer cache to write all data to data files if amount of dirty blocks reach say 50 Mb.
    Iam processing with BLOBS, one blob at a time, some of which has sizes exceeeding 100 Mb and the diffcult thing is that I cannot write to disk until the whoile blob is finished as it is one transaction.
    Well if anyone is going to suggest that to open, process close, commit ....well i tried that but it also gives error "nmo free buffer pool" but this comes for twice the size of buffer size = 100 Mb file when db cache size is 50 mb.
    any ideas.

    Hello,
    Ia using Oracle 9.0.1.3.1
    I am getting error ORA-OO379 No free Buffers available in Buffer Pool. Default for block size 8k.
    My Init.ora file is
    # Copyright (c) 1991, 2001 by Oracle Corporation
    # Cache and I/O
    db_block_size=8192
    db_cache_size=104857600
    # Cursors and Library Cache
    open_cursors=300
    # Diagnostics and Statistics
    background_dump_dest=C:\oracle\admin\iasdb\bdump
    core_dump_dest=C:\oracle\admin\iasdb\cdump
    timed_statistics=TRUE
    user_dump_dest=C:\oracle\admin\iasdb\udump
    # Distributed, Replication and Snapshot
    db_domain="removed"
    remote_login_passwordfile=EXCLUSIVE
    # File Configuration
    control_files=("C:\oracle\oradata\iasdb\CONTROL01.CTL", "C:\oracle\oradata\iasdb\CONTROL02.CTL", "C:\oracle\oradata\iasdb\CONTROL03.CTL")
    # Job Queues
    job_queue_processes=4
    # MTS
    dispatchers="(PROTOCOL=TCP)(PRE=oracle.aurora.server.GiopServer)", "(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)"
    # Miscellaneous
    aq_tm_processes=1
    compatible=9.0.0
    db_name=iasdb
    # Network Registration
    instance_name=iasdb
    # Pools
    java_pool_size=41943040
    shared_pool_size=33554432
    # Processes and Sessions
    processes=150
    # Redo Log and Recovery
    fast_start_mttr_target=300
    # Sort, Hash Joins, Bitmap Indexes
    pga_aggregate_target=33554432
    sort_area_size=524288
    # System Managed Undo and Rollback Segments
    undo_management=AUTO
    undo_tablespace=UNDOTBS

  • Buffer cache writes

    Hi,
    From ADDM report i saw following message.
    Buffer cache writes due to small log files were consuming significant database
    time.
    Recommendation 1: Database Configuration
    Estimated benefit is .31 active sessions, 2.99% of total activity.
    Action
    Increase the size of the log files to 2048 M to hold at least 20 minutes
    of redo information.
    From AWR which section would tell me about Buffer cache writes?
    Thanks

    user10698496 wrote:
    From ADDM report i saw following message.
    Buffer cache writes due to small log files were consuming significant database
    time.
    Recommendation 1: Database Configuration
    Estimated benefit is .31 active sessions, 2.99% of total activity.
    Action
    Increase the size of the log files to 2048 M to hold at least 20 minutes
    of redo information.
    From AWR which section would tell me about Buffer cache writes?
    As Nikolay has pointed out, the estimated benefit is only three percent, however it's not (usually) a difficult, risky, r time-consuming change to make so you might as well follow the advice.
    One of the triggers that utlimately causes the database writer (dbwr) to write is the log file switch - which means if your log files are small you may find dbwr writing blocks more aggressively than needed. Oracle may be analysing history to count examples of database blocks being written more than once before being flushed from the buffer to produce this conclusion.
    Jgarry has already mentioned v$instance_recovery - one of the columns in that view is "writes_logfile_size" - the number of writes due to the size of the log file; this is the figure that could be reduced by increasing the log file size. This doesn't get reported in the AWR, though. I think the best you can get is the instance activity statistic "DBWR thread checkpoint buffers written" - but there's a complicated precedence of which features cause which counter to increment so I'm not even sure how helpful that fiture may be.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    Author: <b><em>Oracle Core</em></b>

  • 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....

Maybe you are looking for

  • Is  there any another BI tools ( other than  Mltiprovider / Infoset )  for

    For connecting two different information .. of two cubes  with a single matching columb , Multiprovoider / Infoset Is there is any another tool  ? Thanks Regards Sanjeev Kumar

  • USB is painfully slow all of a sudden

    Hey there i have a macbook running 10.4.9 and usb has always been fine until today when times for pulling data off usb have become agonizingly slow. like 30 minutes for 70MB. EDIT writing to usb is slow, and i have tried this on flash drives and my u

  • XI message as attachment

    XI message to Attachments desc : my scenario is file-XI-SOAP I want to convert the input payload into an attachment. And this attachment should be sent to Webservice though SOAP rceceiver adapter by selecting "Keep Attachment". Please let me know how

  • How do I draw on a Jpanel

    I've spent around 15 hours trying to work out how to draw something as simple as a line onto a JPanel! I kind of understand about using paint, set color etc. if I was writing code in notepad I'm sure that it wouldn't be a problem but as I'm using the

  • IWeb SEO not updating navigation bar

    Hi All, I have been working on my first website via iWeb (3.0.4 v601) and have been able to work through most of the issues encountered. The main one was the site name repeated in the address, so I researched the iWeb SEO that fixed that. i.e. www.th