SQL0964C The transaction log for the database is full.

来源:互联网 发布:网络诗词精选 编辑:程序博客网 时间:2024/05/01 07:37
这个错误说明事务日志已满,查资料方知解决方法,共享之。

方法一:命令行方式

把日志文件的大小和日志文件的数量扩充,如下命令 :
  db2 update   db   cfg   for   DATABASE   using   LOGFILSIZ   7900  
  db2   update   db   cfg   for   DATABASE   using   LOGPRIMARY   30  
  db2   update   db   cfg   for   DATABASE   using   LOGSECOND   20


方法二:控制中心方式。

直接在该数据库上右键,弹出如下窗口,找到  Configure Dababase Logging Wizard,打开即可设置。


ibm官方解决办法如下
Too many objects have been loaded into the library server and the transaction to delete rows in the library server transaction tracking table is overfilling the DB2® UDB transaction logs.

Workaround:

  1. Stop the migrator process.
  2. Stop all the DB2 UDB applications. The DB2 UDB command to stop all the applications is: db2 force applications all
  3. Change the number of secondary log files in the DB2 UDB database configuration to a greater number such as 100 (default is 20).
  4. To see the database configuration settings, enter the following command in a DB2 UDB command window: db2 get db cfg
  5. To update the number of secondary log files to 100, enter the following: db2 command db2 update dbm cfg using LOGSECOND=100
  6. Start the migrator process.

The error message should now not be appearing in the library server log, and the transaction to delete rows in the library server transaction tracking table should be successful.
 
有关日志文件的参数有如下几个:   
Logprimary:主日志文件的个数;最大为为65536(页数)×4k(块大小);
Logfilsz:每个日志文件的大小;最多不超过256;
Logsecond:第二日志文件的个数;最大不超过254;辅助日志文件在需要时分配,不再使用时系统收回。

平常只使用Logprimary的个数个日志文件,当主日志文件被用完,则启用第二日志文件个数个日志文件。如果都用光了系统就会报日志满错误。  
 
而所谓循环日志方式,是指对主日志文件的循环利用,但是要注意,日志文件的大小必须要满最大单个事务的数据容量需求。因为在一个事务写日志的过程中是不允许循环使用的,平常最好配置到,只使用主日志,不使用第二日志,最好让数据库一天写满一个到两个日志文件。
另外,还有种方法是设置不写日志,即ALTER TABLE A ACTIVATE NOT LOGGED INITIALLY,但是据说这种方法可能会出问题,而且一旦出问题,只能DROP TABLE,无法补救。所以这种方法还是不用了。
原创粉丝点击