Oracle的X$表系列介绍之-X$KSLLCLASS

类别:数据库 点击:0 评论:0 推荐:
Oracle的X$表系列介绍之-X$KSLLCLASS 作者:eygle 出处:http://blog.eygle.com 日期:January 16, 2005

« HRAY纳斯达克的IPO历程 | Blog首页 | Windows Xp中如何设置自动登录 »

X$KSLLCLASS--[K]ernel [S]ervice [L]ock [L]atches [CLASS]

从Oracle9iR2开始,Oracle允许对Latch进行分类,不同的分类可以用于不同的_SPIN_COUNT值。
这就避免了之前版本,一旦修改_SPIN_COUNT参数就会影响所有Latch的问题。从而可以在一定程度上控制该参数对于CPU的过量耗用。

以下是x$ksllclass的查询输出:

SQL> select indx, spin, yield, waittime from x$ksllclass; INDX SPIN YIELD WAITTIME ---------- ---------- ---------- ---------- 0 20000 0 1 1 20000 0 1 2 20000 0 1 3 20000 0 1 4 20000 0 1 5 20000 0 1 6 20000 0 1 7 20000 0 1 8 rows selected.

比如我们的数据库系统经历较为严重的cache buffers chains竞争,为了降低其SLEEEP次数,我们可以对该Latch进行针对性分类邦定,单独修改其_SPIN_COUNT值。

SQL> select latch#,name from v$latchname where name='cache buffers chains'; LATCH# NAME ---------- ---------------------------------------------------------------- 98 cache buffers chains


我们可以如下修改初始化参数,而后重新启动数据库:

_latch_class_1 = "10000"
_latch_classes = "98:1"

SQL> select latch#,name from v$latchname where name='cache buffers chains'; LATCH# NAME ---------- ---------------------------------------------------------------- 98 cache buffers chains SQL> alter system set "_latch_class_1"=10000 scope=spfile; System altered. SQL> alter system set "_latch_classes"="98:1" scope=spfile; System altered. SQL> startup force; ORACLE instance started. Total System Global Area 80811208 bytes Fixed Size 451784 bytes Variable Size 37748736 bytes Database Buffers 41943040 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SQL> show parameter latch NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ _latch_class_1 string 10000 _latch_classes string 98:1 SQL> select indx, spin, yield, waittime from x$ksllclass; INDX SPIN YIELD WAITTIME ---------- ---------- ---------- ---------- 0 20000 0 1 1 10000 0 1 2 20000 0 1 3 20000 0 1 4 20000 0 1 5 20000 0 1 6 20000 0 1 7 20000 0 1 8 rows selected. SQL>

由此,单独控制一些重要Latch成为可能。

SQL> select a.kslldnam, b.kslltnum, b.class_ksllt 2 from x$kslld a, x$ksllt b 3 where a.kslldadr = b.addr 4 and b.class_ksllt > 0; KSLLDNAM KSLLTNUM CLASS_KSLLT ---------------------------------------------- ---------- ----------- process allocation 3 2 cache buffers chains 98 1


更多请参考:
Richmond Shee, Kirtikumar Deshpande and K Gopalakrishnan的《Oracle Wait Interface》

本文地址:http://com.8s8s.com/it/it19557.htm