IBM Support

IC81667: SPORADIC SQL2001N DURING STATEMENT EXECUTION

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Starting with DB2 V9.7 FixPack 5 you might get sporadic SQL2001N
    errors when executing DB2 commands from a script.
    E.g. we have seen this with REORG statement being executed in a
    script.
    
    The behavior is caused by a late interrupt that was meant for
    previous SQL request, which can be picked up by the next SQL
    request.
    
    The error you will get is:
    
     SQL2001N  The utility was interrupted.  The output data may be
    incomplete.
     SQLSTATE=57014
    
    
    Following steps will reproduce the issue on DB2 V9.7 FP5:
    
    1. create database objects:
    
     db2 "connect to sample"
     db2 "create table db2v975.tt (c char(20), c1 char(20))"
     db2 "create unique index i2 on db2v975.tt (c, c1)"
     db2 "alter index i2 compress yes"
    
    2. run following script
    
     ---
     #!/bin/ksh
     db2diag -A
    
     i=0
     RC=0; while [[ $RC -eq 0 ]] ; do
    
     i=$(( $i + 1 ))
    
     xx=$( db2 connect to sample )
    
     db2 "select cast(case when CLUSTERRATIO = -1 then CLUSTERFACTOR
    * 100 else clusterratio end as integer) from syscat.indexes
    where indname = 'I2' and tabname = 'TT' and tabschema =
    'DB2V975'" | read x dummy
    
     db2 -a "reorg table db2v975.TT index I2"
     RC=$?
    
     echo "i:$i  x $x RC $RC\n\n\n"
     done
     ---
    
    In the above example the SELECT statement causes a broken pipe
    (SIGPIPE) signal. This happens because the "| read x dummy"
    expects only 1 line output, where in this case it will be more
    lines.
    

Local fix

  • Executing the CLP with 'db2 -x' will output only one line and
    prevent the issue in the example above.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 Version 9.7 Fix Pack 6.                       *
    ****************************************************************
    

Problem conclusion

  • First fixed in DB2 Version 9.7 Fix Pack 6.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC81667

  • 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

    2012-02-27

  • Closed date

    2012-06-11

  • Last modified date

    2012-06-11

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

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

    IC84459

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.7","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
11 June 2012