database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
ㆍDB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
DB2 Q&A 67 게시물 읽기
No. 67
Using IBM DB2 with unixODBC
작성자
꺼벙이
작성일
2001-06-01 19:11
조회수
11,815

Using IBM DB2 with unixODBC

I have had a number of requests from people wanting to connect to IBM's DB2

from Linux via unixODBC. This short document details what I know about this at

the moment. If anyone can contribute more imformation then please contact me

at the address at the end of the document.

 

This document originally refered to the 6.1 version of DB2, since then I have

tried the 7.1 build and with a couple of changes, these are detailed at the

end of this document.

 

First, install the DB2 Client access package from IBM it will install the IBM

CLI driver, this works with unixODBC as a ODBC driver.

 

Using the install in the Client Access package, setup the client access to

give you a instance name (ie db2inst1), then setup your odbcinst.ini entry

like this.

 

 

[DB2]

Description = DB2 Driver

Driver = /usr/IBMdb2/V6.1/lib/libdb2.so

FileUsage = 1

DontDLClose = 1

 

The DontDLClose is required to avoid a problem in the driver when dynamically

loaded (I suspect its registering a exit function which isn't being called).

 

Then setup your odbc.ini like this.

 

 

[sample]

Description = Test to DB2

Driver = DB2

(Driver 를 DB2를 넣으면 않되더라고요. 그래서 /usr/IBMdb2/V7.1/lib/libdb2.so 넣으면 되요)

Then when it comes to connecting, you MUST have the environment variable

DB2INSTANCE set to a vaild db2 instance, so for instance to connect with isql

 

export DB2INSTANCE=db2inst1

isql -v sample db2inst1 ibmdb2

 

That should be all there is to it.

 

Version 7.1

Since originally creating this document, IBM have released a new version of

DB2 7.1. I have tried the 7.1 build and with a couple of changes, the same

method seems to work fine. The only difference being the name of the package,

where the document used to refer to the DB2 Client access package, the CLI

driver is now to be found in the DB2 Personal Developer's Edition V7.1.

 

If using the 7.1 build the path to the library is now

 

Driver = /usr/IBMdb2/V7.1/lib/libdb2.so

 

I have also found that you need to add "/usr/IBMdb2/V7.1/lib" to /etc/ld.so.conf.

 

It has been reported that this installation doesn't work in some situations.

the attempt to open the driver fails, and cannot find a symbol sqltevents in

libdpdcf.a. I hav'nt had this problem, so I wonder if there is a difference

between platform, or builds of the DB2 instance. If anyone has any more info

on this let me know.

 

Another useful hint. Somewho has been using PHP+DB2 on AIX via unixODBC to a

BIG IBM server (4 processors, bags of core etc), and finding it was slow. It

turns out there is a bug in IBM's TCP/IP stack. after looking at this and

setting this

 

$ su - db2inst1

$ db2set DB2TCPCONNMGRS=1

 

To quote "... the difference was UNBELIEVABLE !!!". Thanks Eric.

If this is of any help to someone, good, any problems let me know.

 

Nick Gorham

 

출처 : http://www.unixodbc.org/doc/db2.html

[Top]
No.
제목
작성자
작성일
조회
73heap 크기 바꾸기..
조율제
2001-06-21
9947
71리눅스에서 db2 사용권한 주기.....
김원성
2001-06-08
9912
72┕>Re: 리눅스에서 db2 사용권한 주기.....
조율제
2001-06-08 22:16:22
10257
79 ┕>Re: Re: 리눅스에서 db2 사용권한 주기.....
김태상
2001-06-26 10:25:52
10183
69db2에서 시퀀스문은 어떻게??
조풍연
2001-06-07
10597
70┕>Re: db2에서 시퀀스문은 어떻게??
revizes
2001-06-08 01:42:23
17115
67Using IBM DB2 with unixODBC
꺼벙이
2001-06-01
11815
68┕>DB2 SAMPLE PHP 4 예제
꺼벙이
2001-06-01 11:31:44
10703
63WOW LINUX 7.0에서 DB2 1.7 버전 설치 에러
인흥렬
2001-05-25
10417
65┕>Re: WOW LINUX 7.0에서 DB2 1.7 버전 설치 에러
조율제
2001-05-26 15:12:52
11013
57DB2에서 ROLLBACK이 되나요???
급급이
2001-05-22
11666
60┕>Re: DB2에서 ROLLBACK이 되나요???
조율제
2001-05-22 18:43:32
13163
56db2 cookbook
유성웅
2001-05-22
13050
59┕>Re: db2 cookbook
조율제
2001-05-22 17:53:17
13252
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2022 DSN, All rights reserved.
작업시간: 0.013초, 이곳 서비스는
	PostgreSQL v13.3으로 자료를 관리합니다