ASMM  - DB_KEEP_CACHE_SIZE

Hello colleagues
10.2.0.2 - MS2003 SP2
I'm using ASMM and I like to pin a frequently scanned table to the KEEP buffer. The parameter DB_KEEP_CACHE_SIZE is per default 0. Do I have to change this parameter to the size of the object (at least) I like to pin?
If I set a fixed size of e.g. 200M - is this space allocated as one piece and not used anymore by other SGA components or is the "unused" space still available?
How can I prove that my object is located in the KEEP cache?
Thx for your hints.
TonyDBA

Hello colleagues
10.2.0.2 - MS2003 SP2
I'm using ASMM and I like to pin a frequently scanned table to the KEEP buffer. The parameter DB_KEEP_CACHE_SIZE is per default 0. Do I have to change this parameter to the size of the object (at least) I like to pin?
If I set a fixed size of e.g. 200M - is this space allocated as one piece and not used anymore by other SGA components or is the "unused" space still available?
How can I prove that my object is located in the KEEP cache?
Thx for your hints.
TonyDBA
Keep buffer usually to keep small, almost never updated table which used as look up table.
Set DB_KEEP_CACHE_SIZE size big enough to keep the table. Memory allocated for DB_KEEP_CACHE_SIZE will not be used by other component of SGA.
Use below query to check the tables that sitting on buffer cache:
select
object_name c1,
object_type c2,
num_blocks c3,
(num_blocks/decode(sum(blocks), 0, .001, sum(blocks)))*100 c4
from
(select
o.object_name object_name,
o.object_type object_type,
count(1) num_blocks
from
dba_objects o,
v$bh bh
where
o.object_id = bh.objd
and
o.owner not in ('SYS','SYSTEM')
group by
o.object_name,
o.object_type)
t1,
dba_segments s
where
s.segment_name = t1.object_name
and
num_blocks > 10
group by
object_name,
object_type,
num_blocks
order by
num_blocks desc
regards
AM

