db2数据库参数设置不当问题
Db2中数据库的参数配置对应用起着非常重要的作用,往往会由于你对它的忽视而导致很严重的错误,下面我将举例说明一下,
表A和表B的表结构是一样的,为了把表A中的数据导入表B,所以先把表A的数据导出,然后再把数据导入到表B中,但却出现了如下问题:
db2 "export to test.del of del select * from 表A"
SQL3104N The Export utility is beginning to export data to file
"test.del".
SQL3105N The Export utility has finished exporting "44039" rows.
Number of rows exported: 44039
$ db2 "import from test.del of del insert into 表B" db2数据库sql语句
SQL3109N The utility is beginning to load data from file
"test.del".
SQL3306N An SQL error "-964" occurred while inserting a row into the table.
SQL0964C The transaction log for the database is full. SQLSTATE=57011
SQL3110N The utility has completed processing. "26465" rows were read from
the input file.
后来通过DB2信息中心查相关的信息发现,该错误可能跟log file size大小设置有关系,因此进入数据库查看了相关的配置信息,查看相关数据库参数信息的SQL语句如下:
get db cfg for 数据库名
查询得到的相关日志文件配置信息如下:
Log file size (4KB) (LOGFILSIZ) = 1000
Number of primary log files (LOGPRIMARY) = 3
Number of secondary log files (LOGSECOND) = 2
后来把这三个参数的大小相应调整了一下,调整后如下:
Log file size (4KB) (LOGFILSIZ) = 65536
Number of primary log files (LOGPRIMARY) = 6
Number of secondary log files (LOGSECOND) = 4
调整方法为
update db cfg using LOGFILSIZ 65536
update db cfg using LOGPRIMARY 6
update db cfg using LOGSECOND 4
调整后重启数据库,然后再执行之前的操作,问题解决。 

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。