Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737

    Unanswered: bash shell with DB2 Linux DPF (InfoSphere Warehouse)

    DB2 InfoSphere Warehouse 9.7 on Red Hat Linux (previously known as DB2 ESE with DPF feature).

    Has anyone used bash shell (default for Linux) on the instance owner when using DPF (InfoSphere Warehouse)? I notice that when I run db2_all it can't find .profile, which doesn't exist with bash shell.
    Last edited by Marcus_A; 08-09-09 at 15:15.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    bash reads the profiles in certain sequence, starting with .bashrc, then .profile, then /etc/profile, if I remember correctly (read the bash man page to be sure). It executes the first one it finds and does not search further. I think if invoked as /bin/sh it skips .bashrc for compatibility, so you may want to try creating a symlink to bash, named sh, or create a copy of the bash executable named sh.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by n_i
    bash reads the profiles in certain sequence, starting with .bashrc, then .profile, then /etc/profile, if I remember correctly (read the bash man page to be sure). It executes the first one it finds and does not search further. I think if invoked as /bin/sh it skips .bashrc for compatibility, so you may want to try creating a symlink to bash, named sh, or create a copy of the bash executable named sh.
    That's not what I mean.

    The db2_all script that comes with DB2 is a ksh script and it looks for the .profile file on the instance owner directory and can't find it. I could make a .profile file with the same info as bashrc (to invoke the db2profile), but I am also wondering if I am going to run into other problems down the road.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    I think you could either rename .bashrc to .profile, and bash will happily find it, or symlink .profile to .bashrc - this way you'll need to maintain only one file. I don't see any problems from that point of view; however, pdksh (I guess that's what you have on Red Hat) is not completely compatible with the AIX korn shell so, depending on what your script is doing, you may run into some problems. For example, getopts behaves a bit differently in functions, which I had a pleasure to discover recently.
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I have the ksh.x86_64 package installed, not pdksh.

    But at this point I need to find someone who has experience with DPF on Red Hat Linux to know for sure if this is going to work with the bash shell (with a workaround similar to what you suggested).
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •