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

Similar Messages

  • Sql query executes faster 2. time despite clearing buffer cache/shared pool

    Hi All,
    I want to test query performance, so i clear cache in following way before each execution:
    alter system flush buffer_cache;
    alter system flush shared_pool;
    But, first execution takes more time than second and consequent executions. For example first execution takes 30 seconds, consequent executions take 3 seconds.
    Before each execution I clear the cache.
    What can be the reason? I use TOAD for query execution. Does TOAD caches something after first execution?
    And last question. Is there a dynamic query that query execution duration is stored?
    Any help will be appreciated.
    Thanks.

    >
    So there shouldn't be problem from the parameter, can you post result from V$SGA_DYNAMIC_COMPONENTS and v$SGAINFO ?
    V$SGA_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 436207616 402653184 0 0 125 GROW IMMEDIATE 02-JUL-09 16777216
    large pool 201326592 117440512 0 83886080 12 SHRINK DEFERRED 02-JUL-09 16777216
    java pool 16777216 16777216 0 0 0 STATIC 16777216
    streams pool 16777216 16777216 0 0 0 STATIC 16777216
    DEFAULT buffer cache 1895825408 1711276032 0 16777216 137 GROW DEFERRED 02-JUL-09 16777216
    KEEP buffer cache 0 0 0 0 0 STATIC 16777216
    RECYCLE buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 2K buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 4K buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 8K buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 16K buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 32K buffer cache 0 0 0 0 0 STATIC 16777216
    ASM Buffer Cache 0 0 0 16777216 0 STATIC 16777216
    V$SGA_INFO
    NAME BYTES RESIZEABL
    Fixed SGA Size 2086392 No
    Redo Buffers 14688256 No
    Buffer Cache Size 1895825408 Yes
    Shared Pool Size 436207616 Yes
    Large Pool Size 201326592 Yes
    Java Pool Size 16777216 Yes
    Streams Pool Size 16777216 Yes
    Granule Size 16777216 No
    Maximum SGA Size 2634022912 No
    Startup overhead in Shared Pool 218103808 No
    Free SGA Memory Available 50331648

  • Issue with shared pool size while upgrading from 10.2.0.4 to 11.2.0.2

    Hi Team,
    Below is my issue
    I am running dbua as part of the upgrade from 10.2.0.4 to 11.2.0.2. Its almost 59% and nothing is happening on the instance. The logs directory contian the below
    -bash-3.00$ ls -ltr
    total 280
    -rw-r----- 1 ora8014 ems8014 3662 Oct 16 08:58 upgrade.xml
    -rw-r----- 1 ora8014 ems8014 1127 Oct 16 09:00 Upgrade_Directive.log
    -rw-r----- 1 ora8014 ems8014 7452 Oct 16 09:00 mapfile.txt
    -rw-r----- 1 ora8014 ems8014 297 Oct 16 09:04 SpaceUsage.txt
    -rw-r----- 1 ora8014 ems8014 9803 Oct 16 09:04 PreUpgradeResults.html
    -rw-r----- 1 ora8014 ems8014 1572 Oct 16 09:06 PreUpgrade.log
    -rw-r----- 1 ora8014 ems8014 2850 Oct 16 09:06 Oracle_Text.log
    -rw-r----- 1 ora8014 ems8014 157816 Oct 16 09:09 trace.log
    -rw-r----- 1 ora8014 ems8014 71368 Oct 16 09:09 sqls.log
    -rw-r----- 1 ora8014 ems8014 339 Oct 16 09:09 Oracle_Server.log
    -bash-3.00$ date
    Sat Oct 16 22:54:27 PDT 2010
    -bash-3.00$ pwd
    /slot/ems8014/oracle/app/ora8014/cfgtoollogs/dbua/ebs11i10/upgrade1
    It seems its almost more 12 hrs nothing has happened. When I check the oracle_server.log it has the error
    -bash-3.00$ tail Oracle_Server.log
    ERROR at line 1:
    ORA-01034: ORACLE not available
    Process ID: 0
    select count(*) from v$instance
    ERROR at line 1:
    ORA-01034: ORACLE not available
    Process ID: 0
    ORA-00371: not enough shared pool memory, should be atleast 424463564 bytes
    Hence I started the Db in 10g oracle home to check and below is the details.
    SQL> select * from V$SGAINFO;
    NAME BYTES RES
    Fixed SGA Size 1267908 No
    Redo Buffers 11313152 No
    Buffer Cache Size 614400000 Yes
    Shared Pool Size 301989888 Yes
    Large Pool Size 8388608 Yes
    Java Pool Size 67108864 Yes
    Streams Pool Size 50331648 Yes
    Granule Size 4194304 No
    Maximum SGA Size 1056964608 No
    Startup overhead in Shared Pool 188743680 No
    Free SGA Memory Available 0
    11 rows selected.
    I tried to increase the space of shared pool as below
    SQL> ALTER SYSTEM SET shared_pool_size ='301M' SCOPE=MEMORY SID='ebs11i10';
    ALTER SYSTEM SET shared_pool_size ='301M' SCOPE=MEMORY SID='ebs11i10'
    ERROR at line 1:
    ORA-02097: parameter cannot be modified because specified value is invalid
    ORA-04033: Insufficient memory to grow pool
    I am stuck and cant proceed further. Could you please help me on this issue so that I overcome this and proceed further.
    Thanks
    Shyam.

    These are the logs. Could you please let me know which one you want.
    -bash-3.00$ pwd
    /slot/ems8014/oracle/app/ora8014/cfgtoollogs/dbua/ebs11i10/upgrade1
    -bash-3.00$ ls -ltr
    total 280
    -rw-r----- 1 ora8014 ems8014 3662 Oct 16 08:58 upgrade.xml
    -rw-r----- 1 ora8014 ems8014 1127 Oct 16 09:00 Upgrade_Directive.log
    -rw-r----- 1 ora8014 ems8014 7452 Oct 16 09:00 mapfile.txt
    -rw-r----- 1 ora8014 ems8014 297 Oct 16 09:04 SpaceUsage.txt
    -rw-r----- 1 ora8014 ems8014 9803 Oct 16 09:04 PreUpgradeResults.html
    -rw-r----- 1 ora8014 ems8014 1572 Oct 16 09:06 PreUpgrade.log
    -rw-r----- 1 ora8014 ems8014 2850 Oct 16 09:06 Oracle_Text.log
    -rw-r----- 1 ora8014 ems8014 157816 Oct 16 09:09 trace.log
    -rw-r----- 1 ora8014 ems8014 71368 Oct 16 09:09 sqls.log
    -rw-r----- 1 ora8014 ems8014 339 Oct 16 09:09 Oracle_Server.log

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

  • Pinning blocks to the Buffer Cache

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

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

  • DB buffer cache vs. SQL query & PL/SQL function result cache

    Hi all,
    Started preparing for OCA cert. just myself using McGraw Hill's exam guide. Have a question about memory structures.
    Actually, DB buffer cache is used to copy e.g. SELECT queries result data blocks, that can be reused by another session (server process).
    There is also additional otion - SQL query & PL/SQL function result cache (from 11g), where also stored the results of such queries.
    Do they do the same thing or nevertheless there is some difference, different purpose?
    thanks in advance...

    There is also additional otion - SQL query & PL/SQL function result cache (from 11g), where also stored the results of such queries.Result cache located in shared pool.So it is one component of shared pool.When server process execute query(and if you configured result cache) then result will store in shared pool.Then next execution time run time mechanism will detect and consider using result cache without executing this query(if data was not changed this is happen detection time)
    Do they do the same thing or nevertheless there is some difference, different purpose?.Buffer cache and result cache are different things and purpose also,but result cache introduced to improve response time of query in 11g(but such mechanism also implemented in 10g subquery execution,in complex query).In buffer cache holds data blocks but not such results.
    Edited by: Chinar on Nov 4, 2011 4:40 AM
    (Removing lots of "But" word from sentences :-) )

  • SHARED POOL에 대한 점검 사항들

    제품 : ORACLE SERVER
    작성날짜 : 2003-08-26
    SHARED POOL에 대한 점검 사항들
    ======================
    PURPOSE
    다음은 shared pool에 관련된 performance 에 대한 점검 사항들이다.
    Explanation
    1. literal SQL Statements
    SELECT      substr(sql_text,1,40) "SQL", count(*) ,
    sum(executions) "TotExecs"
    FROM      v$sqlarea
    WHERE      executions < 5
         GROUP BY substr(sql_text,1,40)
         HAVING count(*) > 30
    ORDER BY 2
    shared SQL문들 중에서 literal SQL문들을 찾아내어 bind variable을
    사용할 수 있는 경우 bind variable로 전환하도록 한다.
    ORACLE cost based optimizer는 bind variable 보다 literal value를
    사용하는 SQL에 대하여 보다 최적화된 execution plan을 결정하게 된다.
    하지만 과도한 literal SQL문들을 사용하게 되면 hard parsing 이
    빈번하게 되고 library cache와 dictionary cache의 사용율을 높이게 된다.
    2. Library cahe hit ratio
    SELECT to_char(trunc(sum(reloads)/sum(pins)*100, 5),99.99999)||
    '%(less than 1%)' "Library Cache MISS RATIO"
    FROM v$librarycache
    만일 miss ratio가 1%보다 큰 경우 library cache miss를 줄이는 노력이
    필요하다. 예를 들어 적절한 크기의 shared pool을 사용하거나 dynamic SQL
    (literal SQL) 사용을 줄이도록 한다.
    3. Checking hash chain lengths
    SELECT hash_value, count(*)
    FROM v$sqlarea
    GROUP BY hash_value
    HAVING count(*) > 5
    위 query에 대한 결과가 없어야 한다. 만일 동일한 HASH_VALUE를 갖는
    sql 수가 많다면 다음의 query를 이용하여 이 hach chain에 의하여 관리되는
    sql 들을 확인하여 본다.
    대부분 literal sql문들에 의하여 이런 문제가 발생하는 경우가 많다.
    SELECT sql_text FROM v$sqlarea WHERE hash_value= <XXX>;
    4. Checking for high version counts
         SELECT      address, hash_value,
         version_count ,
    users_opening ,
    users_executing
    sql_text
    FROM v$sqlarea
    WHERE version_count > 10
    SQL의 version은 문장 상으로 완벽히 일치하지만 참조 object가 틀리는
    SQL문들을 의미한다. 만일 이해할 수 없을 정도의 version count를 갖는
    row가 있다면 한국 오라클 기술지원팀으로 문의하도록 한다.
    5. Finding statement/s which use lots of shared pool memory
    SELECT      substr(sql_text,1,40) "Stmt", count(*),
    sum(sharable_mem) "Mem",
    sum(users_opening) "Open",
    sum(executions) "Exec"
    FROM v$sql
    GROUP BY substr(sql_text,1,40)
    HAVING sum(sharable_mem) > <MEMSIZE>
    6. Allocations causing shared pool memory to be 'aged' out
    SELECT      *
    FROM      sys.x$ksmlru
    WHERE      ksmlrnum>0
    x$ksmlru는 shared pool의 object에 대한 list로 object 할당 시 age out된
    object 수에 정보를 담고 있어 age out으로 인한 응답율 저하나 latch
    병합들의 원인을 추적하는 데 유용하다.
    이 table은 8i부터 sys user로만 조회가 가능하며 한번 조회되면 reset된다.
    (x$ksmlru.ksmlrnum : Number of items flushed from the shared pool)
    Example
    Reference Documents
    -------------------

  • Flushing Database Buffer Cache

    I am trying out variants of a SQL statement in an attempt to tune it. Each variant involves joins across a different combination of tables, although some tables are common across all variants. In order to be able to do a valid comparison of the TKPROF outputs for the variants, I believe I need to flush the database buffer cache between variants so that the db block gets, consistent gets and physical reads parameters are true for each variant. By doing this, data retrieved for one variant is not already in the buffer cache for the next variant, thus not influencing the above parameters for the next variant.
    Is it possible to flush the buffer cache? The shared pool can be flushed with the ALTER SYSTEM FLUSH SHARED_POOL command. I've searched but have not been able to find an equivalent for the buffer cache. The NOCACHE option to the ALTER TABLE command only pushes retrieved data to the LRU list in the buffer cache, but does not remove it from the buffer cache.
    I'm hoping to be able to do this without bouncing the database between variants. It is a development instance, and I have it to myself after hours.

    Hi,
    I never tried this before, but if you want make a test you can try corrupt the block ID's returned by one of these queries below:
    Try corrupt the ID of the block containing the segment header
    select dbms_rowid.rowid_block_number(rowid) from hr.regions;
    Try corrupt one of the blocks returned by the query, which shows the ID of the block where each row is located
    select s.owner,t.ts#,s.header_file,s.header_block
    from
    v$tablespace t, dba_segments s
    where
    s.segment_name='REGIONS' and
    owner='HR' and
    t.name = s.tablespace_name;Legatti
    Cheers

  • Buffer Cache Sizing

    I'm using 9i Release 7 on Microsoft Windows Server 2003.
    I have searched on metalink but I'm going around in circles confusing myself.
    I have 4GB Physical RAM
    SGA MAX SIZE = 2600 MB
    BUFFER CACHE = 2048 MB
    SHARED POOL = 256 MB
    JAVA POOL = 152 MB
    LARGE POOL = 16MB
    Aggreagte PGA Target = 768 MB
    Currently, the parameters DB_KEEP_CACHE_SIZE & DB_RECYCLE_CACHE_SIZE is 0MB
    If I wish to take advantage of the DB_KEEP_CACHE_SIZE Parameter so that I can retain frequently queried data in the Buffer Cache, what would be the optimal size I can allocate for this Parameter given the SGA Size I have mentioned above.

    Can I ask the reason which forced you to tune DB_KEEP_CACHE_SIZE & DB_RECYCLE_CACHE_SIZE . Is your DB not performing well , Is there any
    issue raised by your users ? Is there any responce time issue ? or throughput issue ? If your DB is working fine , then there is no need to try such stuffs , you wish to use this settings , just because you read somewhere or people useally
    do it, som forum user suggested me to do this.
    hare krishna
    Alok

  • ASM Buffer Cache - which parameter is responsible for this?

    Env: Oracle 10.2.0.4.0 on Windows 2003 R2 32 bit
    In one of my testing databases, I saw this. Rest all databases (development and testing) do not have the component "ASM Buffer Cache".
    SQL> select component, current_size, user_specified_size from v$sga_dynamic_components;
    COMPONENT                          CURRENT_SIZE USER_SPECIFIED_SIZE
    shared pool                         553,648,128         209,715,200
    large pool                            4,194,304                   0
    java pool                             4,194,304                   0
    streams pool                                  0                   0
    DEFAULT buffer cache                360,710,144         314,572,800
    KEEP buffer cache                             0                   0
    RECYCLE buffer cache                          0                   0
    DEFAULT 2K buffer cache                       0                   0
    DEFAULT 4K buffer cache                       0                   0
    DEFAULT 8K buffer cache                       0                   0
    DEFAULT 16K buffer cache                      0                   0
    DEFAULT 32K buffer cache                      0                   0
    ASM Buffer Cache                              0         314,572,800I am not able to figure out from the component "ASM Buffer Cache" is coming in this list. Current_size is zero so its not of a concern actually but I was wondering which parameter enforces this value.
    Can anybody shed some light on this?
    Regards,
    Message was edited by:
    Satish Kandi
    Forgot to mention that we are not using ASM at all.

    I have some databases running on 10.2.0.3.0 (testing + dev) and others on 10.2.0.4.0 (dev databases) and I can see this component in all of them.
    I have no databases running at earlier versions of 10g so cannot confirm if it was there earlier too.
    With your hint of 11g in mind, I searched 11g documentation too and could not find any references to this component.

  • Shared Pool utilisation

    Hello Team:
    I ran a metalink script to report the shared pool utilization recently. I took this output when the database was on peak load.
    SQL> /
    Obj mem: 66435759 bytes (63.36MB)
    Shared sql: 324219036 bytes (309.2MB)
    Cursors: 341207073 bytes (325.4MB)
    Free memory: 67228508 bytes (64.11MB)
    Shared pool utilization (total): 468785754 bytes (447.07MB)
    Shared pool allocation (actual): 754974720bytes (720MB)
    Percentage Utilized: 91%
    does this mean I have to add more space to shared pool. If so what is the threshold value?
    Regards,
    Bala

    Bhawani nandan Prasad - Principal DBA -- See a to z diagnostics about Shared pool
    1. Memory     2
    a. Shared Pool     2
    1. Introduction     2
    2. Architecture     2
    3. Scripts for different DBA tasks:     5
    a.Measure object usage inside the shared pool and Tune shared pool     7
    b.Check reload problem in library cache     12
    c.Find the large queries in the shared pool library cache (using > 4mb each)     13
    d.Find objects that can be considered pining into the shared pool     13
    e.LRU work and objects were loaded and flushed     13
    f.How much are waiting for Library Cache Latch     14
    g.Queries identical but aren’t shared.     14
    h.Get Biggest chunk of free memory.     14
    i.Check the shared pool reserved size status     16
    j.When having multiple subheaps:     16
    k.Check shared pool at first glance quick diagnostics     17
    l.Memory Usage - object list level view     17
    m.Loads Number of times object has been loaded     17
    n.Check number of times and object has been executed     18
    o.Check shared pool in more details     18
    p.Library Cache Statistics     18
    q.Reserve Pool Settings     19
    r.Pinned Objects     19
    s.Finding literal SQL     19
    t.Finding the Library Cache hit ratio     19
    u. Row Cache Misses – Dictionary cache stats     19
    v. Checking hash chain lengths     20
    w. Checking for high version counts     20
    x. Finding statement/s which use lots of shared pool memory     20
    y. Allocations causing shared pool memory to be 'aged' out     21
    z. Issues in various Oracle Releases     21
    4. Terminology     22
    5. Oracle 11g Caching and Pooling – SQL Result Cache     27
    6. References     37
    2. SQL     38
    3. Statistics     38
    4. Wait events     38
    5. Schema     39
    6. General     39
    a. Scripts     39
    1. accept.sql     39
    1. Memory
    a. Shared Pool
    1. Introduction
    Shared pool is used to cache different types of data such as textual and executable forms of PL/SQL blocks and SQL statements, dictionary cache data, and other data in SGA. Additional shared memory needed in the SHARED POOL if using ASM storage. Gathering schema/database stats (table/index stats) makes database query performance better and it reduce utilization of shared pool. Hence, practice to schedule job to gather stats regularly which suites your database performance. If you use shared pool effectively you can reduce resource consumption in at least four ways
    1.     Parse overhead is avoided if the SQL statement is already in the shared pool. This saves CPU resources on the host and elapsed time for the end user.
    2.     Latching resource usage is significantly reduced, which results in greater scalability.
    3.     Shared pool memory requirements are reduced, because all applications use the same pool of SQL statements and dictionary resources.
    4.     I/O resources are saved, because dictionary elements that are in the shared pool do not require disk access.
    This sharable area of memory is managed as a sophisticated cache and heap manager rolled into one. It has 3 fundamental problems to overcome:
    1.     The unit of memory allocation is not a constant - memory allocations from the pool can be anything from a few bytes to many kilobytes
    2.     Not all memory can be 'freed' when a user finishes with it (as is the case in a traditional heap manager) as the aim of the shared pool is to maximize share of information. The information in the memory may be useful to another session - Oracle cannot know in advance if the items will be of any use to anyone else or not.
    3.     There is no disk area to page out to so this is not like a traditional cache where there is a file backing store. Only "rewriteable" information can be discarded from the cache and it has to be re-created when it is next needed.
    Oracle 10g architecture of Shared pool:
    Library Cache     Shared SQL Area (Hash Value, SQL source, Execution plan)
    Data Dictionary Cache
    Enqueues     Fixed Area     Other
    Latches          
    Oracle 11g architecture of Shared pool:
    Library Cache     Shared SQL Area (Hash Value, SQL source, Execution plan)
    Data Dictionary Cache
    Result Cache
    Enqueues     Fixed Area     Other
    Latches          
    1. Library Cache
    Shared Sql Area: contains Parsed SQL and execution Plans for statements already run against the database. This area allows SQL execution plans to be reused by many users.
    Private SQL Area: Private SQL areas are non-shared memory areas assigned to unique user sessions.
    Pl/sql Area: contains the recently executed Procedures, Functions and Packages.
    Control Structures: Common control structure information example Memory for Latches and locks, sequence cache.
    2. Dictionary cache known as the row cache.
    Dictionary cache stores all the metadata info of tables and views in the database, Names and data types of the columns in the database, Object and system privileges of all the Users. Oracle maintains the stats of all the objects in the shared pool, if any of the memory objects are not used from the last 3 seconds, these memory objects will be aged out and will be removed from the cache. All the Shared Pool Structures are maintained by a LRU (least recently Used) algorithm, by which Oracle removes the objects from the shared Pool, until there is enough free space in the shared Pool to keep new Object.
    3. Scripts for different DBA tasks:
    Dictionary Views for shared POOL:
    NON-RAC
    V$DB_CACHE_ADVICE
    V$DB_OBJECT_CACHE
    V$DLM_LATCH
    V$DLM_LOCKS
    V$LATCH
    V$LATCHHOLDER
    V$LATCHNAME
    V$LATCH_CHILDREN
    V$LATCH_MISSES
    V$LATCH_PARENT
    V$LIBRARYCACHE
    V$LOCK
    V$LOCKED_OBJECT
    V$LOCKS_WITH_COLLISIONS
    V$LOCK_ACTIVITY
    V$LOCK_ELEMENT
    V$OPEN_CURSOR
    V$PROCESS
    V$PX_PROCESS
    V$PX_PROCESS_SYSSTAT
    V$PX_SESSION
    V$PX_SESSTAT
    V$ROWCACHE
    V$ROWCACHE_PARENT
    V$ROWCACHE_SUBORDINATE
    V$SESSION
    V$SESSION_CONNECT_INFO
    V$SESSION_CURSOR_CACHE
    V$SESSION_EVENT
    V$SESSION_LONGOPS
    V$SESSION_OBJECT_CACHE
    V$SESSION_WAIT
    V$SESSTAT
    V$SESS_IO
    V$SGA
    V$SGASTAT
    V$SGAINFO
    V$SGA_DYAMIC_COMPONENTS
    V$SGA_DYNAMIC_FREE_MEMORY
    V$SGA_RESIZE_OPS
    V$SGA_CURRENT_RESIZE_OPS
    v$shared_pool_advice
    V_$SHARED_POOL_ADVICE
    V$SHARED_POOL_RESERVED
    V$SHARED_SERVER
    V$SORT_SEGMENT
    V$SORT_USAGE
    V$SQL
    V$SQLAREA
    V$SQLTEXT
    V$SQLTEXT_WITH_NEWLINES
    V$SQL_BIND_DATA
    V$SQL_BIND_METADATA
    V$SQL_CURSOR
    V$SQL_SHARED_CURSOR
    V$SQL_SHARED_MEMORY
    V$STATNAME
    V$SUBCACHE
    V$SYSSTAT
    V$SYSTEM_CURSOR_CACHE
    V$SYSTEM_EVENT
    V$SYSTEM_PARAMETER
    X$KSMSP
    RAC
    GV$LATCH
    GV$LATCHHOLDER
    GV$LATCHNAME
    GV$LATCH_CHILDREN
    GV$LATCH_MISSES
    GV$LATCH_PARENT
    GV$LIBRARYCACHE
    GV$LOCK
    GV$LOCKED_OBJECT
    GV$LOCKS_WITH_COLLISIONS
    GV$LOCK_ACTIVITY
    GV$LOCK_ELEMENT
    GV$PROCESS
    GV$PX_PROCESS
    GV$PX_PROCESS_SYSSTAT
    GV$PX_SESSION
    GV$PX_SESSTAT
    GV$ROWCACHE
    GV$ROWCACHE_PARENT
    GV$ROWCACHE_SUBORDINATE
    GV$SESSION
    GV$SESSION_CONNECT_INFO
    GV$SESSION_CURSOR_CACHE
    GV$SESSION_EVENT
    GV$SESSION_LONGOPS
    GV$SESSION_OBJECT_CACHE
    GV$SESSION_WAIT
    GV$SESSTAT
    GV$SESS_IO
    GV$SGA
    GV$SGASTAT
    gv$shared_pool_advice
    GV$SHARED_POOL_RESERVED
    GV$SHARED_SERVER
    GV$SORT_SEGMENT
    GV$SORT_USAGE
    GV$SQL
    GV$SQLAREA
    GV$SQLTEXT
    GV$SQLTEXT_WITH_NEWLINES
    GV$SQL_BIND_DATA
    GV$SQL_BIND_METADATA
    GV$SQL_CURSOR
    GV$SQL_SHARED_CURSOR
    GV$SQL_SHARED_MEMORY
    GV$STATNAME
    GV$SUBCACHE
    GV$SYSSTAT
    GV$SYSTEM_CURSOR_CACHE
    GV$SYSTEM_EVENT
    GV$SYSTEM_PARAMETER
    GV$WAITSTAT
    GV$_LOCK
    a.Measure object usage inside the shared pool and Tune shared pool
    set pagesize 132
    column owner format a16
    column name format a36
    column sharable_mem format 999,999,999
    column executions format 999,999,999
    prompt
    prompt Memory Usage of Shared Pool Order - Biggest First
    prompt
    column name format 45
    select owner, name||' - '||type name, sharable_mem from v$db_object_cache
    where sharable_mem > 10000
    and type in ('PACKAGE', 'PACKAGE BODY', 'FUNCTION', 'PROCEDURE')
    order by sharable_mem desc
    prompt
    prompt Loads into Shared Pool - Most Loads First
    prompt
    select owner, name||' - '||type name, loads , sharable_mem from v$db_object_cache
    where loads > 3
    and type in ('PACKAGE', 'PACKAGE BODY', 'FUNCTION', 'PROCEDURE')
    order by loads desc
    prompt
    prompt Executions of Objects in the Shared Pool - Most Executions First
    prompt
    select owner, name||' - '||type name, executions from v$db_object_cache
    where executions > 100
    and type in ('PACKAGE', 'PACKAGE BODY', 'FUNCTION', 'PROCEDURE')
    order by executions desc
    select 'If the values for the EXEC and LOADS close increase SHARED_POOL_SIZE!' from dual ;
    set feedback off
    set linesize 80
    set pagesize 52
    clear columns
    clear breaks
    col executions HEADING EXEC
    col sharable_mem heading SHAMEM
    col owner format a8
    col name format a30
    col type format a12
    set numwidth 8
    ttitle center 'Data Base Objects Owned by All Users Statistics' skip 2
    select name, type, sharable_mem, loads, executions, pins
    from sys.v_$db_object_cache ;
    b.Check reload problem in library cache
    select namespace, pins, reloads from v$librarycache;
    show parameters shared_pool
    select bytes/1024/1024 from v$sgastat where pool='shared pool' and name='free memory';
    c.Find the large queries in the shared pool library cache (using > 4mb each)
    SELECT sql_text "Stmt", count(*), sum(sharable_mem) "Mem",
    sum(users_opening) "Open", sum(executions) "Exec"
    FROM v$sql GROUP BY sql_text HAVING sum(sharable_mem) > 4096000;
    d.Find objects that can be considered pining into the shared pool
    column name format a40
    column owner format a15
    select owner, name, executions, locks, pins, loads, kept from v$db_object_cache where loads > 10;
    create temp table and insert records of candidates to be pinned.
    CREATE TABLE LRU_TMP AS SELECT * FROM X$KSMLRU;
    INSERT INTO LRU_TMP SELECT * FROM X$KSMLRU;
    Use the LRU_TMP table for analysis.
    SELECT USERNAME, KSMLRCOM, KSMLRHON, KSMLRNUM, KSMLRSIZ, SQL_TEXT
    FROM V$SQLAREA A, LRU_TMP K, V$SESSION S WHERE KSMLRSIZ > 3000
    AND A.ADDRESS=S.SQL_ADDRESS AND A.HASH_VALUE = S.SQL_HASH_VALUE
    AND SADDR=KSMLRSES;
    You can see the candidates to pin from the query below
    COL STORED_OBJECT FORMAT A40;
    COL SQ_EXECUTIONS FORMAT 999,999;
    SELECT /*+ ORDERED USE_HASH(D) USE_HASH(C) */ O.KGLNAOWN||’.'||O.KGLNAOBJ STORED_OBJECT, SUM(C.KGLHDEXC) SQL_EXECUTIONS
    FROM SYS.X$KGLOB O, SYS.X$KGLRD D, SYS.X$KGLCURSOR C
    WHERE
    O.INST_ID = USERENV(’INSTANCE’) AND
    D.INST_ID = USERENV(’INSTANCE’) AND
    C.INST_ID = USERENV(’INSTANCE’) AND
    O.KGLOBTYP IN (7, 8, 9, 11, 12) AND
    D.KGLHDCDR = O.KGLHDADR AND
    C.KGLHDPAR = D.KGLRDHDL
    GROUP BY O.KGLNAOWN, O.KGLNAOBJ
    HAVING SUM(C.KGLHDEXC) > 0
    ORDER BY 2 DESC;
    How to pin object
    EXECUTE SYS.DBMS_SHARED_POOL.SIZES(150);
    EXECUTE SYS.DBMS_SHARED_POOL.KEEP('SYS.STANDARD');
    EXECUTE SYS.DBMS_SHARED_POOL.UNKEEP('SYS.STANDARD');
    e.LRU work and objects were loaded and flushed
    LRU work in the shared pool KSMLRNUM stores the number of objects that were flushed to load the large object. KSMLRISZ stores the size of the object that was loaded (contiguous memory allocated)
    column ksmlrcom format a20
    column username format a5
    select username,sid,KSMLRCOM,KSMLRSIZ,KSMLRNUM, KSMLRHON, KSMLROHV, KSMLRSES from x$ksmlru , v$session where KSMLRSES=SADDR and KSMLRNUM >2 ;
    f.How much are waiting for Library Cache Latch
    select count(*),event from v$session_wait where event not like '%SQL%' and event not like '%ipc%' and event not like '%timer%' GROUP BY EVENT;
    select count(*),wait_time from v$session_wait where event='latch free' and p2=106 group by wait_time;
    select sid,wait_time,seconds_in_wait from v$session_wait where event='latch free' and p2=106 and WAIT_TIME>1;
    g.Queries identical but aren’t shared.
    SELECT address, hash_value, version_count , users_opening , users_executing,
    substr(sql_text,1,240) "SQL" FROM v$sqlarea WHERE version_count > 10;
    h.Get Biggest chunk of free memory.
    select sysdate, decode( sign(ksmchsiz - 812), -1, (ksmchsiz - 16) / 4,
    decode(sign(ksmchsiz - 4012),-1, trunc((ksmchsiz + 11924) / 64),
    decode(sign(ksmchsiz - 65548), -1, trunc(1/log(ksmchsiz - 11, 2)) + 238,254))) bucket,
    sum(ksmchsiz) free_space, count(*) free_chunks, trunc(avg(ksmchsiz)) average_size,
    max(ksmchsiz) biggest from x$ksmsp
    where inst_id = userenv('Instance') and ksmchcls = 'free' group by
    decode(sign(ksmchsiz - 812),-1, (ksmchsiz - 16) / 4,
    decode(sign(ksmchsiz - 4012),-1, trunc((ksmchsiz + 11924) / 64),
    decode(sign(ksmchsiz - 65548),-1, trunc(1/log(ksmchsiz - 11, 2)) + 238,254 ))) ;
    SELECT KSMCHCLS CLASS, COUNT(KSMCHCLS) NUM, SUM(KSMCHSIZ) SIZ,
    To_char( ((SUM(KSMCHSIZ)/COUNT(KSMCHCLS)/1024)),’999,999.00′)||’k’ “AVG SIZE”
    FROM X$KSMSP GROUP BY KSMCHCLS;
    CLASS     NUM     SIZ     AVG SIZE
    freeabl     19010     34519404     1.77k
    recr     23581     24967956     1.03k
    R-freea     68     1632     .02k
    perm     22     39801268     1,766.75k
    R-free     34     7238192     207.90k
    free     2389     36075980     14.75k
    Watch for trends using these guidelines:
    a) if ‘free’ memory is low (less than 5mb or so) you may need to increase the shared_pool_size and shared_pool_reserved_size. You should expect ‘free’ memory to increase and decrease over time. Seeing trends where ‘free’ memory decreases consistently is not necessarily a problem, but seeing consistent spikes up and down could be a problem.
    b) if ‘freeable’ or ‘perm’ memory continually grows then it is possible you are seeing a memory bug.
    c) if ‘freeabl’ and ‘recr’ memory classes are always huge, this indicates that you have a lot of cursor info stored that is not releasing.
    d) if ‘free’ memory is huge but you are still getting 4031 errors, the problem is likely reloads and invalids in the library cache causing fragmentation.
    -Note says that this query can hang database on HP platforms
    See the shared pool parameters
    column name format a30
    select name,value from v$parameter where name like '%shared_pool%' ;
    select x.ksppinm, y.ksppstvl from x$ksppi x , x$ksppcv y where x.indx = y.indx and lower(x.ksppinm) like '%spin%';
    SELECT count(*) FROM v$latch_children WHERE NAME = 'library cache';
    Shrinking and growing operations from V$SGA_RESIZE_OPS dynamic view:
    select to_char(end_time, ‘dd-Mon-yyyy hh24:mi’) end, oper_type, initial_size, target_size, final_size from V$SGA_RESIZE_OPS where component=’shared pool’ order by end;
    #shared_pool_summary.sql -get an overview of chunks in the shared pool
    select
    ksmchcom contents,
    count(*) chunks,
    sum(decode(ksmchcls, 'recr', ksmchsiz)) recreatable,
    sum(decode(ksmchcls, 'freeabl', ksmchsiz)) freeable,
    sum(ksmchsiz) total
    from
    sys.x_$ksmsp
    where
    inst_id = userenv('Instance') and
    ksmchcls not like 'R%'
    group by
    ksmchcom
    #reserved_pool_summary.sql - get an overview of chunks in the reserved pool
    select
    ksmchcom contents,
    count(*) chunks,
    sum(decode(ksmchcls, 'R-recr', ksmchsiz)) recreatable,
    sum(decode(ksmchcls, 'R-freea', ksmchsiz)) freeable,
    sum(ksmchsiz) total
    from
    sys.x_$ksmspr
    where
    inst_id = userenv('Instance')
    group by
    ksmchcom
    #save_sqlplus_settings.sql -reset sqlplus settings
    set termout off
    store set sqlplus_settings replace
    clear breaks
    clear columns
    clear computes
    set feedback off
    set verify off
    set termout on
    set define "&"
    #restore_sqlplus_settings.sql -reset sqlplus settings
    set termout off
    @sqlplus_settings
    clear breaks
    clear columns
    clear computes
    set termout on
    i.Check the shared pool reserved size status
    SELECT free_space, avg_free_size, used_space, avg_used_size, REQUEST_MISSES, request_failures, last_miss_size FROM v$shared_pool_reserved;
    An ORA-04031 error referencing large failed requests, indicates the Reserved Area is too fragmented. The reserved pool is small when: REQUEST_FAILURES > 0 (and increasing), The DBA should Increase shared_pool_reserved_size and shared_pool_size together. It is possible that too much memory has been allocated to the reserved list. The DBA should Decrease shared_pool_reserved_size, If: REQUEST_MISS = 0 or not increasing
    FREE_MEMORY = > 50% of shared_pool_reserved_size minimum
    col free_space for 999,999,999,999 head “TOTAL FREE”
    col avg_free_size for 999,999,999,999 head “AVERAGE|CHUNK SIZE
    col free_count for 999,999,999,999 head “COUNT”
    col request_misses for 999,999,999,999 head “REQUEST|MISSES
    col request_failures for 999,999,999,999 head “REQUEST|FAILURES”
    col max_free_size for 999,999,999,999 head “LARGEST CHUNK”
    select free_space, avg_free_size, free_count, max_free_size, request_misses, request_failures from v$shared_pool_reserved;
    TOTAL FREE     AVERAGE
    CHUNK SIZE     COUNT     LARGEST CHUNK     REQUEST
    MISSES     REQUEST
    FAILURES
    7,238,192     212,888     34     212,888     0     0
    You should also use hidden and unsupported parameter “_shared_pool_reserved_pct” to control reserved pool. This parameter controls the allocated percentage of shared pool for reserved pool. By default it is %5 of the shared pool and if you use ASMM for memory management you can set this value higher like 10 to allocate reserved pool dynamically. When you set the parameter you will see the shared_pool_reserved_size parameter will be adjusted to the new setting. The parameter can not be modified when instance is started. You can use the query below to see the current value
    select a.ksppinm “Parameter”, b.ksppstvl “Session Value”, c.ksppstvl “Instance Value” from sys.x$ksppi a, sys.x$ksppcv b, sys.x$ksppsv c where a.indx = b.indx and a.indx = c.indx and a.ksppinm = ‘_shared_pool_reserved_pct’;
    Parameter     Session Value     Instance Value
    sharedpool_reserved_pct     10     10
    j.When having multiple subheaps:
    select KSMCHIDX, ksmchcom ChunkComment,
    decode(round(ksmchsiz/1000),0,'0-1K', 1,'1-2K', 2,'2-3K', 3,'3-4K',4,'4-5K',5,'5-6k',6,'6-7k',7,'7-8k',8,'8-9k', 9,'9-10k', '> 10K'), count(*), ksmchcls Status, sum(ksmchsiz) Bytes
    from x$ksmsp where KSMCHCOM = 'free memory' group by KSMCHIDX,ksmchcom, ksmchcls, decode(round(ksmchsiz/1000),0,'0-1K', 1,'1-2K', 2,'2-3K', 3,'3-4K',4,'4-5K',5,'5-6k',6,'6-7k',7,'7-8k',8,'8-9k', 9,'9-10k','> 10K');
    SubPool     SGA_HEAP     CHUNKCOMMENT     size     COUNT(*)     STATUS     BYTES
    1     sga heap(1,0)     free memory     > 10K     34     R-free     7238192
    1     sga heap(1,0)     free memory     3-4K     2     free     6284
    1     sga heap(1,0)     free memory     > 10K     241     free     35707400
    1     sga heap(1,0)     free memory     8-9k     1     free     7712
    1     sga heap(1,0)     free memory     2-3K     4     free     6752
    1     sga heap(1,0)     free memory     0-1K     2090     free     133288
    1     sga heap(1,0)     free memory     9-10k     21     free     188676
    1     sga heap(1,0)     free memory     1-2K     30     free     25868
    If you see lack of large chunks it is possible that you can face with ORA-04031 in near future.
    k.Check shared pool at first glance quick diagnostics
    select 'You may need to increase the SHARED_POOL_RESERVED_SIZE' Description, 'Request Failures = '||REQUEST_FAILURES Logic
    from      v$shared_pool_reserved where      REQUEST_FAILURES > 0
    and      0 != (select      to_number(VALUE) from      v$parameter
    where      NAME = 'shared_pool_reserved_size')
    union
    select 'You may be able to decrease the SHARED_POOL_RESERVED_SIZE' Description,'Request Failures = '||REQUEST_FAILURES Logic
    from      v$shared_pool_reserved where      REQUEST_FAILURES < 5
    and      0 != (select      to_number(VALUE) from      v$parameter
         where      NAME = 'shared_pool_reserved_size')
    l.Memory Usage - object list level view
    •     Owner - Owner of the object
    •     Object - Name/namespace of the object
    •     Sharable Memory - Amount of sharable memory in the shared pool consumed by the object
    select OWNER, NAME||' - '||TYPE object,SHARABLE_MEM
    from      v$db_object_cache where SHARABLE_MEM > 10000
    and     type in ('PACKAGE','PACKAGE BODY','FUNCTION','PROCEDURE')
    order by owner asc ,SHARABLE_MEM desc
    SELECT * FROM (SELECT ROW_NUMBER () over (PARTITION BY NAMESPACE ORDER BY SHARABLE_MEM DESC) ROW_within , NAMESPACE, SHARABLE_MEM, SUBSTR(NAME,1,40) NAME FROM V$DB_OBJECT_CACHE ORDER BY SHARABLE_MEM DESC) WHERE ROW_WITHIN <= 2 ORDER BY NAMESPACE, ROW_WITHIN;
    ROW_WITHIN NAMESPACE SHARABLE_MEM NAME
    1 CLUSTER 2794 C_OBJ#_INTCOL#
    2 CLUSTER 1684 SMON_SCN_TO_TIME
    1 RSRCPLAN 5117 SYS_GROUP

  • What server side objects to pin in shared pool?

    On the first invocation of Java-based image.process(...), processing can take up to 30 seconds. Second run takes less than a second, but a final invocation a few hours later is back to 30 seconds. My DBA suspects that the server side objects are cached in the shared pool by the time of the second invocation, and then flushed out by the time the code is run a few hours later.
    We tried "pinning" ORDSYS.OrdImage pl/sql package in the shared pool using dbsm_shared_pool.keep , but no success. What are the the Java server-side objects referred to the Intermedia Java Client that really does the work when the client-side image.process(..) is executed?
    Thanks,
    Brandon

    hi Mr.kesavan!
    i tried .but i am getting some error.
    when i give lookup (jndi) that time it is giving some error.
    for example :
    ic.lookup("Bean2");exactly this line i am getting some unmarshalling error.
    Can u give me some sample code.?
    thank u...
    Shalinipriya.

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Unix buffer cache vs oracle database buffer cache

    1. What difference between operating system buffer cache and oracle buffer cache?
    2. In what case, oracle is using oracle buffer cache? in what case, oracle doesn't use buffer cache instead of using OS buffer cache.
    I am confused about this concept.
    Appreciate any help.
    S.

    ski123 wrote:
    1. What difference between operating system buffer cache and oracle buffer cache?
    2. In what case, oracle is using oracle buffer cache? in what case, oracle doesn't use buffer cache instead of using OS buffer cache.
    I am confused about this concept.
    Appreciate any help.
    S.I am not sure that where is the confusion. Oracle's buffer cache would be an inevitable since whatever would be accessed in the oracle database , would have to go through the buffer cache. Though this can be bypassed as well but that's only for a specific purpose. If you won't be using the buffer cache, how else the data would be given to the end user? It has to go through the buffer cache since the data is retrieved not just for one time access but for the future access as well. And the buffer cache stores that data for the future requests also.
    The o/s cache is , well, for the o/s. So once the buffer leaves from the oracle ecosystem, it would be there. What exactly you want to compare between two and why here?
    Aman....

  • Buffer, library,dictionary, shared pool, redo log buffer chache hit ratios

    Can please one provide information and sql queries to calculate Buffer, library,dictionary, shared pool, redo log buffer chache hit ratios and if any other ratio for investigation of performance issues in oracle 10g database (10g.1 and 10g.2 both). thanks in advance.

    In and by themselves most of the standard ratio calculations are useless to misleading. All the ratios should always be considered in relation to other data such as total requests for a resource, existence of any outlying values in the associated events, etc ....
    The proper warning being given then you can find most of the standard ratios mentioned with SQL for their calculation in the Performance and Tuning manual for your version of Oracle.
    HTH -- Mark D Powell --

Maybe you are looking for

  • Windows 8.1 pro and itunes 12.1.1.4 not compatible???

    After a weekend of frustration downloading, uninstall, internet tips i cannot get iTunes 12.1.1.4 to open on my windows PC running 8.1 pro.  There must be a fix but I can't find it.  Many others are Experiencing the same issue.

  • Premiere Trial doesn't work with P2???

    I downloaded the trial version before I spend the $799, and it does not support HDV. Is that feature not available in the trial? I'm trying to import MXF files from the P2 card and it says File Format not Supported. But according to Adobe's website i

  • Not able to start BI Server on AIX 6. Getting Locale error

    Hi, I have a fresh installation of OBIEE 10.2 on AIX 6 server. The installation went successfully and all the prechecks were successful with one warning about AIX release. Which I believe we can ignore as AIX 6 recently been released way long after r

  • Error when add/ drop new logfile

    When I drop or add new logfile in my 10g r2 on RHEL, I did not see any error. however when I check the alert log file, I noticed at the same time of dropping or adding the logfile, systen produced three error .trc files in the udumpa and display erro

  • HT201303 i forgot my security answers. how do i change them

    i forgot my security answers. how do i change them