Similar Messages

  • Db_keep_cache_size shows 0 when i keep object in KEEP buffer pool !

    Dear Frineds ,
    I use Oracle 10g . Form the oracle 10g documentaiton, I get the following information regarding ASMM (Automatic Shared Memory Management) :
    The following pools are manually sized components and are not affected by Automatic Shared Memory Management:
    Log buffer
    Other buffer caches (such as KEEP, RECYCLE, and other non-default block size)
    Fixed SGA and other internal allocations
    Now plz see the following examle :
    1) SQL> select sum(bytes)/1024/1024 " SGA size used in MB" from v$sgastat where name!='free memory';
    SGA size used in MB
    247.09124
    2) SQL> show parameter keep_
    NAME TYPE VALUE
    db_keep_cache_size big integer 0 (Here db_keep_cache_size is 0 )
    3) Now I keep the scott's dept table to KEEP cache :
    SQL> select owner,segment_type,segment_name,buffer_pool from dba_segments where buffer_pool != 'DEFAULT';
    no rows selected
    SQL> alter table scott.dept storage(BUFFER_POOL KEEP);
    Table altered.
    SQL> select owner,segment_type,segment_name,buffer_pool from dba_segments where buffer_pool != 'DEFAULT';
    OWNER SEGMENT_TYPE SEGMENT_NAME
    SCOTT TABLE DEPT
    4)
    After doing this , I have to see the following parameter :
    SQL> show parameter keep
    NAME TYPE VALUE
    db_keep_cache_size big integer 0
    SQL> select sum(bytes)/1024/1024 " SGA size used in MB" from v$sgastat where name!='free memory';
    SGA size used in MB
    246.76825
    Here I see that my sga is used but "db_keep_cache_size" still shows the '0' .
    Can u plz explain why this parameter value shows '0' now ?
    Thx in advance ... ...

    Hi,
    I am not sure I have understood the question fully but if you are trying to monitor usage of the buffer pools you should use some of the dynamic views like in the example query below. If this is not what you are interested in let me know.
    SELECT NAME, BLOCK_SIZE, SUM(BUFFERS)
    FROM V$BUFFER_POOL
    GROUP BY NAME, BLOCK_SIZE
    HAVING SUM(BUFFERS) > 0;

  • Buffer_pool and db_keep_cache_size

    hi all,
    i want to change the buffer_pool of one table to KEEP and my parameter settings are
    sga_target big integer 7516192768
    buffer_pool_recycle string
    db_recycle_cache_size big integer 0
    db_keep_cache_size big integer 0
    if i change the buffer_pool it KEEP for table, will it be cached or not with above settings.
    do i have to first set db_keep_cache_size to non-zero to make it effective.
    regards
    Mir

    user11972299 wrote:
    hi all,
    i want to change the buffer_pool of one table to KEEP and my parameter settings are
    sga_target big integer 7516192768
    buffer_pool_recycle string
    db_recycle_cache_size big integer 0
    db_keep_cache_size big integer 0
    if i change the buffer_pool it KEEP for table, will it be cached or not with above settings.
    do i have to first set db_keep_cache_size to non-zero to make it effective.
    buffer_pool_recycle is an old parameter. Why you want to combine with the new ASMM parameter? If you want to use Keep pool for your table, in the table, change the Storage's option BUFFER_POOL to Keep with the alter table option.
    Don't touch the db_cache_size . Let ASMM handle it.
    HTH
    Aman....

  • Questions about db_keep_cache_size and Automatic Shared Memory Management

    Hello all,
    I'm coming upon a server that I'm needing to pin a table and some objects in, per the recommendations of an application support call.
    Looking at the database, which is a 5 node RAC cluster (11gr2), I'm looking to see how things are laid out:
    SQL> select name, value, value/1024/1024 value_MB from v$parameter
    2 where name in ('db_cache_size','db_keep_cache_size','db_recycle_cache_size','shared_pool_size','sga_max_size');
    NAME VALUE VALUE_MB
    sga_max_size 1694498816 1616
    shared_pool_size 0 0
    db_cache_size 0 0
    db_keep_cache_size 0 0
    db_recycle_cache_siz 0 0
    e
    Looking at granularity level:
    SQL> select granule_size/value from v$sga_dynamic_components, v$parameter where name = 'db_block_size' and component like 'KEEP%';
    GRANULE_SIZE/VALUE
    2048
    Then....I looked, and I thought this instance was set up with Auto Shared Mem Mgmt....but I see that sga_target size is not set:
    SQL> show parameter sga
    NAME TYPE VALUE
    lock_sga boolean FALSE
    pre_page_sga boolean FALSE
    sga_max_size big integer 1616M
    sga_target big integer 0
    So, I'm wondering first of all...would it be a good idea to switch to Automatic Shared Memory Management? If so, is this as simple as altering system set sga_target =...? Again, this is on a RAC system, is there a different way to do this than on a single instance?
    If that isn't the way to go...let me continue with the table size, etc....
    The table I need to pin is:
    SQL> select sum (blocks) from all_tables where table_name = 'MYTABLE' and owner = 'MYOWNER';
    SUM(BLOCKS)
    4858
    And block size is:
    SQL> show parameter block_size
    NAME TYPE VALUE
    db_block_size integer 8192
    So, the space I'll need in memory for pinning this is:
    4858 * 8192 /1024/1024 = 37.95.......which is well below my granularity mark of 2048
    So, would this be as easy as setting db_keep_cache_size = 2048 with an alter system call? Do I need to set db_cache_size first? What do I set that to?
    Thanks in advance for any suggestions and links to info on this.
    cayenne
    Edited by: cayenne on Mar 27, 2013 10:14 AM
    Edited by: cayenne on Mar 27, 2013 10:15 AM

    JohnWatson wrote:
    This is what you need,alter system set db_keep_cache_size=40M;I do not understand the arithmetic you do here,select granule_size/value from v$sga_dynamic_components, v$parameter where name = 'db_block_size' and component like 'KEEP%';it shows you the number of buffers per granule, which I would not think has any meaning.I'd been looking at some different sites studying this, and what I got from that, was that this granularity gave you the minimum you could set the db_keep_cache_size, that if you tried setting it below this value, it would be bumped up to it, and also, that each bump you gave the keep_cache, would be in increments of the granularity number....?
    Thanks,
    cayenne

  • Table size exceeds Keep Pool Size (db_keep_cache_size)

    Hello,
    We have a situation where one of our applications started performing bad since last week.
    After some analysis, it was found this was due to data increase in a table that was stored in KEEP POOL.
    After the data increase, the table size exceeded db_keep_cache_size.
    I was of the opinion that in such cases KEEP POOL will still be used but the remaining data will be brought in as needed from the table.
    But, I ran some tests and found it is not the case. If the table size exceeds db_keep_cache_size, then KEEP POOL is not used at all.
    Is my inference correct here ?
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionSetup
    SQL> show parameter keep                    
    NAME                                 TYPE        VALUE
    buffer_pool_keep                     string
    control_file_record_keep_time        integer     7
    db_keep_cache_size                   big integer 4M
    SQL>
    SQL>     
    SQL> create table t1 storage (buffer_pool keep) as select * from all_objects union all select * from all_objects;
    Table created.
    SQL> set autotrace on
    SQL>
    SQL> exec print_table('select * from user_segments where segment_name = ''T1''');
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> exec print_table('select * from user_segments where segment_name = ''T1''');
    SEGMENT_NAME                  : T1
    PARTITION_NAME                :
    SEGMENT_TYPE                  : TABLE
    SEGMENT_SUBTYPE               : ASSM
    TABLESPACE_NAME               : HR_TBS
    BYTES                         : 16777216
    BLOCKS                        : 2048
    EXTENTS                       : 31
    INITIAL_EXTENT                : 65536
    NEXT_EXTENT                   : 1048576
    MIN_EXTENTS                   : 1
    MAX_EXTENTS                   : 2147483645
    MAX_SIZE                      : 2147483645
    RETENTION                     :
    MINRETENTION                  :
    PCT_INCREASE                  :
    FREELISTS                     :
    FREELIST_GROUPS               :
    BUFFER_POOL                   : KEEP
    FLASH_CACHE                   : DEFAULT
    CELL_FLASH_CACHE              : DEFAULT
    PL/SQL procedure successfully completed.DB_KEEP_CACHE_SIZE=4M
    SQL> select count(*) from t1;
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              9  recursive calls
              0  db block gets
           2006  consistent gets
           2218  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> /
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1940  consistent gets
           1937  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedDB_KEEP_CACHE_SIZE=10M
    SQL> connect / as sysdba
    Connected.
    SQL>
    SQL> alter system set db_keep_cache_size=10M scope=both;
    System altered.
    SQL>
    SQL> connect hr/hr@orcl
    Connected.
    SQL>
    SQL> show parameter keep
    NAME                                 TYPE        VALUE
    buffer_pool_keep                     string
    control_file_record_keep_time        integer     7
    db_keep_cache_size                   big integer 12M
    SQL>
    SQL> set autotrace on
    SQL>
    SQL> select count(*) from t1;
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1940  consistent gets
           1937  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> /
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1940  consistent gets
           1937  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedDB_KEEP_CACHE_SIZE=20M
    SQL> connect / as sysdba
    Connected.
    SQL>
    SQL> alter system set db_keep_cache_size=20M scope=both;
    System altered.
    SQL>
    SQL> connect hr/hr@orcl
    Connected.
    SQL>
    SQL> show parameter keep
    NAME                                 TYPE        VALUE
    buffer_pool_keep                     string
    control_file_record_keep_time        integer     7
    db_keep_cache_size                   big integer 20M
    SQL> set autotrace on
    SQL> select count(*) from t1;
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1943  consistent gets
           1656  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> /
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1943  consistent gets
              0  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedOnly with 20M db_keep_cache_size I see no physical reads.
    Does it mean that if the db_keep_cache_size < table size, there is no caching for that table ?
    Or am I missing something ?
    Rgds,
    Gokul

    Hello Jonathan,
    Many thanks for your response.
    Here is the test I ran;
    SQL> select buffer_pool,blocks from dba_tables where owner = 'HR' and table_name = 'T1';
    BUFFER_     BLOCKS
    KEEP          1977
    SQL> select count(*) from v$bh where objd = (select data_object_id from dba_objects where owner = 'HR' and object_name = 'T1');
      COUNT(*)
          1939
    SQL> show parameter db_keep_cache_size
    NAME                                 TYPE        VALUE
    db_keep_cache_size                   big integer 20M
    SQL>
    SQL> alter system set db_keep_cache_size = 5M scope=both;
    System altered.
    SQL> select count(*) from hr.t1;
      COUNT(*)
        135496
    SQL> select count(*) from v$bh where objd = (select data_object_id from dba_objects where owner = 'HR' and object_name = 'T1');
      COUNT(*)
           992I think my inference is wrong and as you said I am indeed seeing the effect of tail end flushing the start of the table.
    Rgds,
    Gokul

  • Db_keep_cache_size

    Hi All,
    What is the functionality of db_keep_cache_size & db_recycle_size & how can i set it at my database.

    Dear 788442,
    Please see the following online documentations;
    DB_KEEP_CACHE_SIZE;
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/initparams059.htm#REFRN10040
    DB_KEEP_CACHE_SIZE specifies the size of the KEEP buffer pool. The size of the buffers in the KEEP buffer pool is the primary block size (the block size defined by the DB_BLOCK_SIZE initialization parameter).DB_RECYCLE_CACHE_SIZE;
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/initparams064.htm#REFRN10042
    DB_RECYCLE_CACHE_SIZE specifies the size of the RECYCLE buffer pool. The size of the buffers in the RECYCLE pool is the primary block size (the block size defined by the DB_BLOCK_SIZE initialization parameter).Hope That Helps.
    Ogan

  • Db_keep_cache_size aging

    Database Version: 10.2.0.4
    OS: RHEL 4
    SGA_MAX_SIZE=25G
    SGA_TARGET=10G
    Database block size=8K
    I am trying to cache the most recent 20 or so partitions of an index.
    No objects in my database were using the buffer keep pool before now.
    I did the following to accomplish this:
    alter system set sga_target=20G scope=both;
    alter system set db_keep_cache_size = 10G scope=both;
    ALTER INDEX [INDEX_NAME] modify PARTITION PART1 storage (buffer_pool keep);
    ALTER INDEX [INDEX_NAME] modify PARTITION PART2 storage (buffer_pool keep);
    ALTER INDEX [INDEX_NAME] modify PARTITION PART3 storage (buffer_pool keep);
    SELECT /*+ INDEX ([INDEX_NAME]) */ ... FROM [TABLE_NAME] partition (PAR1);
    SELECT /*+ INDEX ([INDEX_NAME]) */ ... FROM [TABLE_NAME] partition (PAR2);
    SELECT /*+ INDEX ([INDEX_NAME]) */ ... FROM [TABLE_NAME] partition (PAR3);
    As the "SELECT" statements are running, I can see the buffer cache being populated with the blocks from this index's partitions using the following query:
    --- QUERY1
    select
    +     b.object_name,b.subobject_name,count(*)+
    from
    +     v$bh a,dba_objects b+
    where
    +     b.object_name = '[INDEX_NAME]'+
    +     and+
    +     b.owner = '[OWNER]'+
    +     and+
    +     b.object_id = a.objd and a.status != 'free'+
    group by
    +     b.object_name,b.subobject_name+
    order by 3
    +     desc;+
    I'm using the following query to determine when my db_keep_cache_size is approaching capacity:
    --- QUERY2
    select
    +     (sum(count(*))*8192)/1024/1024 BUFFER_KEEP_USED_IN_MB+
    from
    +     v$bh a,+
    +     dba_objects b+
    where
    +     b.object_name = '[INDEX_NAME]'+
    +     and+
    +     b.owner = '[OWNER]'+
    +     and+
    +     b.object_id = a.objd and a.status != 'free'+
    group by
    +     b.object_name,b.subobject_name;+
    My Problems/Questions:
    What I've noticed is that as the blocks are being cached, the index partitions that were cached first are being aged out.
    I know this is normal behavior if you reach the capacity of your buffer keep pool size but according to QUERY2 above I am not even close to reaching 10G.
    Why aren't the blocks remaining in the buffer cache? Is QUERY2 accurately depicting the usage of my buffer keep pool?
    I have already verified that this index's partitions are the only objects setup for my keep cache. (SELECT * fROM DBA_OBJECTS WHERE BUFFER_POOL <> 'DEFAULT')

    SELECT /*+ INDEX ([INDEX_NAME]) */ ... FROM [TABLE_NAME] partition (PAR1);
    SELECT /*+ INDEX ([INDEX_NAME]) */ ... FROM [TABLE_NAME] partition (PAR2);
    SELECT /*+ INDEX ([INDEX_NAME]) */ ... FROM [TABLE_NAME] partition (PAR3);Just to clarify.
    Do above queries follow index scan?
    ================================
    Dion Cho - Oracle Performance Storyteller
    http://dioncho.wordpress.com (english)
    http://ukja.tistory.com (korean)
    http://dioncho.blogspot.com (japanese)
    http://ask.ex-em.com (q&a)
    ================================

  • DB_KEEP_CACHE_SIZE  and  DB_RECYCLE_CACHE_SIZE  -- -- question

    db version = 10.2
    db block size = 8k
    I just added followiong two parameters to my init.ora:
    DB_KEEP_CACHE_SIZE=8k
    DB_RECYCLE_CACHE_SIZE=8k
    Question: I want to keep few lookup tables in 'KEEP' and 'RECYCLE'. Am I configuring the above two parameters correctly? Any inputs will be appreciated.
    regards,
    Lily.

    Sorry not mean how many rows in the tables rather the actual size like how many blocks.
    Check this from Performance Tuning Guide
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14211/memory.htm#sthref540
    You can compute an approximate size for the KEEP buffer pool by adding together the blocks used by all objects assigned to this pool. If you gather statistics on the segments, you can query DBA_TABLES.BLOCKS and DBA_TABLES.EMPTY_BLOCKS to determine the number of blocks used.

  • (9I) DYNAMIC SGA : SGA_MAX_SIZE, DB_CACHE_SIZE, DB_KEEP_CACHE_SIZE

    제품 : ORACLE SERVER
    작성날짜 : 2005-01-05
    (9I) DYNAMIC SGA : SGA_MAX_SIZE, DB_CACHE_SIZE, DB_KEEP_CACHE_SIZE
    ==================================================================
    PURPOSE
    Oracle 9i의 새 기능인 동적으로 SGA 파라미터들을 변경하는 방법에
    대하여 알아보기로 한다.
    Explanation
    Oracle 8i까지는 Buffer Cache, Shared Pool, Large Pool 등과 같은 SGA
    파라미터들에 대해 그 크기를 동적으로, db가 운영 중인 상태에서는 변경할
    수가 없었다.
    즉, 이러한 파라미터들을 변경하려면 db를 shutdown하고 initSID.ora 화일에
    서 그 크기를 다시 설정하고, 이 파라미터를 이용해서 db 인스턴스를 restart
    해야만 했었다.
    Oracle 9i에서는 DBA가 ALTER SYSTEM 명령을 이용해서 SGA 파라미터의 크기
    를 동적으로 변경할 수 있게 되었다. 이 특정을 'Dynamic SGA'라고 부른다.
    SGA 전체의 최대 크기(SGA_MAX_SIZE)를 정의하고 그 한도 내에서 파라미터의
    크기를 변경할 수 있는 것이다. 데이타베이스를 shutdown/startup 없이 작업
    이 가능하기 때문에 'Planned Downtime'을 줄이는 한 방법으로도 이해할 수
    있다.
    이 글에서는 SGA에 할당할 수 있는 최소 단위인 'Granule'의 개념을 살펴보
    고, 이 granule이 어떠한 방법에 의해 동적으로 할당되는지에 대해 알아보고
    자 한다.
    또한 Buffer Cache 파라미터 중 새로운 것과 이전 버전에 비해 달라진 내용
    을 소개하기로 한다.
    1. Granule
    Granule은 가상 메모리 상의 연속된 공간으로, dynamic SGA 모델에서 할당할
    수 있는 최소 단위이다. 이 granule의 크기는 SGA 전체의 추정값
    (SGA_MAX_SIZE)에 따라 다음과 같이 구분된다.
    4MB if estimated SGA size is < 128M
    16MB otherwise
    SGA의 Buffer Cache, Shared Pool, Large Pool 등의 파라미터는 이 granule
    단위로 늘어나거나 줄어들 수 있다. (현재 dynamic SGA를 사용할 수 있는
    SGA 관련 파라미터는 Buffer Cache, Shared Pool, Large Pool 세 가지이다.)
    2. Dynamic SGA(DB_CACHE_SIZE, SHARED_POOL_SIZE)
    DBA는 ALTER SYSTEM 명령을 통해 initSID.ora 화일에 정의된 SGA 관련 파라미
    터 값을 동적으로 변경할 수 있다. SGA 파라미터의 크기를 늘려주기 위해서
    는 필요한 만큼의 free granule이 존재해야만 하며, 현재 사용하고 있는 SGA
    의 크기가 SGA_MAX_SIZE보다 작아야 한다. Free granule이 없다고 해서 다른
    파라미터로부터 granule을 free시켜서 그 granule을 이용할 수 있는 것은 아
    니다.
    반드시 DBA가 명시적으로 free/allocate해야 한다.
    다음의 예를 살펴보자. 설명을 단순화하기 위해 이 경우는 SGA가 Buffer
    Cache와 Shared Pool로만 구성되었다고만 하자.
    예) initSID.ora
    SGA_MAX_SIZE = 128M
    DB_CACHE_SIZE = 96M
    SHARED_POOL_SIZE = 32M
    Note : DB_CACHE_SIZE는 Oracle 9i에 새롭게 도입된 파라미터이다.
    위와 같은 상태일 때 동적으로 SHARED_POOL_SIZE를 64M로 늘리면 에러가 발생
    한다.
    SQL> ALTER SYSTEM SET SHARED_POOL_SIZE=64M;
    (insufficient memory error message)
    이 에러는 SHARED_POOL_SIZE를 늘림으로써 전체 SGA의 크기가 SGA_MAX_SIZE
    보다 커지기 때문에 발생한다. (96M + 64M > 128M)
    이를 해결하기 위해서는 DB_CACHE_SIZE를 줄인 후, SHARED_POOL_SIZE를 늘린다.
    SQL> ALTER SYSTEM SET DB_CACHE_SIZE=64M;
    SQL> ALTER SYSTEM SET SHARED_POOL_SIZE=64M;
    Note : DB_CACHE_SIZE가 shrink되는 동안에
    ALTER SYSTEM SET SHARED_POOL_SIZE=64M;
    를 하면 insufficient error가 발생할 수도 있다.
    이 경우는 DB_CACHE_SIZE가 shrink된 후 다시 수행하면 정상적으로
    수행이 된다.
    Note : 위 예제의 경우 estimated SGA 크기가 128M 이상이므로, granule의
    단위는 16M이다. 따라서 SGA 파라미터의 크기를 16M의 정수배로 했다.
    16M의 정수배가 아닌 경우는 지정한 값보다 큰 값에 대해 16M의
    정수배 중 가장 가까운 값을 택하게 된다.
    즉, 아래 두 문장의 결과는 똑같다.
    SQL> ALTER SYSTEM SET SHARED_POOL_SIZE=64M;
    SQL> ALTER SYSTEM SET SHARED_POOL_SIZE=49M;
    Note : LARGE_POOL_SIZE 와 JAVA_POOL_SIZE 파라미터는 동적으로 변경하는
    것이 불가능하다.
    1) Dynamic Shared Pool
    인스턴스 start 후, Shared Pool의 크기는 다음과 같은 명령에 의해 동적으
    로 변경(grow or shrink)될 수 있다.
    ALTER SYSTEM SET SHARED_POOL_SIZE=64M;
    다음과 같은 제약 사항이 있다.
    - 실제 할당되는 크기는 16M의 정수배가 된다.
    - 전체 SGA의 크기는 SGA_MAX_SIZE를 초과할 수는 없다.
    2) Dynamic Buffer Cache
    인스턴스 start 후, Buffer Cache의 크기는 다음과 같은 명령에 의해 동적으
    로 변경(grow or shrink)될 수 있다.
    ALTER SYSTEM SET DB_CACHE_SIZE=96M;
    다음과 같은 제약 사항이 있다.
    - 실제 할당되는 크기는 16M의 정수배가 된다.
    - 전체 SGA의 크기는 SGA_MAX_SIZE를 초과할 수는 없다.
    - DB_CACHE_SIZE는 0이 될 수 없다.
    3. Buffer Cache 파라미터의 변경된 내용
    여기서는 Buffer Cache 파라미터와 관련하여 Oracle 9i에 의미가 없어진 파라
    미터와 새롭게 추가된 파라미터, 그리고 dynamic SGA 중 Buffer Cache와 관련
    이 있는 부분에 대해 기술하고자 한다.
    1) Deprecated Buffer Cache Parameters
    다음의 세 가지 파라미터는 backward compatibility를 위해 존재하는 것으
    로, 차후 의미가 없어진다.
    - DB_BLOCK_BUFFERS
    - BUFFER_POOL_KEEP
    - BUFFER_POOL_RECYCLE
    위의 파라미터들이 정의되어 있으면 이 값들을 사용하게 될 것이다. 하지만,
    다음에 나올 새로운 파라미터들을 사용하는 것이 좋으며, 만일 위 파라미터
    (DB_BLOCK_BUFFERS, BUFFER_POOL_KEEP, BUFFER_POOL_RECYCLE) 값들을 사용
    한다면 이 글에서 설명한 dynamic SGA 특징을 사용할 수는 없다. 또한
    initSID.ora 화일에 위 파라미터들과 새로운 파라미터를 동시에 기술한다면
    에러가 발생한다.
    2) New Buffer Cache Sizing Parameters
    다음의 세 파라미터가 추가되었다. 이 파라미터들은 primary block size에
    대한 buffer cache 정보를 다루고 있다.
    - DB_CACHE_SIZE
    - DB_KEEP_CACHE_SIZE
    - DB_RECYCLE_CACHE_SIZE
    DB_CACHE_SIZE 파라미터에 지정된 값은 primary block size에 대한 default
    Buffer Pool의 크기를 의미한다. 또한 이전 버전과 마찬가지로 KEEP과
    RECYCLE buffer pool을 둘 수 있는데, 이는 DB_KEEP_CACHE_SIZE,
    DB_RECYCLE_CACHE_SIZE 라는 파라미터를 이용한다.
    이전 버전과 다른 점은 이전 버전의 경우 각각의 파라미터
    (DB_BLOCK_BUFFERS, BUFFER_POOL_KEEP,BUFFER_POOL_RECYCLE)에 정의된 값들
    이 buffer 갯수(즉, 실제 메모리 크기를 구하려면 db_block_size를 곱했어야
    했다. )였는데 반해 이제는 구체적인 메모리 크기이다.
    또한 이전에는 DB_BLOCK_BUFFERS가 BUFFER_POOL_KEEP, BUFFER_POOL_RECYCLE
    의 값을 포함하고 있었지만, 이제는 DB_CACHE_SIZE가 DB_KEEP_CACHE_SIZE,
    DB_RECYCLE_CACHE_SIZE를 포함하고 있지 않다.
    즉, 각각의 파라미터들은 독립적이다.
    Note : Oracle 9i부터는 multiple block size(2K, 4K, 8K, 16K, 32K)를 지원한다.
    위에서 언급한 primary block size는 DB_BLOCK_SIZE에 의해 정해진 block
    size를 의미한다. (SYSTEM tablespace는 이 block size를 이용한다.)
    3) Dynamic Buffer Cache Size Parameters
    바로 위에서 언급한 세 파라미터는 아래와 같이 ALTER SYSTEM 명령에 의해
    동적으로 변경 가능하다.
    SQL> ALTER SYSTEM SET DB_CACHE_SIZE=96M;
    SQL> ALTER SYSTEM SET DB_KEEP_CACHE_SIZE=16M;
    SQL> ALTER SYSTEM SET DB_RECYCLE_CACHE_SIZE=16M;
    Example
    none
    Reference Documents
    <Note:148495.1>

    Hello Martin,
    Can I execute by ORA-27102 the following commandos in order to set and use the values of sga_max_size immediately?
    Variant 1)
    >sqlplus /nolog
    >connect / as sysdba
    > startup nomout
    > ALTER SYSTEM SET SGA_MAX_SIZE= ’value’ SCOPE=pfile;
    > shutdown immediate
    > startup
    Variant 2)
    Changing the values of sga_max_size, etc. in init<DBSID>.ora
    >sqlplus /nolog
    >connect / as sysdba
    > startup from pfile = /oracle/<SID>/dbs/ init<DBSID>.ora;
    Thank you very much!
    regards
    Thom

  • Three questions regarding DB_KEEP_CACHE_SIZE and caching tables.

    Folks,
    In my Oracle 10g db, which I got in legacy. It has the init.ora parameter DB_KEEP_CACHE_SIZE parameter configured to 4GB in size.
    Also there are bunch of tables that were created with CACHE turned on for them.
    By querying dba_tables table , with CACHE='Y', I can see the name of these tables.
    With time, some of these tables have grown in size (no. of rows) and also some of these tables are not required to be cached any longer.
    So here is my first question
    1) Is there a query I can run , to find out , what tables are currently in the DB_KEEP_CACHE_SIZE.
    2) Also how can I find out if my DB_KEEP_CACHE_SIZE is adqueataly sized or needs to be increased in size,as some of these
    tables have grown in size.
    Third question
    I know for fact, that there are 2 tables that do not need to be cached any longer.
    So how do I make sure they do not occupy space in the DB_KEEP_CACHE_POOL.
    I tried, alter table <table_name> nocache; statement
    Now the cache column value for these in dba_tables is 'N', but if I query the dba_segments tables, the BUFFER_POOL column for them still has value of 'KEEP'.
    After altering these tables to nocache, I did bounce my database.
    Again, So how do I make sure these tables which are not required to be cached any longer, do not occupy space in the DB_KEEP_CACHE_SIZE.
    Would very much appreciate your help.
    Regards
    Ashish

    Hello,
    1) Is there a query I can run , to find out , what tables are currently in the DB_KEEP_CACHE_SIZE:You may try this query:
    select owner, segment_name, segment_type, buffer_pool
    from dba_segments
    where buffer_pool = 'KEEP'
    order by owner, segment_name;
    2) Also how can I find out if my DB_KEEP_CACHE_SIZE is adqueataly sized or needs to be increased in size,as some of these tables have grown in size.You may try to get the total size of the Segments using the KEEP BUFFER:
    select sum(bytes)/(1024*10124) "Mo"
    from dba_segments
    where buffer_pool = 'KEEP';To be sure that all the blocks of these segments (Table / Index) won't be often aged out from the KEEP BUFFER, the total size given by the above query should be less than the size of your KEEP BUFFER.
    I know for fact, that there are 2 tables that do not need to be cached any longer.
    So how do I make sure they do not occupy space in the DB_KEEP_CACHE_POOL.You just have to execute the following statement:
    ALTER TABLE <owner>.<table> STORAGE(BUFFER_POOL DEFAULT);Hope this help.
    Best regards,
    Jean-Valentin

  • Buffer_pool & db_keep_cache_size

    Our database is 10.2.0.3 with 2 nodes RAC. The database servers are window 2003.
    I ran the query “select * from dba_tables where buffer_pool = 'KEEP'” and get 6 records come back. Some tables are pretty big.
    I ran “select sum(blocks) * 8192 from dba_tables where buffer_pool = 'KEEP'” and get:
    5489451008
    The parameter for db_keep_cache_size is 1073741824 for both instances.
    My question is: How Oracle handles this if Oracle allocated memory is smaller than the requested space? What are the impacts on the performance?
    Thanks,
    Shirley

    Yes, a buffer pool is a buffer pool and is managed as such. Each type of pool may have has some unique logic especially for how data is selected to go into the pool (keep, recycle, 16K block size, 2K block size) but when all else is said and done the end product is a buffer cache that has to be managed.
    Personally, I am not a fan of using multiple buffer pools. For most situations Oracle can probably do a better job of deciding what blocks to keep and purge from one large buffer cache than most DBA's can do by using the normal buffer cache, a keep, and a recycle pool. Over time the application data and usage changes. The pool configuration probably is not checked regularly enough to keep it properly aligned.
    Besides Oracle really uses a modified for touch count algorithm to manage the buffer cache instead of the documented LRU. Call it a modified LRU algorithm so the need to use a keep and/or recycle really isn’t there for most shops.
    IMHO -- Mark D Powell --

  • AMM and ASMM

    Oracle 11gR2 question:
    spfile.ora AMM, ASMM configuration
    Goal: only use AMM
    Issue: both AMM and ASMM are ENABLED !
    memory_target 1.5G
    memory_max_target 1.28G
    sga_target 0
    sga_max_size 768M
    1. Are AMM and ASMM mutually exclusive.
    2. What is expected outcome if both AMM and ASMM are ENABLED

    oracletune wrote:
    Aman,
    Our production system has run since December 2012, with above AMM settings.
    The PGA hit ratio was between 98-100 during this period.
    The transaction load have been constant and consistent.
    Only change: Yesterday re-organized 10million row table [21G] -> to Interval Partitioned Table.
    Result a: Fast-Fast query response from Partitioned Table
    Result b: New Problem PGA hit ratio 63.52That sounds pretty good as far as problems go. You should look at the plans for your Result a. It could very well be that you've done something like convert a PGA thrashing query to a non-thrashing query, or perhaps even a direct read, leaving only other random queries to hit the PGA. Is anything else slower? Rather than result b being a problem, it could be you just demonstrated the back-asswardness of hit ratios - things may be "better" with a "worse" ratio.
    And what sb said.

  • Configuring Oracle ASM 11gR2 to use ASMM

    Hello,
    Kernel hugepages under Oracle Linux is incompatible with Oracle AMM. The Oracle ASM instance under 11g uses AMM by default. So in order to configure Oracle ASM to use ASMM, what are the recommended settings please?
    I reviewed http://docs.oracle.com/cd/E18283_01/server.112/e16102/asminst.htm#CHDBBIBF which outlines some information about various pool size parameters required for ASMM, depending on the size of the datafiles that will used.
    But what about typical ASMM parametes like sga_target and pga_aggregate_target, or are these not used in an ASM instance?
    How have you configred ASMM for Oracle ASM 11gR2?
    Thanks!

    The minimum MEMORY_TARGET requirment for Oracle ASM is 256 MB. which we have set in ASM.
    But what about typical ASMM parametes like sga_target and pga_aggregate_target, or are these not used in an ASM instance? yes ,they will be used ,below snap from aix 6.1 OS
    SQL> sho parameter memory
    NAME                                 TYPE        VALUE
    memory_max_target                    big integer 272M
    memory_target                        big integer 272M
    SQL> r
      1* select * from V$MEMORY_DYNAMIC_COMPONENTS
    COMPONENT                         CURRENT_SIZE   MIN_SIZE   MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER LAST_OPER GRANULE_SIZE
    shared pool                          201326592  201326592  201326592                   0          0 STATIC                                 4194304
    large pool                            20971520   12582912   20971520            12582912          2 GROW          IMMEDIATE 04-JUN-12      4194304
    java pool                                    0          0          0                   0          0 STATIC                                 4194304
    streams pool                                 0          0          0                   0          0 STATIC                                 4194304
    SGA Target                           264241152  255852544  264241152                   0          2 GROW          IMMEDIATE 04-JUN-12      4194304
    DEFAULT buffer cache                         0          0          0                   0          0 STATIC                                 4194304
    KEEP buffer cache                            0          0          0                   0          0 STATIC                                 4194304
    RECYCLE buffer cache                         0          0          0                   0          0 STATIC                                 4194304
    DEFAULT 2K buffer cache                      0          0          0                   0          0 STATIC                                 4194304
    DEFAULT 4K buffer cache                      0          0          0                   0          0 STATIC                                 4194304
    DEFAULT 8K buffer cache                      0          0          0                   0          0 STATIC                                 4194304
    COMPONENT                         CURRENT_SIZE   MIN_SIZE   MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER LAST_OPER GRANULE_SIZE
    DEFAULT 16K buffer cache                     0          0          0                   0          0 STATIC                                 4194304
    DEFAULT 32K buffer cache                     0          0          0                   0          0 STATIC                                 4194304
    Shared IO Pool                               0          0          0                   0          0 STATIC                                 4194304
    PGA Target                            20971520   20971520   29360128                   0          2 SHRINK        IMMEDIATE 04-JUN-12      4194304
    ASM Buffer Cache                      25165824   25165824   25165824                   0          0 STATIC                                 4194304
    16 rows selected.Edited by: Kuljeet Pal Singh on Jun 27, 2012 6:59 PM

  • ASMM and shared_pool_reserved_size

    Hello All,
    Setting below parameters would affect memory available to MMAN when ASMM is turned on.
    shared_pool_size
    java_pool_size
    large_pool_size
    streams_pool_size
    db_cache_size
    Is this true for Shared_pool_reserved_size as well?
    Thanks
    S~

    SHARED_POOL_RESERVED_SIZE is taken from SHARED_POOL_SIZE
    Oracle recommend set it to 10% of SHARED_POOL_SIZE default is 5%,
    upper limit of this pool is 50% of SHARED_POOL_SIZE, over that Oracle will signal error.
    In ASMM the shared pool size is dynamic so you better not set this pool size too high.
    7.3.8.1 Using SHARED_POOL_RESERVED_SIZE
    The default value for SHARED_POOL_RESERVED_SIZE is 5% of the SHARED_POOL_SIZE. This means that, by default, the reserved list is configured.
    If you set SHARED_POOL_RESERVED_SIZE to more than half of SHARED_POOL_SIZE, then Oracle signals an error. Oracle does not let you reserve too much memory for the reserved pool. The amount of operating system memory, however, might constrain the size of the shared pool. In general, set SHARED_POOL_RESERVED_SIZE to 10% of SHARED_POOL_SIZE. For most systems, this value is sufficient if you have already tuned the shared pool. If you increase this value, then the database takes memory from the shared pool. (This reduces the amount of unreserved shared pool memory available for smaller allocations.)
    Statistics from the V$SHARED_POOL_RESERVED view help you tune these parameters. On a system with ample free memory to increase the size of the SGA, the goal is to have the value of REQUEST_MISSES equal zero. If the system is constrained for operating system memory, then the goal is to not have REQUEST_FAILURES or at least prevent this value from increasing.
    If you cannot achieve these target values, then increase the value for SHARED_POOL_RESERVED_SIZE. Also, increase the value for SHARED_POOL_SIZE by the same amount, because the reserved list is taken from the shared pool.
    SHARED_POOL_RESERVED_SIZE

  • In 11g, How to Enable Automatic Shared Memory Management (ASMM)

    hi experts,
    I have a new 11.2 g database and I want to configure it to use ASMM.
    To enable ASMM, should I assign a non-zero size to the Memory_Target parameter or the SGA_Target ? I have read conflicting statements.
    Thanks, John

    If you mean Automatic Memory Management, pl see
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/memory003.htm#ADMIN11011
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/instance.htm#ADMQS12039
    HTH
    Srini

