db2 import和load比起性能来由于会记录日志,所以通过速度比较慢,并且数据记录太大容易造成事物日志满的问题发生,但有些操作不
db2 import和load比起性能来由于会记录日志,所以通过速度比较慢,并且数据记录太大容易造成事物日志满的问题发生,但有些操作不得不记日志,所以就不得不适用import,不过其有个commitcount选项完全可以避免,来指定import多少条记录即提交,,有助于及时释放日志:
并且由于及时提交了,所以在运行失败了还可以重新在起点继续进行操作:
db2 import from tab1.ixf of ixf modified by generatedignore commitcount 500000 insert into rcdb2.t_cust_dtl
上面我设置每导入50w条记录就提交,然而导入中发现索引表空间不足,会话运行失败:
sql3306n an sql error -289 occurred while inserting a row into the table.
sql0289n unable to allocate new pages in table space rcdb2_indx_01.
sqlstate=5701
查询目前已经成功导入的数据量如下:
db2 select count(*) from rcdb2.t_cust_dtl with ur
1
-----------
5000000
1 record(s) selected.
这个就可以作为重新导入的起点。
db2 import from tab1.ixf of ixf modified by generatedignore commitcount 500000 skipcount 5000000 insert into rcdb2.t_cust_dtl
另外还有个参数restartcount n何skipcount等效, 跳过前n条记录继续import,想当的方便
db2数据库性能调整和优化(第1、2版) pdf
db2数据库性能优化介绍
本文永久更新链接地址:
