在DB2 10.1FP3,AIX 7102环境,文件系统使用的是AIX LVM,有个表空间共32个容器,每个容器大小是20G,打算扩容这个表空间,于是使用了resize all 24G的命令,db2 "alter tablespace tbs resize (all 24G)",执行完成后发现 tbs 开始rebalance了,这个有点奇怪,我是在现有的container增加空间,不会影响表空间的HWM,为什么会触发rebalance呢?
====已解决===
该问题与表空间分布有关,可以查看这篇博文:http://blog.itpub.net/802647/viewspace-2141095/
10.1 的信息中心里面说了一个类似的例子
Increasing the size of device containers. The following exampleillustrates how to increase two device containers (each already existingwith 1 000 pages) in a table space on a Linux or UNIX operating system:
[code class=\"\"] ALTER TABLESPACE HISTORYThe twodevices increase from 1 000 pages in size to 2 000 pages.The contents of the table space might be rebalanced across the containers. Access to the table space is not restricted during the rebalancing.
里面说到了 resize 也是有可能触发 rebalancing , 可能是因为当前数据在各个 containers 之间分布不均匀,达到了一个内部的阈值,从而触发了 rebalancing 的操作,如果想知道进一步的细节,可能需要开 PMR 问下 lab 的 db2 support team
收起这个问题已查明,与表空间分布有关,因为以前一次表空间扩容使用了add file命令增加了较小的容器,接着使用resize all命令把容器大小都改为一样大小,但是这样操作后表空间extent分布在各个容器里是不对齐的,导致这次使用resize命令扩容的时候extent进行了重新分布。
收起有可能是你之前添加容器的时候,指定了BEGIN NEW STRIPE SET
收起通过snapshot for tablespaces可以看到表空间映射,可能和rebalance有关
Range Stripe Stripe Max Max Start End Adj. Containers
Number Set Offset Extent Page Stripe Stripe
[ 0] [ 0] 0 163835 5242751 0 40958 0 4 (0,1,2,3)
[ 1] [ 0] 0 237563 7602047 40959 49150 0 9 (0,1,2,3,4,5,6,7,8)
[ 2] [ 0] 0 401398 12844767 49151 81917 0 5 (4,5,6,7,8)
[ 3] [ 0] 0 499702 15990495 81918 90109 0 12 (4,5,6,7,8,9,10,11,12,13,14,15)
[ 4] [ 0] 0 600054 19201759 90110 104445 0 7 (9,10,11,12,13,14,15)
[ 5] [ 0] 0 1212383 38796287 104446 131068 0 23 (9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31)
[ 6] [ 0] 0 1572831 50330623 131069 153596 0 16 (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31)
表空间映射和我预计的不太一样,每个container都是一样大小的,为什么会出现这样的表空间映射?
正常应该是类似如下的表空间映射
Range Stripe Stripe Max Max Start End Adj. Containers
Number Set Offset Extent Page Stripe Stripe
[ 0] [ 0] 0 2228191 71302143 0 69630 0 32 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31)
收起