odbc - connecting to DB2 database:[unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed -
odbc.ini:
[default] driver = db2 [abc] driver = db2 [dsn_test1] description = connection db2 driver = db2
odbcinst.ini:
[db2] description = db2 driver driver = /home/user/sqllib/lib/libdb2.so fileusage=1 dontdlclose=1 [odbc] trace=1 tracefile=/home/user/sqllib/trace.out
db2cli.ini
[abc] hostname="hostname" pwd="passwd" port="port" protocol=tcpip database="dbname" uid="uid"
$ ./isql abc
+---------------------------------------+ | connected! | | | | sql-statement | | [tablename] | | quit | | | +---------------------------------------+
while connecting db2 driver,below error coming:
connection attempt data source name "abc": =============================================================================== odbc driver manager path: /home/user/sqllib/odbclib/lib/libodbc.so [failed]: [unixodbc][driver manager]driver's sqlallochandle on sql_handle_henv failed
below snippet of odbc trace:
[odbc][23419][1403783774.660159][sqlconnect.c][1380]error: im004 [odbc][23419][1403783774.660223][sqlerror.c][434] entry: connection = 0x81aaac8 sqlstate = 0xffff9593 native = 0xffff9684 message text = 0xffff8d93 buffer length = 1024 text len ptr = 0xffff95bc [odbc][23419][1403783774.660260][sqlerror.c][471] exit:[sql_success] sqlstate = im004 native = 0xffff9684 -> 0 message text = [[unixodbc][driver manager]driver's sqlallochandle on sql_handle_henv failed]
googled lot root-cause,dint helped much,please provide pointer solve this. 32 bit linux machine having 32 bit db driver well.
according http://www-01.ibm.com/support/docview.wss?uid=swg21229860, im004 sqlstate on sqlallochandle indicates:
cause
the new security features introduced in db2® universal database™ (db2 udb) version 8.2 prevent users using database unless belong windows® groups db2admns or db2users.
and
answer
add userid (the 1 used execute application) either db2admns or db2users group. please refer link under "related information" (below) instructions on how accomplish this.
alternatively, there number of threads (e.g. http://mailman.unixodbc.org/pipermail/unixodbc-support/2010-september/002661.html) suggest setting db2instance environment variable match instance setting in odbc.ini file dsn concerned.
Comments
Post a Comment