Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2008
    Posts
    3

    Red face Unanswered: Unable to get the db2 command prompt in unix

    Hi,

    When i try to connect to the db2 database from unix solaris 5.8 version by typing "db2" from the .../sqllib/bin/ folder, i am not getting the db2 command prompt. Could anyone help me resolve this? Here the db2 is a executable file only. But still iam not able to execute.
    The error i get is

    $ db2
    ksh: db2: not found
    Last edited by ragavhere; 11-19-08 at 02:31.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    something is wrong with the path
    are you a client instance ? check that sqllib/db2profile is getting executed from profile
    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

  3. #3
    Join Date
    Nov 2008
    Posts
    3

    Angry Is the code right?

    Yes i am using the client instance. But is the way i am connecting to DB2 right?

    if [ $ERROR_CD = 01 ]; then
    db2output=`DB2 <<EOD
    connect to <DB name> user <username> using <password>
    insert into <schema.tablename> (Col1,Col2,Col3,Col4,Col5,Col6) values('Val1','Val2','Val3','Val4','Val5','Val6');
    terminate
    EOD`
    else
    exit
    fi

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    could you try
    in command window
    db2 connect to xxx user yyy using zzz
    db2 select * from sysibm.sysdummy1
    and publish the rc
    try also db2level
    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

  5. #5
    Join Date
    Nov 2008
    Posts
    3
    I could try in command window. But this has to be done by a script. That is why i posted that part of the code. Is that code right?

  6. #6
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    the first thing todo, is to see if all is working as it should
    when you have command line working you can continue with scripts, as in that case you are sure, that it should work.
    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

Posting Permissions

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