Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Posts
    78

    Unanswered: aix db2profile not running problem

    I'm connecting via Reflection X using OPENSSH. When I log in, the db2profile doesn't get ran automatically. I have to manually execute the db2profile after logging on. What has to be done to auto run the db2 profile when I log in with OPENSSH. To get it to work on a server we telnet into, we added these 2 lines to the .profile

    ENV=.krcsh
    export ENV

    then we created a .krcsh file that executes the db2 profile. Don't ask me why this was done (before me and they're gone), but it worked. Either we're missing a piece that was done before, or something extra has to be done for OPENSSH. Any help would be appreciated.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Why don't you just add the db2profile invokation into ~/.profile?
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Sep 2003
    Posts
    78
    I did. here's what I've been testing...

    I added an echo statements to .profile

    $ cat .profile
    echo "running .profile...."

    PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.

    export PATH

    if [ -s "$MAIL" ] # This is at Shell startup. In normal
    then echo "$MAILMSG" # operation, the Shell checks
    fi # periodically.

    # The following three lines have been added by UDB DB2.
    . /home/db2inst1/sqllib/db2profile
    ENV=.krcsh
    export ENV

    I added an echo statement to db2profile

    DB2INSTANCE=db2inst1
    export DB2INSTANCE
    INSTHOME=/home/db2inst1
    echo "running db2profile...."

    If I log in as dasusr1 and switch to db2inst1:

    $ whoami
    dasusr1
    $ su - db2inst1
    db2inst1's Password:
    running .profile....
    running db2profile....
    running db2profile....
    $

    This ran the db2 profile twice. I believe we're running the new environment variable .krcsh which also executes db2profile.

    If we log on as db2inst1, we get nothing…

    If I execute the .profile manually, I get:

    $ . /.profile
    TERM=vt320
    running db2profile....
    des084iimp1: /home/db2inst1#
    (notice I never got the "running .profile" message??)

    If I execute the db2profile manually, I get my prompt.

    des084iimp1: /home/db2inst1/sqllib#. /home/db2inst1/sqllib/db2profile
    running db2profile....
    des084iimp1: /home/db2inst1/sqllib#


    Seems like i'm not running .profile when I log on...

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Have you added the sourcing of db2profile also in /.profile? This file resides in the root directory of the file system - but it seems like a very bad idea doing that. So why am I asking this? This is the file you are sourcing:
    $ . /.profile
    My guess is that you have to make sure you are using the correct files here...
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    which shell is being used for this userid : echo $SHELL
    .profile is for ksh
    .bash_profile for bash ....
    and other
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  6. #6
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Bash also reads .profile if it is started as login shell.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  7. #7
    Join Date
    Sep 2003
    Posts
    78
    $ echo $SHELL
    /usr/bin/ksh

    and .profile is invoking db2profile
    # The following three lines have been added by UDB DB2.
    . /home/db2inst1/sqllib/db2profile
    ENV=.krcsh
    export ENV

Posting Permissions

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