无聊之人--除了技术,还是技术,你懂得
分类: DB2/Informix
2013-06-19 12:37:28
GBP包含Directory与Data两个部分。
Data很好理解,即Data Pages,与Local BP的内容一样;
Directory指定了Data Page的位置和状态信息,位置信息告诉需要Data Page的Member,所需要的Data Page是在GBP还是在LBP,而状态信息告诉各个Member,本Directory所指定的Data对此Member是否有效。
由于Data可能在GBP,也可能在LBP,所以Data与Directory就有如下关系:
1 Directory = n Data (n>=1) (但对于一个给定的Data,有且只有一个Directory与之对应)
GBP STRUCTURE DSNDP10_GBP1使用下面的POLICY定义:
STRUCTURE NAME(DSNDP10_GBP1) SIZE(745884)
INITSIZE(621568)
FULLTHRESHOLD(90)
ALLOWAUTOALT(YES)
DUPLEX(ENABLED)
REBUILDPERCENT(1)
PREFLIST(C061, C031)
ALLOWAUTOALT定义为YES的情形下,
If both entries and elements exceed their FULLTHRESHOLDs, XES may
increase the structure size in order to gain enough capacity。
If either one or the other (but not both) exceed FULLTHRESHOLD, XES
does not increase the size and will “juggle” entries and elements。
如果Tablespace都使用GBPCACHE CHANGE,当绝大多数是SELECT语句时候,需要的Directory就多;当Update多的时候就需要更多的Data Pages,当达到FULLTHRESHOLD的时候,系统就会进行Directory Reclaim。
IXC588I Explanation: The system has initiated an alter request to correct a resource shortage for one or more of the structure objects that the structure contains. When XCF has detected that a structure is at or above its structure full threshold value in terms of one or more of the structure objects that the structure contains, XCF will start an alter request to correct the situation, when allowed. The current in-use and total counts for the objects will be displayed by message IXC585E.
Example:
IXC588I AUTOMATIC ALTER PROCESSING INITIATED 801
FOR STRUCTURE DSNDP10_GBP1.
CURRENT SIZE: 745984 K
TARGET SIZE: 745984 K
TARGET ENTRY TO ELEMENT RATIO: 32887 : 20418
IXC590I Explanation: The system initiated stucture alter processing has finished.
Example:
IXC590I AUTOMATIC ALTER PROCESSING FOR STRUCTURE DSNDP10_GBP1 836
COMPLETED. TARGET NOT ATTAINED.
CURRENT SIZE: 745984 K TARGET: 745984 K
CURRENT ENTRY COUNT: 260105 TARGET: 260349
CURRENT ELEMENT COUNT: 161651 TARGET: 161631
CURRENT EMC COUNT: 0 TARGET: 0
ALTER OF REBUILD-NEW STRUCTURE INSTANCE WAS COMPLETED.
通常大量的Directory Reclaim会伴随大量的cross-invalidation,当cross-invalidation很多时候,DB2性能就会有很大的影响。
什么是cross-invalidation?
Group buffer pools use a cross-invalidation mechanism to maintain data consistency across the buffer pools of group members. Shared data pages are registered in a group buffer pool directory in each cache structure, thus enabling the coupling facility control program to cross-invalidate the copies of data pages that are held in individual member buffer pools. Cross-invalidation takes place when a member's own buffer pool does not contain the latest version of the data. In this case, the member must reread the pages from either the group buffer pool or disk, if that member needs to reference the pages again.
但如果Directory所占的比率太大,所Reclaim的Directory都是无效的,没有对应的Data Page,此时也就无所谓发生cross-invalidation。
这种情况Directory Reclaim不会对DB2 Performance产生太多的影响。
蓝线为Directory,主坐标,红线为cross-invalidation,次坐标。
调整Directory与Data的比率?