Author |
Message
|
pvsp |
Posted: Thu Jan 16, 2014 5:55 am Post subject: ODBC connection to DB2 9.5 |
|
|
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 |
|
 |
pvsp |
Posted: Thu Jan 16, 2014 6:36 am Post subject: |
|
|
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 |
|
 |
dogorsy |
Posted: Fri Jan 17, 2014 1:24 am Post subject: |
|
|
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 |
|
 |
pvsp |
Posted: Fri Jan 17, 2014 1:33 am Post subject: |
|
|
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 |
|
 |
dogorsy |
Posted: Fri Jan 17, 2014 1:38 am Post subject: |
|
|
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 |
|
 |
pvsp |
Posted: Fri Jan 17, 2014 1:51 am Post subject: |
|
|
Apprentice
Joined: 17 Feb 2008 Posts: 36 Location: Warsaw, PL
|
|
Back to top |
|
 |
dogorsy |
Posted: Fri Jan 17, 2014 1:56 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
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 |
|
 |
pvsp |
Posted: Fri Jan 17, 2014 2:10 am Post subject: |
|
|
Apprentice
Joined: 17 Feb 2008 Posts: 36 Location: Warsaw, PL
|
thx |
|
Back to top |
|
 |
saksoa |
Posted: Sun Feb 23, 2014 8:17 pm Post subject: |
|
|
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 |
|
 |
|