ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ODBC connection to DB2 9.5

Post new topic  Reply to topic
 ODBC connection to DB2 9.5 « View previous topic :: View next topic » 
Author Message
pvsp
PostPosted: Thu Jan 16, 2014 5:55 am    Post subject: ODBC connection to DB2 9.5 Reply with quote

Apprentice

Joined: 17 Feb 2008
Posts: 36
Location: Warsaw, PL

Hi,

I have installed Integration Bus 9 and I need to create connection to remote DB2 9.5 server (64bit).

I have installed IE02 and next I have created env:

ODBCSYSINI=/var/mqsi/odbc
ODBCINI=/var/mqsi/odbc/odbc.ini
IE02_PATH=/opt/ibm/IE02/2.0.1

because the mqsicvp needs this env.

Next I have created odbc.ini and odbcinst.ini and set like below:

[ODBC Data Sources]
EAI_DS=IBM DB2 ODBC Driver

;###########################################
;###### Individual data source stanzas #####
;###########################################

;# DB2 stanza
[EAI_DS]
DRIVER=/opt/ibm/mqsi/9.0.0.0/lib/libdb2Wrapper64.so
Description=IBM DB2 ODBC Database
Database=BCS24A

I used mqsisetdbparams

mqsisetdbparms BROKER_DEV1 -n EAI_DS -u db2inst1 -p mypass

I have created BCS24A alias and when I would like to try mqsicvp, I got error:

mqsicvp -n EAI_DS -u db2inst1 -p mypass

BIP8290I: Verification passed for the ODBC environment.

BIP2393E: Database error: ODBC return code '-1' from data source ''EAI_DS'' using ODBC driver manager ''/opt/ibm/IE02/2.0.1/lib/libodbcinterface.so''.
The broker received an error when processing a database operation. The ODBC return code was '-1'. See the following messages for information obtained from the database about this error.
Use the following messages to determine the cause of the error. Typical problems are an incorrect data source, or table names. Correct either the database or the broker configuration. Use the mqsicvp command to test connectivity to this database.
BIP2322E: Database error: SQL State ''08001''; Native Error Code '-1013'; Error Text ''[unixODBC][IBM][CLI Driver] SQL1013N The database alias name or database name "EAI_DS" could not be found. SQLSTATE=42705 ''.
The error has the following diagnostic information: SQL State ''08001'' SQL Native Error Code '-1013' SQL Error Text ''[unixODBC][IBM][CLI Driver] SQL1013N The database alias name or database name "EAI_DS" could not be found. SQLSTATE=42705 ''
This message may be accompanied by other messages describing the effect on the message broker itself. Use the reason identified in this message with the accompanying messages to determine the cause of the error. Use the mqsicvp command to test connectivity to this database.


BIP8040E: Unable to connect to the database.
The database cannot be accessed with the specified user Id and password pair.
- Check that the database is running.
- Check that the database has an adequate number of database connections available for use.
- On Windows, check that an ODBC connection has been created.
- On systems that use $ODBCINI, check that the file pointed to by $ODBCINI has been correctly updated.
- On z/OS check the BIPDSNAO member of the component's dataset, and check the DB2 64bit ODBC driver (DSNAO64C) is in the STEPLIB.
- Use mqsisetdbparms to set the password to the correct value and try again.

So, now I have no idea what I can do next to obtain this connection


Last edited by pvsp on Thu Jan 16, 2014 6:44 am; edited 1 time in total
Back to top
View user's profile Send private message
pvsp
PostPosted: Thu Jan 16, 2014 6:36 am    Post subject: Reply with quote

Apprentice

Joined: 17 Feb 2008
Posts: 36
Location: Warsaw, PL

I checked db2 alias and It seems to be correct:


[root@iibdev141 ~]# db2 connect to BCS24A user db2inst1 using mypass

Database Connection Information

Database server = DB2/LINUXX8664 9.5.4
SQL authorization ID = DB2INST1
Local database alias = BCS24A




and I also try to use another driver:

DRIVER=/opt/ibm/db2/V9.7/lib64/libdb2.so


and the error is:

