DB2数据库中表空间的大小限制

DB2数据库中,表和表空间的大小主要受到pagesize和其对应寻址能力限制。本文将为您详细分析DB2数据库中表和表空间的大小的限制,供您参考,希望对您有所帮助。

网站建设哪家好,找成都创新互联!专注于网页设计、网站建设、微信开发、小程序定制开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了岑巩免费建站欢迎大家使用!

在DB2 v8中,页地址为3个字节,也就是2的24次方可用,就是16,777,216页可以被寻址,基于这个限制得到如下表空间和表大小的限制:

# of pages Page size Limit of table / tablespace
16,777,216 4 K 64 GB
16,777,216 8 K 128 GB
16,777,216 16 K 256 GB
16,777,216 32 K 512 GB

在DB2 v9中,页地址扩展为4个字节,也就是寻址能力提升4倍,具体的限制如下所示:

# of pages Page size Limit of table / tablespace
536,870,912 4 K 2 TB
536,870,912 8 K 4 TB
536,870,912 16 K 8 TB
536,870,912 32 K 16 TB

注意:在DB2 v8中,large类型的表空间只是为LOB和LONG数据类型所使用,而在DB2 v9中没有类似的限制,默认的表空间类型就是large,如果从DB2 v8升级到v9就需要手动的把表空间从regular转换为large

ALTER TABLESPACE tablespace_name CONVERT TO LARGE

DB2 v8中的典型报错#p#

多所有容器扩容

db2 " ALTER TABLESPACE tablespace-name EXTEND (ALL 1000000)"

DB21034E The command was processed as an SQL statement because it was not avalid Command Line Processor command. During SQL processing it returned:

SQL1139N The total size of the table space is too big. SQLSTATE=54047
 
对其中一个容器扩容

db2 " ALTER TABLESPACE tablespace-name  EXTEND (FILE '/dir/filename' 3000000)"

DB21034E The command was processed as an SQL statement because it was not avalid Command Line Processor command. During SQL processing it returned:

SQL1139N The total size of the table space is too big. SQLSTATE=54047
 
加容器

db2 " ALTER TABLESPACE tablespace-name  ADD (FILE '/dir/filename' 500000)"

DB21034E The command was processed as an SQL statement because it was not avalid Command Line Processor command. During SQL processing it returned:

SQL1139N The total size of the table space is too big. SQLSTATE=54047
 
通过检查可以看到#p#

LIST TABLESPACES SHOW DETAIL

...

Tablespace ID                       = 8

 Name                                       = tablespace-name

 Type                                       = Database managed space

 Contents                                = Any data

 State                                        = 0x0000

  Detailed explanation:

    Normal

 Total pages                            = 16388000

 Useable pages                       = 16387840

 Used pages                            = 16387840

 Free pages                               = 0

 High water mark (pages)       = 16387840

 Page size (bytes)                   = 4096

 Extent size (pages)                 = 32

 Prefetch size (pages)              = 128

 Number of containers             = 4

 Minimum recovery time          =2009-06-26-04.47.15.000000

...

可以明显看到页数量已经接近了最大限制

当前标题:DB2数据库中表空间的大小限制
文章地址:http://www.stwzsj.com/qtweb/news27/477.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联