Tip #1
1/3/2019
  • Tip

    db2iupdt may appear to hang if your instance user profile needs user interaction to complete.

  • Your instance user may have .profile in its home directory. The following two scenarios
    will cause trouble:
    1. Your profile needs user interaction to complete
    2. Your profile opens a new shell

    As an example, your .profile may have the following line:
    PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.
    
    # The following three lines have been added by IBM DB2 instance utilities
    if [ -f /home/hwang/sqllib/db2profile ]; then
        . /home/hwang/sqllib/db2profile
    fi
    
    echo "Enter some text : \c"
    read text
    echo "You entered: $text"
    
    When the instance user logins, the user will need to input something:
    login as: hwang
    hwang@host1's password:
    Enter some text : Yes
    You entered: Yes
    
    This is causing problems, though, when you issue db2iupdt.
    root@host1:/opt/IBM/db2/V9.7FP8/instance # ./db2iupdt hwang
    Enter some text : r
    You entered: r
    Enter some text : r
    You entered: r
    
    db2iupdt command apears to hang and never finishes.
    This is because db2iupdt executes the profile silently and expects it to complete without user intervention.
    The following output from proctree(or ptree) shows it starts a new shell and discard the output:
    24772726    /bin/bsh ./db2iupdt hwang
      32768126    /bin/bsh /opt/IBM/db2/V9.7FP8/instance/db2iexec -n hwang
                                                  /usr/bin/date >> /home
        7995592    -ksh -c . /home/hwang/sqllib/db2profile 1>/dev/null 2>
                                                  /dev/null; /usr/bin/date
    

    Similar problem if you open a new shell in your profile:
    PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.
    
    # The following three lines have been added by IBM DB2 instance utilities
    if [ -f /home/hwang/sqllib/db2profile ]; then
        . /home/hwang/sqllib/db2profile
    fi
    
    bash