IBM Support

IC71752: DB2 PRUNE HISTORY AND DELETE DELETES FIRST ACTIVE LOG.

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error 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.
    

Local fix

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.                   *
    ****************************************************************
    

Problem conclusion

  • Problem was first fixed in DB2 UDB Version 9.7 Fix Pack 4.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC71752

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-10-07

  • Closed date

    2011-06-07

  • Last modified date

    2011-06-07

  • APAR is sysrouted FROM one or more of the following:

    IC69166

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC71752

Modified date: 07 June 2011