了解Maclean Liu|向Maclean Liu提问 Oracle ALLSTARS 全明星(群内有多位Oracle高级售后support,N位OCM和ACE) QQ群 # QQ群号:23549328 # 已经升级到 2000人群,空位多多。欢迎有一定基础的Oracle骨友加入,现在入群需要经过Maclean的技术面试,欢迎面试,请加QQ号:47079569 为好友参加面试 2群基础群 适合刚入门的同学,会共享最佳入门实践和资料 QQ群 # QQ群号:171092051 # 已经升级到 500人的超级群,空位多多,无需面试

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

posted on 2013-03-19 00:32  Oracle和MySQL  阅读(148)  评论(0编辑  收藏  举报

导航