批量更新DB2客户端好像每次最多只能发送64K字符SQL到数据库。有可能以下错误,例如:
db2 ? sql954 SQL0954C Not enough storage is available in the application heap to process the statement. Explanation: All available memory for the application has been used. The statement cannot be processed. User Response: Terminate the application on receipt of this message. Increase the database configuration parameter ( applheapsz ) to allow a larger application heap. sqlcode : -954 sqlstate : 57011 |
需要设置DB2应用的堆大小.
http://fanqiang.chinaunix.net/db/db2/2005-07-20/3430.shtml
4.8 查看本instance下有哪些database
db2 LIST DATABASE DIRECTORY [ on /home/db2inst1 ] |
4.9 查看及更改数据库head的配置
请注意,在大多数情况下,更改了数据的配置后,只有在所有的连接全部断掉后才会生效。
查看数据库head的配制
更改数据库head的某个设置的值
4.9.1 改排序堆的大小
db2 update db cfg for head using SORTHEAP 2048 |
将排序堆的大小改为2048个页面,查询比较多的应用最好将该值设置比较大一些。
4.9.2 改事物日志的大小
db2 update db cfg for head using logfilsiz 40000 |
该项内容的大小要和数据库的事物处理相适应,如果事物比较大,应该要将该值改大一点。否则很容易处理日志文件满的错误。
4.9.3 出现程序堆内存不足时修改程序堆内存大小
db2 update db cfg for head using applheapsz 40000 |
该值不能太小,否则会没有足够的内存来运行应用程序。
4.10 查看及更改数据库实例的配置
查看数据库实例配置
更改数据库实例配制
4.10.1 打开对锁定情况的监控。
db2 update dbm cfg using dft_mon_lock on |
4.10.2 更改诊断错误捕捉级别
db2 update dbm cfg using diaglevel 3 |
0 为不记录信息
1 为仅记录错误
2 记录服务和非服务错误
缺省是3,记录db2的错误和警告
4 是记录全部信息,包括成功执行的信息
一般情况下,请不要用4,会造成db2的运行速度非常慢。