在db2创建库时,出现以下报错:
SQL 错误 [56098]: An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-1585", SQLSTATE "54048" and message tokens "54048".. SQLCODE=-727, SQLSTATE=56098, DRIVER=4.16.53
An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-1585", SQLSTATE "54048" and message tokens "54048".. SQLCODE=-727, SQLSTATE=56098, DRIVER=4.16.53
An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-1585", SQLSTATE "54048" and message tokens "54048".. SQLCODE=-727, SQLSTATE=56098, DRIVER=4.16.53
SQL 错误 [54048]: A system temporary table space with sufficient page size does not exist.. SQLCODE=-1585, SQLSTATE=54048, DRIVER=4.16.53
A system temporary table space with sufficient page size does not exist.. SQLCODE=-1585, SQLSTATE=54048, DRIVER=4.16.53
A system temporary table space with sufficient page size does not exist.. SQLCODE=-1585, SQLSTATE=54048, DRIVER=4.16.53
An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-1585", SQLSTATE "54048" and message tokens "54048".. SQLCODE=-727, SQLSTATE=56098, DRIVER=4.16.53
An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-1585", SQLSTATE "54048" and message tokens "54048".. SQLCODE=-727, SQLSTATE=56098, DRIVER=4.16.53
分析后可以看到报错信息:SQLCODE "-1585", SQLSTATE "54048"
第一种:开始出现此报错信息,通过搜索,得知是因为没有足够临时表空间,需要创一个比较大的临时表空间,然后大多数方法是如下:
CREATE BUFFERPOOL MYPOOL SIZE 500 PAGESIZE 32K;
CREATE TEMPORARY TABLESPACE TEMPSPACE2 PAGESIZE 32K MANAGED BY DATABASE USING(FILE 'stealth2/temp02' 128000) EXTENTSIZE 80 bufferpool MYPOOL;
我就想,既然是临时表空间不够,那么可以直接将当前临时表的空间增大,通过该篇博客,通过 db2 ‘alter bufferpool IBMDEFAULTBP immediate size 50000’,直接修改IBMDEFAULTBP的大小,然而经过修改后,并不能解决问题,还是继续报错。
最后还是按照第一种方法进行解决,通过修改后,得出符合个人的执行语句:
--创建缓存池
db2 "create bufferpool PAS_PB_32K size 100 pagesize 32k"
--可以通过以下语句查看所有缓冲池
db2 "select * from syscat.bufferpools"
--建立自己的临时表空间
db2 'CREATE TEMPORARY TABLESPACE "TBS_SYSTMP_32" IN DATABASE PARTITION GROUP "IBMTEMPGROUP" PAGESIZE 32K MANAGED BY SYSTEM USING ('D:/SoftWare/cspas/PAS_DATA/PAS_SPACE_TMP/SYSTMP32' ) EXTENTSIZE 32 PREFETCHSIZE 16 BUFFERPOOL "PAS_PB_32K" OVERHEAD 24.10 TRANSFERRATE 0.90 DROPPED TABLE RECOVERY OFF'
第二种:以上是通过命令行的方式进行的,当然也可以使用 Control Center 工具进行实现,通过电脑左下角所有程序 --> IBM DB2 --> Control,通过管理员权限打开,出现以下界面
点击确定后,可以通过左侧菜单栏,选择需要修改的数据库
选择好所要创建的数据库后,首先先创建一个32的缓存池
因为我之前已经创过,就直接把所需要的配置给列出来,需要注意的是缓冲池名,页大小,以及页数量,如下:
然后选择表空间,创建一个新的表空间,主要的配置信息如下:
根据以上简单配置,完成以后,再进行操作数据库,就没有问题了。