If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Connecting to a Remote Database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-06, 08:58
yadu yadu is offline
Registered User
 
Join Date: Oct 2005
Posts: 16
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
Reply With Quote
  #2 (permalink)  
Old 10-24-06, 10:24
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Please supply DB2 version ans OS version. Have you tried issuing a CONNECT to DB command? Have you tried LIST APPLICATIONS?

Andy
Reply With Quote
  #3 (permalink)  
Old 10-24-06, 11:13
yadu yadu is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 10-24-06, 11:30
guyprzytula guyprzytula is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 10-24-06, 11:51
yadu yadu is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 10-24-06, 11:53
yadu yadu is offline
Registered User
 
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 12:17.
Reply With Quote
  #7 (permalink)  
Old 10-25-06, 06:04
guyprzytula guyprzytula is offline
Registered User
 
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
Reply With Quote
  #8 (permalink)  
Old 10-25-06, 06:16
yadu yadu is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On