如何阅读Oracle Errorstack Output(四)

2014-11-24 15:01:37 · 作者: · 浏览: 1
5e0
kgsccflg=0 llk[fffffd7ffdd0f388,fffffd7ffdd0f388] idx=0
xscflg=c0110676 fl2=1d120000 fl3=4228218c fl4=100
Bind bytecodes
Opcode = 6 Bind Rpi Scalar Sql In(may be out) Nocopy NoSkip
Offsi = 48, Offsi = 0
kkscoacd
Bind#0 www.2cto.com
oacdty=01 mxl=32(32) mxlc=00 mal=00 scl=00 pre=00
oacflg=13 fl2=206001 frm=01 csi=31 siz=32 off=0
kxsbbbfp=fffffd7ffdd31808 bln=32 avl=03 flg=09
value="SYS"
Frames pfr fffffd7ffdd3f8c0 siz=4488 efr fffffd7ffdd3f800 siz=4464
enxt: 3.0x000004b0 enxt: 2.0x00000020 enxt: 1.0x00000ca0
pnxt: 2.0x00000008 pnxt: 1.0x00000010
kxscphp fffffd7ffddc0388 siz=984 inu=472 nps=344
kxscbhp fffffd7ffdcef1a8 siz=1008 inu=120 nps=0
kxscwhp fffffd7ffddc0748 siz=10496 inu=6608 nps=6608
1.我们已经发现Cursor#6从trace file中,它的state=BOUND,意味着绑定变量值已经被赋予的。
2.SQL文本是我们在前面已经查找出来的,我们可以看到仅仅一个绑定变量值(它是被PL/SQL执行引擎自动的放置).
3.Bind variale numbering是从0开始,所以如果我们想去卡第一个绑定值,我们需要搜索Bind#0。
这是我们可以 系统化和很可靠的找到被使用的绑定变量值。
4.从errorstack trace file中发现一个cursor正在使用多少private memory(UGA)
最后,我们继续前面的例子,我们能够度量某个session的某些游标使用了多少UGA私有内存。
[html]
Cursor frame dump
enxt: 3.0x000004b0 enxt: 2.0x00000020 enxt: 1.0x00000ca0
pnxt: 2.0x00000008 pnxt: 1.0x00000010
kxscphp fffffd7ffddc0388 siz=984 inu=472 nps=344
kxscbhp fffffd7ffdcef1a8 siz=1008 inu=120 nps=0
kxscwhp fffffd7ffddc0748 siz=10496 inu=6608 nps=6608
在cursor frame dump部分我们可以看见kxsc开始的一些信息,这些意味着Kernel eXECUTION Shared Cursor。其中的每一行的siz告诉我们当前分配的私有内存大小。当然,我们需要汇总所有的siz,这个值就是此游标的memory usage。
下面是我的一些猜测汇总: www.2cto.com
[html]
Heap description Meaning
kxscphp Cursor permanent heap. Allocated when cursor is opened
kxscdfhp Cursor default heap - default duration allocations
kxscehp Cursor ephemeral heap - short lived duration allocations
kxscwhp Cursor Work heap - used when actually executing the cursor (workareas etc)
kxscbhp Cursor Bind heap - this is where bind variable values and their metadata are kept.
作者 Coast_lichao