Posted on 2009-07-31 13:41
Prayer 閱讀(614)
評論(0) 編輯 收藏 引用 所屬分類:
DB2
1、數據庫對象大小評估
可以使用db2cc中的“Estimate Size”功能,預估一個對象消耗的空間范圍(最小值和最大值)
2、系統catalog空間大小
初始值大約3.5M,如果創建了DMS表空間,大概為20M。
3、用戶表數據空間大小:
1)一行數據不能跨越多個數據頁,建立在4K頁大小的表格最大可以有500個列;
When the page size is 4 KB, the row length can be up to 4005 bytes.
When the page size is 8 KB, the row length can be up to 8101 bytes.
When the page size is 16 KB, the row length can be up to 16 293 bytes.
When the page size is 32 KB, the row length can be up to 32 677 bytes.
2)數據頁不含有LONG VARCHAR, LONG VARGRAPHIC, BLOB, CLOB, or DBCLOB類型的數據,只含有數據描述;
3)插入新數據規則
在常規表插入新數據時,通常根據free map選擇合適的空間存放新行,可以使用命令ALTER TABLE tabname APPEND ON,要求插入數據存儲為追加模式;
如果表格上有聚集索引,根據cluster key對應的數據頁插入新行
3、索引數據空間大小:
(average index key size + 9) * number of rows * 2
4、日志文件空間大小:
(logprimary + logsecond) * (logfilsiz + 2 ) * 4096
如果logsecond值為-1,表示激活的日志空間不受限制
容器和條帶關系
——————————-container——————
——————-0—————1————–2——-
———0——Extent0———Extent1——–Extent2—-
———1——Extent3———Extent4——–Extent5—-
Stripes–2——Extent6———Extent7——–Extent8—-
———3——Extent9———Extent10——-Extent11—
———4——Extent12——–Extent13——-Extent14—
———5——Extent15——–Extent16——-Extent17—
縱坐標是container,橫坐標是Stripes
如果添加或刪除container,數據就可能發生rebalance;
rebalance期間,數據可以正常訪問和操作,但數據庫表現非常慢;
增加或擴充的container,如果被增加的空間在high-water mark上面,就不會發生rebalance,譬如:原表空間有幾個相同大小的容器,如果你對它們擴充相同的空間,就不會發生rebalance,或者給 表空間增加新容器時指定特別選項BEGIN NEW STRIPE SET,使數據不發生rebalance,新增的數據不會添加到原來的容器中,都將寫入新容器