BIP2393E: Database error: ODBC return code '-1' from data source ''EAI_DS'' using ODBC driver manager ''/opt/ibm/IE02/2.0.1/lib/libodbcinterface.so''.
The broker received an error when processing a database operation. The ODBC return code was '-1'. See the following messages for information obtained from the database about this error.
Use the following messages to determine the cause of the error. Typical problems are an incorrect data source, or table names. Correct either the database or the broker configuration. Use the mqsicvp command to test connectivity to this database.
BIP2322E: Database error: SQL State ''08001''; Native Error Code '-1013'; Error Text ''[unixODBC][IBM][CLI Driver] SQL1013N The database alias name or database name "EAI_DS" could not be found. SQLSTATE=42705 ''.
The error has the following diagnostic information: SQL State ''08001'' SQL Native Error Code '-1013' SQL Error Text ''[unixODBC][IBM][CLI Driver] SQL1013N The database alias name or database name "EAI_DS" could not be found. SQLSTATE=42705 ''
This message may be accompanied by other messages describing the effect on the message broker itself. Use the reason identified in this message with the accompanying messages to determine the cause of the error. Use the mqsicvp command to test connectivity to this database.



but, I have checked db2 alias and works fine :/
Back to top
View user's profile Send private message
dogorsy
PostPosted: Fri Jan 17, 2014 1:24 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

Is the database cataloged on the machine from which you're trying to connect?
Back to top
View user's profile Send private message
pvsp
PostPosted: Fri Jan 17, 2014 1:33 am    Post subject: Reply with quote

Apprentice

Joined: 17 Feb 2008
Posts: 36
Location: Warsaw, PL

OK, I have solved my problem, I really don't know that data source name must have the same name as DB2 alias.

When I set odbc.ini to


[ODBC Data Sources]
BCS24A=IBM DB2 ODBC Driver

;###########################################
;###### Individual data source stanzas #####
;###########################################

;# DB2 stanza
[BCS24A]
DRIVER=/opt/ibm/mqsi/9.0.0.0/lib/libdb2Wrapper64.so
Description=IBM DB2 ODBC Database
Database=BCS24A


now, all works well
Back to top
View user's profile Send private message
dogorsy
PostPosted: Fri Jan 17, 2014 1:38 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

pvsp wrote:
I really don't know that data source name must have the same name as DB2 alias.

That is documented.
Back to top
View user's profile Send private message
pvsp
PostPosted: Fri Jan 17, 2014 1:51 am    Post subject: Reply with quote

Apprentice

Joined: 17 Feb 2008
Posts: 36
Location: Warsaw, PL

Do you think about this:
http://pic.dhe.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/bk58070_.htm


I see example

;# DB2 stanza
[DB2DB]
DRIVER=<Your DB2 install directory>/lib64/db2o.o
Description=IBM DB2 ODBC Database
Database=DB2DB


But I don't see information the Database must be the same name as data source
Back to top
View user's profile Send private message
dogorsy
PostPosted: Fri Jan 17, 2014 1:56 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

pvsp wrote:
Do you think about this:
http://pic.dhe.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/bk58070_.htm


I see example

;# DB2 stanza
[DB2DB]
DRIVER=<Your DB2 install directory>/lib64/db2o.o
Description=IBM DB2 ODBC Database
Database=DB2DB


But I don't see information the Database must be the same name as data source

Quote:
In Database, type the DB2 alias. The data source name must be the same as the database alias name. If you are using a remote DB2 database, you must set up your client/server connection to resolve this alias to the correct database.

If the requirement is to have multiple stanzas that refer to the same DB2 database, aliases must be created in DB2 by using the DB2 CATALOG command. These aliases can then have their own stanza in the ODBCINI file.

The ODBCINI file cannot be used to set up aliases for DB2.

For more information, see the DB2 documentation.


http://pic.dhe.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/bk58060_.htm
Back to top
View user's profile Send private message
pvsp
PostPosted: Fri Jan 17, 2014 2:10 am    Post subject: Reply with quote

Apprentice

Joined: 17 Feb 2008
Posts: 36
Location: Warsaw, PL




thx
Back to top
View user's profile Send private message
saksoa
PostPosted: Sun Feb 23, 2014 8:17 pm    Post subject: Reply with quote

Newbie

Joined: 23 Feb 2014
Posts: 1

appreciate if someone can help me in setting up the db2 odbc connection from IIB9, I gone through IIB documentation and it says "If you are using a remote DB2 database, you must set up your client/server connection to resolve this alias to the correct database".

How should I setup this, do I need to download and install DB2client on linux and create an alias.

For oracle all we do is just define the datasource definition in the odbc.ini file, but DB2 is not straight forward, why we need this client/server connection.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ODBC connection to DB2 9.5
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.