DB2 - Problem description
Problem IC71752 | Status: Closed |
DB2 PRUNE HISTORY AND DELETE DELETES FIRST ACTIVE LOG. | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
db2 prune history and delete deletes first active log. db2start db2 -v " drop db INFLOG" db2 -v "create db INFLOG" db2 -v " connect to INFLOG" db2 -v " update db cfg for INFLOG using LOGARCHMETH1 DISK:/home/db2inst1/ARCHLOC" db2 -v "terminate" db2 -v "backup db INFLOG to /dev/null" db2 -v " update db cfg for INFLOG using SOFTMAX 1" db2 -v " update db cfg for INFLOG using LOGPRIMARY 2 LOGSECOND -1 LOGFILSIZE 4" db2 get db cfg for INFLOG |grep -i LOG db2 -v "terminate" db2 -v "connect to INFLOG" db2 -v "create table test1 (I int, v1 varchar(200), v2 varchar(200), v3 varchar(200))" db2 connect to INFLOG; db2 +c delete from test1 where i = 2; cd ; db2 get db cfg for INFLOG |grep -i FIRST; loop_insert3.pl Where loop_insert3.pl is a perl script that loads data into a table called test1 and causes log files to get generated and wait till they get deleted from the active log path and are only existing in the archive log path (prove with ls) ls /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/ and ls /home/db2inst1/ARCHLOC/db2inst1/INFLOG/NODE0000/C0000000 Then from different window db2 connect to INFLOG; db2 prune history 20101007 with force option and delete then do the ls to confirm the missing files that are active logs and now no longer exist anywhere ls /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/ and ls /home/db2inst1/ARCHLOC/db2inst1/INFLOG/NODE0000/C0000000 In cases where infinite logging is used, the active log can be archived to the archive path and removed from the active log path. If a prune is chosen with the delete option and a timestamp more recent than the active log is chosen, the active log would be deleted making it impossible to rollback the transaction and causing a potential database corruption. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * db2 prune history and delete deletes first active log. * * * * db2start * * db2 -v " drop db INFLOG" * * db2 -v "create db INFLOG" * * db2 -v " connect to INFLOG" * * db2 -v " update db cfg for INFLOG using * * LOGARCHMETH1 DISK:/home/db2inst1/ARCHLOC" * * db2 -v "terminate" * * db2 -v "backup db INFLOG to /dev/null" * * db2 -v " update db cfg for INFLOG using SOFTMAX 1" * * db2 -v " update db cfg for INFLOG using * * LOGPRIMARY 2 LOGSECOND -1 LOGFILSIZE 4" * * db2 get db cfg for INFLOG |grep -i LOG * * db2 -v "terminate" * * db2 -v "connect to INFLOG" * * db2 -v "create table test1 (I int, v1 varchar(200) * * , v2 varchar(200), v3 varchar(200))" * * db2 connect to INFLOG; * * db2 +c delete from test1 where i = 2; * * cd; * * db2 get db cfg for INFLOG |grep -i FIRST; * * loop_insert3.pl * * * * Where loop_insert3.pl is a perl script that loads data * * into a table called test1 * * and causes log files to get generated * * and wait till they get deleted from the active log path * * and are only existing in the archive log path * * (prove with ls) * * * * ls /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/ * * and * * ls /home/db2inst1/ARCHLOC/db2inst1/INFLOG/NODE0000/C0000000 * * * * Then from different window * * * * db2 connect to INFLOG; db2 prune history 20101007 * * with force option and delete * * then do the ls to confirm the missing files * * that are active logs * * and now no longer exist anywhere * * * * ls /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/ * * and * * ls /home/db2inst1/ARCHLOC/db2inst1/INFLOG/NODE0000/C0000000 * * * * In cases where infinite logging is used, the active log * * can be archived to the archive path and removed * * from the active log path. * * * * If a prune is chosen with the delete option * * and a timestamp more recent than the active log is chosen, * * the active log would be deleted making * * it impossible to rollback the transaction * * and causing a potential database corruption. * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 UDB version 9.7 fix pack 4. * **************************************************************** | |
Local Fix: | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows | |
Solution | |
Problem was first fixed in DB2 UDB Version 9.7 Fix Pack 4. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 07.10.2010 07.06.2011 07.06.2011 |
Problem solved at the following versions (IBM BugInfos) | |
9.7.FP4 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.4 |