Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2012
    Posts
    82

    Unanswered: db2profile error

    I am running db2 9.7.0.3 on suse 10.

    I am having an issue when I try to run the db2profile command.

    after running the db2profile when I try to run any command with db2 or try to enter db2 interactive CLI I get the following error


    /home/db2inst1/cfm/db2: line 1: SQL0104N: command not found


    Any idea what that might be the issue

    When I log into db2 it works fine but when I run the profile again or use it in a script it gives this error

  2. #2
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    What do you mean "run the db2profile" command?

    Normally, your login-shell startup file will dot in the ~db2inst1/sqllib/db2profile

    That is to say you must always dot it into the current shell environment.

    For example in the .bashrc for your login, you will have this line:
    Code:
    .  ~db2inst1/sqllib/db2profile
    If you already have this, and the db2profile is throwing an error while it is being dotted then then please give more details about your shell, your startup file contents, and an example (showing the dotting in, and its output)...

  3. #3
    Join Date
    Jan 2012
    Posts
    82
    Basically I am trying to import the profile in a maintenance shell script that I am trying to schedule using cronjob.

    But when I try to import the db2profile I keep getting this error.

    Here is a snapshot of the terminal.
    Attached Thumbnails Attached Thumbnails shell.jpg  

  4. #4
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    view the file ~db2inst1/sqllib/db2profile - does it look correct?

    what is output of: which db2

    has someone defined an alias for db2 ?

    If you execute the db2 clp directly (with the absolute path e.g. /opt/ibm/db2/V9.7/bin/db2) does it give the same result ?

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Instance owner can invoke db2profile with this command:

    . $HOME/sqllib/db2profile
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  6. #6
    Join Date
    Jan 2012
    Posts
    82
    Fixed it their was an issue with the PATH variable in the .profile file. It was overwriting the db2profile.

    Must have been done by the previous owner of database

Posting Permissions

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