Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2005
    Posts
    16

    Unanswered: Connecting to a Remote Database

    hi All,

    I'm trying to connect to a remote database.

    I've confiugred the my database instance with a service name "BOBDB"

    TCP/IP Service name (SVCENAME) = BOBDB
    Discovery mode (DISCOVER) = SEARCH
    Discover server instance (DISCOVER_INST) = ENABLE


    and I've changed /etc/services file as follows

    BOBDB 50000/tcp

    After this, I've restarted the instance. When I try to telnet to the localhost on port 50000, I get

    bash-2.03$ telnet localhost 50000
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection refused,

    which implies that nothing is listening on Port 50000.

    Am I missing something?

    Thanks
    Yadu

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Please supply DB2 version ans OS version. Have you tried issuing a CONNECT to DB command? Have you tried LIST APPLICATIONS?

    Andy

  3. #3
    Join Date
    Oct 2005
    Posts
    16
    DB2 version is Command Line Processor for DB2 SDK 8.2.0 and OS is Solaris 8. When I do a LIST APPLICATIONS, I see two applications which are using DB2 locally.

    After cataloging, when I try connecting to DB, I get the following error

    SQL30081N A communication error has been detected. Communication protocol
    being used: "TCP/IP". Communication API being used: "SOCKETS". Location
    where the error was detected: "12.123.13.11". Communication function
    detecting the error: "connect". Protocol specific error code(s): "10061", "*"
    "*". SQLSTATE=08001

    I've firewall access to any of the ports on this server.

  4. #4
    Join Date
    Jun 2006
    Posts
    471

    connect

    execute db2set -all
    and see if db2comm=tcpip is set otherwise
    db2set db2comm=tcpip
    this will bind db2 with tcpip stack at startup
    ifconfig -a | grep 50000 <--should show the listen
    check db2diag.log after start
    I think it is because of db2comm
    can you also specify from where to where you connect
    local to local ; no tcpip is needed : just db2 connect to xx should work
    local to remote : catalog tcpip node and catalog db are needed to be executed
    same for remote to local : first catalog node and db and try connect
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  5. #5
    Join Date
    Oct 2005
    Posts
    16
    Thanks GUY for your reply. DB2COMM was not set to TCPIP. I restarted the instance after setting DB2COMM to TCPIP.

    During restart, I could see the following message
    10/24/2006 16:46:38 0 0 SQL5043N Support for one or more communications protocols failed to start successfully. However, core database manager functionality started successfully.
    SQL1063N DB2START processing was successful.

    Still I'm not able to connect to the database.

    I'm trying to connect to a remote database on a solaris server from my local workstation.

    Regards
    Yadu

  6. #6
    Join Date
    Oct 2005
    Posts
    16
    Forgot to mention in my reply.

    I could see a different error this time, when I tried to add database using Client configuration agent.

    "CLI connection failed.
    SQL1337N The service "BOBDB" was not found."
    Last edited by yadu; 10-24-06 at 13:17.

  7. #7
    Join Date
    Jun 2006
    Posts
    471

    connect

    the first error : when doing db2start this will be related to the db2comm setting
    check the db2diag.log for this
    have you verified the ifconfig...
    for the remote client and second problem
    you have cataloged the tcpip node with remote service name and not found locally. instead try :
    from command window :
    db2 catalog tcpip node xxx remote ipaddress_server server portnumber
    db2 catalog db yy at node xxx
    or use dbcca and use same values (but specify port and not service)
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  8. #8
    Join Date
    Oct 2005
    Posts
    16
    Guy,

    Initially the first error I got was due to service name in lowercase in /etc/services.

    I got around the second error as you had suggested by specifying the ipaddress instead of hostname.

    Everythign is working as expected now. Thanks for your valuable inputs

Posting Permissions

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