当更新一个大表,可能导致错误:
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0964C The transaction log for the database is full. SQLSTATE=57011
可能的原因:
1、事务过大,导致所有的日志文件都满,此时解决方法有:
1)加大日志文件数量或容量
2)在事务中对大表执行关闭日志操作
db2 +c "alter table ods.table1 activate not logged initially"
db2 +c "update ods.table1 set col1='"
两条命令要在一个事务中执行,如果不加+c项,两条语句是两个事务,导致更新失败。
但第2种方法有风险,可能因为事务失败而导致表不可访问
2、某个事务一直未commit,占用了某个日志文件,因为日志文件是循环使用的而导致后面的日志无法写入。此种情况可在diag文件中发现,可以在发现相关事务后将此事务kill。
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/2073/viewspace-1007708/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/2073/viewspace-1007708/