Maybe you are looking for

  • MS office report function does not work after building the appication

    I use the MS office report function  with a custom excel template my application. It works properly in de developstate, but after building the application it does not work . I use office 2000  and Windows XP

  • Why my Firefox always lack and why I have to wait for minutes to open a page?

    Dear customer support officer, Why my Firefox always lack after I have update with Window 7 Service Pack 1? ... and why I have to wait for minutes to open a page? I discovered from the "Task Manager", every time when Firefox is lack, it took up 100%

  • How to schedule a Job on 1st Wednesday of every month

    Hi, I have a job script like below, begin sys.dbms_job.submit(job => :job, what => 'calcuate_stk;', next_date => to_date('18-07-2007 08:30:00', 'dd-mm-yyyy hh24:mi:ss'), interval => 'to_date(to_char(SYSDATE,''DD-MM-RRRR'')||'' 08:30:00'',''DD-MM-RRRR

  • ITunes 11.0 - no longer gives acurate playlist times

    Is anyone else having this issue?  The new itunes no longer gives an exact count of my playlists.  For instance, I have a playlist that was 63 minutes and 32 seconds and now it just says "1 Hour", the same thing goes for my playlist that is 55 minute

  • Inter company cost booking issue

    Hi, i configured the order related inter company billing. Issue is when we raise a end customer invoice then my end customer account is debited and my inter co sales is credited(selling co code) and when intercomapny billing generated then my interna