Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2014
    Posts
    3

    Unanswered: Connecting via Command Line

    This is probably and incredibly noobish question but I am trying to use the command line to run an export command for a DB2 database and I can't figure out how to even connect to the database. I am not real technical, more of an analyst who writes queries and whatnot so if you could help me with this it would be much appreciated.

    I have the following information, Database name, Server name, and Port number. When I go to the DB2 client installed on my computer and select Command Line Processor it brings up the command line. I type the following:

    db2 connect to <MY DATABASE NAME>

    and it results in the following error:

    SQL1031N The database directory cannot be found on the indicated file system. SQLSTATE=58031.


    I believe this is the standard information requested:
    DB2 V9.7.0.8
    Fixpack 8
    The database is on UNIX, I am running Windows

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You first must catalog the node and database on the workstation.

    Andy

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    To expand on what ARWinner said, you'd do

    Code:
    db2 catalog tcpip node foobar remote <server name> service <port number>
    db2 catalog db <database name> at node foobar
    Since this is a remote database for you, supply a valid server user ID when you connect:

    Code:
    db2 connect to <database name> user <whatever>
    ---
    "It does not work" is not a valid problem statement.

  4. #4
    Join Date
    Aug 2014
    Posts
    3
    Quote Originally Posted by n_i View Post
    To expand on what ARWinner said, you'd do

    Code:
    db2 catalog tcpip node foobar remote <server name> service <port number>
    db2 catalog db <database name> at node foobar
    Since this is a remote database for you, supply a valid server user ID when you connect:

    Code:
    db2 connect to <database name> user <whatever>
    Thanks, this is very helpful!

Posting Permissions

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