zoukankan      html  css  js  c++  java
  • Know More About Libarary Cache and Latches

    Stored objects And Transient objects are stored in the library cache, neither Temporary objects nor Permanent objects. The library cache is structured as a Hash table .But Library cache objects are composed of data heaps. Oracle access hash tables through hash buckets. SHARED_POOL_SIZE does the Oracle server determine the number of hash tables. When the the shared pool is larger, it can accommodate more object handles. _KGL_BUCKET_CNT can be used to set the number of hash buckets and deprecated. The minimum size of the hash table is 509 buckets in ORACLE 7. For performance reasons, when the linked list has an average depth of 2 the Oracle server doubles the size of the hash table. Locks manage concurrency whereas pins manage cache coherency. There are two valid library cache pin modes: Share and Exclusive An object handle is protected by a latch determined by the bucket it hashes into using the formula latch# = mod(bucket#, #latches) . The hidden parameter _KGL_LATCH_COUNT is used to determine the number of child latches."The default value should be adequate, but if contention for the library cache latch cant be resolved, it may be advisable to increase this value. The default value for _KGL_LATCH_COUNT is the next prime number after CPU_COUNT. This value cannot exceed 66 (See: <>). " Begin 10.2.0.2, mutex take place cursor pin latch.To avoid using Mutex latches, you can set _kks_use_mutex_pin=false . CURSOR_SPACE_FOR_TIME has been deprecated in 10.2.0.5 and 11.1.0.7. CURSOR_SPACE_FOR_TIME was originally introduced to try and help reduce latch contention by keeping cursors in memory in the SGA rather than allowing their data to be flushed from the shared pool. Such latch contention is avoided in current releases by the use of cursor mutexes and so this parameter is no longer relevant. v$open_cursor lists kinds of library cache lock,x$kgllk – Details about Object locks
    
    v$open_cursor
    
    select inst_id,
           kgllkuse,
           kgllksnm,
           user_name,
           kglhdpar,
           kglnahsh,
           kgllksqlid,
           kglnaobj,
           kgllkest,
           decode(kgllkexc, 0, to_number(NULL), kgllkexc),
           kgllkctp
      from x$kgllk
     where kglhdnsp = 0
       and kglhdpar != kgllkhdl
    
    
    SQL> select distinct kgllkctp from x$kgllk ;
    
    KGLLKCTP
    --------------------------------------------
    SESSION CURSOR CACHED
    PL/SQL CURSOR CACHED
    OPEN
    OPEN-RECURSIVE
    DICTIONARY LOOKUP CURSOR CACHED
    
    
  • 相关阅读:
    springboot内置分页技术
    打印正三角,倒三角,实心棱形,空心棱形
    显示Pl/Sql Developer window list窗口
    Oracle 中使用正则表达式
    前端使用pdf.js预览pdf文件,超级简单
    tomcat8踩坑:url包含|等特殊字符报错400的问题
    使用 Itext 生成PDF字节数组(文件流不落地)
    使用 Itext 生成PDF
    回车提交事件
    python爬虫之re正则表达式库
  • 原文地址:https://www.cnblogs.com/macleanoracle/p/2967223.html
Copyright © 2011-2022 走看看