Results 1 to 9 of 9

Thread: db2ls ?

  1. #1
    Join Date
    Feb 2008
    Posts
    62

    Unanswered: db2ls ?

    I have never tried "db2ls".
    When i fire this command (on AIX -db2 8.1, Windows -db2 9.1) It says command not found!

    db2ls
    db2ls: command not found


    Please clear it.
    Last edited by prashant44; 06-16-08 at 03:58.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    You get exactly the same error message on AIX and Windows? I rather doubt it.

    DB2 V8 didn't have a "db2ls" utility, so the error there is fine. The question is now which error you really see on DB2 V9.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    I couldn't find db2ls on "IBM® DB2® Universal DatabaseCommand Reference Version 8.2".

    I found follwing note on "DB2 Version 9 for Linux, UNIX, and Windows Command Reference".

    Usage Notes:
    .....
    .....
    - You cannot use the db2ls command on Windows operating systems.

    I couldn't find that note on "DB2 Version 9.5 for Linux, UNIX, and Windows Command Reference".

    So, I thought that you should use V9.1 or later on AIX and V9.5 on Windows.

  4. #4
    Join Date
    Feb 2008
    Posts
    62
    I also tried it on Sun Solaris on which db2 9.1 is installed.


    -bash-3.00$
    -bash-3.00$ db2ls
    -bash: db2ls: command not found
    -bash-3.00$ db2level
    DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09011"
    with level identifier "01020107".
    Informational tokens are "DB2 v9.1.0.1", "s061104", "U809677", and Fix Pack
    "1".
    Product is installed at "/opt/IBM/db2/V9.1".

    -bash-3.00$ uname
    SunOS
    -bash-3.00$ db2ls
    -bash: db2ls: command not found
    -bash-3.00$

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Did you search for the "db2ls" executable on your system and verify that the correct path is in your PATH environment variable? On mine, it is /usr/local/bin/.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  6. #6
    Join Date
    Feb 2008
    Posts
    62
    Yes!!!
    i found it in
    /opt/IBM/db2/V9.1/install


    -bash-3.00$ pwd
    /opt/IBM/db2/V9.1/install
    -bash-3.00$ ./db2ls

    Install Path Level Fix Pack Special Install Number Install Date
    --------------------------------------------------------------------------------------------
    /opt/IBM/db2/V9.1 9.1.0.1 1 Mon Jun 02 11:37:47 2008 IST
    -bash-3.00$


    Is is always be executed as ./db2ls ?

  7. #7
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    That's basic shell stuff: if you don't have the directory where an executable is located in your PATH, then you have to tell the system which executable to start using a relative or absolute path. Using './' tells the system to use a relative path and '.' just happens to indicate the current directory.

    You could include the current directory in your PATH, but you shouldn't do that because it opens potential security holes.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  8. #8
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by stolze
    You could include the current directory in your PATH, but you shouldn't do that because it opens potential security holes.
    In this specific case, just add that directory to your PATH by executing the following two commands:
    Code:
    PATH="$PATH":/opt/IBM/db2/V9.1/install
    export PATH
    Now the command "db2ls" will be available independent of your current directory.

    Add the above two lines to the end of your startup script (typically $HOME/.profile) to keep that setting across logins.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  9. #9
    Join Date
    Feb 2008
    Posts
    62
    Yeah! It does works.
    Thanks for Help

Posting Permissions

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