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 > Problem in ODBC connectivity, please help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-18-09, 21:45
stupidcute stupidcute is offline
Registered User
 
Join Date: Nov 2009
Posts: 8
Problem in ODBC connectivity, please help

Hi,

I facing a problem in ODBC connectivity.

i have 2 DB namely A (Production), B (Development) and C (Client).

i installed db2 client in C and create ODBC connection to A and B

However, when i test the ODBC connection to one of the database in B, i found out that its actually connecting to one of the DB in A

I noticed this because when i key in password for B in ODBC connection, the connection failed. However, if i key in password for A in this ODBC connection,
the connection successful.

(Please take note that i created this ODBC connection is to B and not A)

C using Windows server 2003


Anyone facing this problem before? Please help.
Reply With Quote
  #2 (permalink)  
Old 11-18-09, 22:06
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by stupidcute View Post
(Please take note that i created this ODBC connection is to B and not A)
How do you know that?
Reply With Quote
  #3 (permalink)  
Old 11-19-09, 00:09
sawangupta sawangupta is offline
Registered User
 
Join Date: Nov 2009
Location: Bangalore
Posts: 25
Verify the ODBC connection settings. Check db2cli.ini

Regards,
Sawan Gupta
Reply With Quote
  #4 (permalink)  
Old 11-19-09, 01:14
stupidcute stupidcute is offline
Registered User
 
Join Date: Nov 2009
Posts: 8
Database name in A(Production) is TEST
Database name in B(Development) is TEST.

I connect to B database but it connect A

ODBC Setting as below:

DATA SOUCE TAB

Data Source Name : TEST



TCP/IP TAB

DATABASENAME: TEST
DATABASE ALIAS:TEST
HOSTNAME: B
Port :50000
Reply With Quote
  #5 (permalink)  
Old 11-19-09, 01:22
sawangupta sawangupta is offline
Registered User
 
Join Date: Nov 2009
Location: Bangalore
Posts: 25
On the client C, is production db cataloged with same alias name ?
Reply With Quote
  #6 (permalink)  
Old 11-19-09, 02:01
stupidcute stupidcute is offline
Registered User
 
Join Date: Nov 2009
Posts: 8
Quote:
Originally Posted by sawangupta View Post
On the client C, is production db cataloged with same alias name ?
Hmmm.... how to check the production db cataloged same with alias name in client C?


I do not understand what is the db cataloged, can explain more?


I saw db2cli.ini

A (Production)

[TEST]
DBALIAS=TEST

B (Development)

[TEST]
DBALIAS=TEST


C (Client)

[TEST]
DBALIAS=TEST
Reply With Quote
  #7 (permalink)  
Old 11-19-09, 02:04
stupidcute stupidcute is offline
Registered User
 
Join Date: Nov 2009
Posts: 8
Thanks for your reply Sawangupta.

Hope you can assist me....
Reply With Quote
  #8 (permalink)  
Old 11-19-09, 03:53
sawangupta sawangupta is offline
Registered User
 
Join Date: Nov 2009
Location: Bangalore
Posts: 25
With the catalogued db I meant the db directory.

Does "db2 list db directory" & "db2 list node directory" shows any entry for the production database with alias TEST ?


Which driver are you using at the client ? Runtime client ?
Reply With Quote
  #9 (permalink)  
Old 11-19-09, 10:36
stupidcute stupidcute is offline
Registered User
 
Join Date: Nov 2009
Posts: 8
Hi,

I have checked the entries by using the command that you given at above.

I found out that the DB Alias=TEST is "tie" to my production server ip.

Can i know
(i) How to remove the node record that tie to my Prod DB IP?
(ii) How to remove the db record and recreate my db record so that it will tie to my development IP?

Thanks in advance.


Regards,
Reply With Quote
  #10 (permalink)  
Old 11-19-09, 18:59
sawangupta sawangupta is offline
Registered User
 
Join Date: Nov 2009
Location: Bangalore
Posts: 25
Use

db2 uncatalog db <dbalias>
db2 uncatalog node <node-name>
Reply With Quote
  #11 (permalink)  
Old 11-19-09, 20:29
stupidcute stupidcute is offline
Registered User
 
Join Date: Nov 2009
Posts: 8
Hi,

I follow your instructions, the node and db already removed.

Then i readd the "TEST" in ODBC,

and check with "db2 list db directory" & "db2 list node directory" again

the node directory is pointed to B (development) now.


however when i query table using the newly created ODBC connection, it shows table in

production DB but not table in development DB.



** i use IBM - DB2 Run-Time Client Lite **


Thanks
Reply With Quote
  #12 (permalink)  
Old 11-20-09, 00:04
sawangupta sawangupta is offline
Registered User
 
Join Date: Nov 2009
Location: Bangalore
Posts: 25
Could you please take a CLI Trace.

IBM DB2 9.7 for Linux, UNIX and Windows Information Center

Regards,
Sawan Gupta
Reply With Quote
  #13 (permalink)  
Old 11-23-09, 21:37
stupidcute stupidcute is offline
Registered User
 
Join Date: Nov 2009
Posts: 8
Quote:
Originally Posted by sawangupta View Post
Could you please take a CLI Trace.

IBM DB2 9.7 for Linux, UNIX and Windows Information Center

Regards,
Sawan Gupta
hi,

Thanks for your advice.


I uninstall DB2 client in C and reinstall

again. Then i readd the "TEST" database(B(development)) in C(Client) ODBC

connection. The connection is successful.


Is it only can add one connection in ODBC if the database(TEST) name is

same and both database is in different environment (A(production), B

(development))??


Thank you very much
Reply With Quote
  #14 (permalink)  
Old 11-24-09, 08:00
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by stupidcute View Post


Is it only can add one connection in ODBC if the database(TEST) name is

same and both database is in different environment (A(production), B

(development))??

No. You catalog databases under different alias ("catalog db test as testdev at node devhost"), then create an ODBC data source referring to the alias.
Reply With Quote
  #15 (permalink)  
Old 11-24-09, 23:29
stupidcute stupidcute is offline
Registered User
 
Join Date: Nov 2009
Posts: 8
Thanks n_i.....
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