ITPub博客

首页 > 数据库 > Oracle > systemstat's dump

systemstat's dump

原创 Oracle 作者:imlihj2007 时间:2011-10-23 14:21:40 0 删除 编辑

sqlplus -prelim / as sysdba
oradebug setmypid
oradebug unlimit;
oradebug dump systemstate 10
如果希望在数据库发生某种错误时调用systemstate事件,可以在参数文件(spfile或者pfile)中设置event参数,
例如,当系统发生死锁(出现ORA-00060错误)时dump systemstate:
event = "60 trace name systemstate level 10"


LEVEL参数:
10 Dump all processes (IGN state)
5 Level 4 + Dump all processes involved in wait chains (NLEAF state)
4 Level 3 + Dump leaf nodes (blockers) in wait chains (LEAF,LEAF_NW,IGN_DMP state)
3 Level 2 + Dump only processes thought to be in a hang (IN_HANG state)
1-2 Only HANGANALYZE output, no process dump at all

1、标准的state object header(SO)
state object header中包含了一些基本的信息,比如:
SO: c00004ti4jierj, type: 2. owner: 0000000000, flag: init/-/-/0×00
其中SO是state object的号码;
type表示state object的类别;
TYPE: state object的已知类别:
2 process(进程)
3 call
4 session(会话信息
5 enqueue(锁信息)
6 file infomation block(文件信息块,每个FIB标识一个文件)
11 broadcast handle(广播消息句柄)
12 KSV slave class state
13 ksvslvm
16 osp req holder(会话执行os操作的holder)
18 enqueue resource detail(锁资源详细资料)
19 ges message(ges消息)
20 namespace [ksxp] key
24 buffer [db buffer]
36 dml lock
37 temp table lock(临时表锁)
39 list of blocks(用于block cleanout的块列表清单)
40 transaction(事务)
41 dummy
44 sort segment handle(排序段句柄)
50 row cache enqueue
52 user lock
53 library cache lock
54 library cache pin
55 library cache load lock
59 cursor enqueue
61 process queue
62 queue reference
75 queue monitor sob

3、session state object
flag的位图如下:
KSUSFUSR 0×00000001 user session (as opposed to recursive session)
KSUSFREC 0×00000002 recursive session(always internal)
KSUSFAUD 0×00000004 audit logon/logoff,used by cleanup
KSUSFDCO 0×00000008 disable commit/rollback from plsql
KSUSFSYS 0×00000010 user session created by system processes
KSUSFSGA 0×00000020 whether UGA is allocate in sga
KSUSFLOG 0×00000040 whether user session logs on to ORACLE
KSUSFMSS 0×00000080 user session created by multi-stated server
KSUSFDIT 0×00000100 disable (defer) interrupt
KSUSFCLC 0×00000200 counted for current license count decrement
KSUSFDET 0×00000400 session has been detached
KSUSFFEX 0×00000800 “forced exit”during shutdown normal
KSUSFCAC 0×00001000 (cloned) session is cached
KSUSFILS 0×00002000 default tx isolation level is serializable
KSUSFOIL 0×00004000 override serializable for READ COMMITTED
KSUSFIDL 0×00008000 idle session scheduler
KSUSFSKP 0×00010000 SKIP unusable indexes maintenance
KSUSFCDF 0×00020000 defer all deferrable constraint by default
KSUSFCND 0×00040000 deferable constraints are immediate
KSUSFIDT 0×00080000 session to be implicitly detached
KSUSFTLA 0×00100000 transaction audit logged
KSUSFJQR 0×00200000 recource checking in job q process enabled
KSUSFMGS 0×00400000 session is migratable
KSUSFGOD 0×00800000 migratable session need to get ownership id
KSUSFSDS 0×01000000 suppress/enable TDSCN computations
KSUSFMSP 0×02000000 parent of migratable session
KSUSFMVC 0×04000000 MV container update progress
KSUSFNAS 0×08000000 an NLS alter session call was done
KSUSFTRU 0×10000000 a trusted callout was performed
KSUSFHOA 0×20000000 an HO agent was called
KSUSFSTZ 0×40000000 an alter session set time_zone was done
KSUSFSRF 0×80000000 summary refresh


6、transaction dump
Transaction dump对应的oracle内存结构是KTCXB,可以通过X$KTCXB来了解更详细的情况。
flag的描述如下
1 allocated but no transaction
2 transaction active
4 state object no longer valid
8 transaction about to commit/abort
10 space management transaction
20 recursive transaction
40 no undo logging
80 no change/commit,must rollback
100 use system undo segment (0)
200 valid undo segment assigned
400 undo seg assigned,lock acquired
800 change may have been made
1000 assigned undo seg
2000 required lock in cleanup
4000 is a pseudo space extent
8000 save the tx table & tx ctl block
10000 no read-only optimize for 2pc
20000 multiple sess attached to this tx
40000 commit scn future set
80000 dependent scn future set
100000 dist call failed,force rollback
200000 remote uncoordinated ddl tx
400000 coordinated global tx
800000 pdml transaction
1000000 next must be commit or rollback
2000000 coordinator in pdml
4000000 disable block level recovery
8000000 library and/or row caches dirty
10000000 serializable transaction
20000000 waiting for unbound transaction
40000000 loosely coupled transaction branch
80000000 long-running transaction

flag2的描述如下(资料来源早期版本,针对10g可能略有不同):
1 tx needs refresh on commit
2 delete performed in tx
4 concurrency check enabled
8 insert performed
10 dir path insert performed
20 fast rollback on net disconnect
40 do not commit this tx
80 this tx made remote change
100 all read-only optim enabled

7、library object lock/handle
Flags的描述如下:
KGLLKBRO 0×0100 this lock is broken
KGLLKCBB 0×0200 this lock can be broken
KGLLKPNC 0×0400 “kgllkpnc” is a valid pin for the call
KGLLKPNS 0×0800 “kgllkpns” is a valid pin for the session
KGLLKCGA 0×1000 this lock is in CGA memory
KGLLKINH 0×2000 the instance lock is inherited
KGLLKLRU 0×4000 lock protects an object on the session cache lru
KGLLKKPC 0×8000 lock protects an object in the session keep cache
KGLLKRES 0×0010 reserved lock preventing handle from being freed
KGLLKCBK 0×0020 need to callback the client for delete/dump

So_Process_latch info_bits latch的含义? --latch的级别,但是都什么级别呢

[@more@]sys

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9879835/viewspace-1055893/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-05-25

  • 博文量
    109
  • 访问量
    1577024