以后看到一个记录一个,不然老是忘记。
1、X$KSMSP
名称含义为:
[K]ernal [S]torage [M]emory Management [S]GA Hea[P],其中每一行都代表着shared pool中的一个chunk
KSMCHCOM是注释字段,每个内存块被分配以后,注释会添加在该字段中.
x$ksmsp.ksmchsiz代表块大小
x$ksmsp.ksmchcls列代表类型,主要有四类,说明如下:
free
Free chunks--不包含任何对象的chunk,可以不受限制的被分配.
recr
Recreatable chunks--包含可以被临时移出内存的对象,在需要的时候,这个对象可以
被重新创建.例如,许多存储共享sql代码的内存都是可以重建的.
freeabl
Freeable chunks--包含session周期或调用的对象,随后可以被释放.这部分内存有时候
可以全部或部分提前释放.但是注意,由于某些对象是中间过程产生的,这些对象不能
临时被移出内存(因为不可重建).
perm
Permanent memory chunks--包含永久对象.通常不能独立释放.
我们可以通过查询x$ksmsp视图来考察shared pool中存在的内存片的数量
2、x$bh
这个代表是BUFFER CACHE 中每一个块的信息。
字段信息如下:
The meaning of state:
0 | FREE | no valid block image |
1 | XCUR | a current mode block, exclusive to this instance |
2 | SCUR | a current mode block, shared with other instances |
3 | CR | a consistent read (stale) block image |
4 | READ | buffer is reserved for a block being read from disk |
5 | MREC | a block in media recovery mode |
6 | IREC | a block in instance (crash) recovery mode |
tch: tch is the touch count. A high touch count indicates that the buffer is used often. Therefore, it will probably be at the head of the MRU list. See also touch count.
tim: touch time.
class represents a value designated for the use of the block.
lru_flag
set_ds maps to addr on x$kcbwds.
le_addr can be outer joined on x$le.le_addr.
flag is a bit array.
Bit | if set | |
0 | Block is dirty | |
4 | temporary block | |
9 or 10 | ping | |
14 | stale | |
16 | direct | |
524288 (=0x80000) | Block was read in a full table scan | See this link |
OBJ:应该就是OBJECT_ID。
x$kglpn
[K]ernel [G]eneric [L]ibrary [P]i[N]
dba_kgllock的基表
2.x$kglpn——[K]ernel [G]eneric [L]ibrary Cache Manager object [P]i[N]s
sys@ORALOCAL(192.168.0.22)> desc x$kglpn
##主要用来处理library cache pin holder
Name Null? Type
----------------------------------------------------- -------- ------------
ADDR RAW(4)
INDX NUMBER
INST_ID NUMBER
KGLPNADR RAW(4)
KGLPNUSE RAW(4)
KGLPNSES RAW(4)
KGLPNHDL RAW(4)
##关联v$session_wait中event为library cache pin的P1RAW,再关联v$session,可以查出sid和serial#
KGLPNLCK RAW(4)
KGLPNCNT NUMBER
KGLPNMOD NUMBER
##如果值为3,表示为library cache pin的holder;如果值为0,表示为waiter
KGLPNREQ NUMBER
##如果值为0,表示为library cache pin的holder;如果值为2,表示为waiter
KGLPNDMK NUMBER
KGLPNSPN NUMBER
x$kglob
[K]ernel [G]eneric [L]ibrary cache [OB]ject
x$kglob.kglhdadr = v$session_wait.p1raw