IBM_DB+DB2 10.1+Archlinux 64bit

1,040 views
Skip to first unread message

Pronoy Chopra

unread,
Aug 17, 2012, 7:29:15 PM8/17/12
to ibm...@googlegroups.com
Hello,

I am trying to install IBM DB2 on Arch and was successful except during installation it created three new users. Now in order to install ibm_db I have to set my IBM_DB_HOME accordingly. But since three new users are created, one of them being db2inst1 there is no db2inst1 in my home directory. How do I set the variable in that case? Do I have to login as db2inst1 user and work from there? And by that I mean using

`sudo su db2inst1`as well.

Praveen

unread,
Aug 18, 2012, 12:29:08 PM8/18/12
to ibm_db
Hi Pronoy,

You can set the IBM_DB_HOME variable to DB2 installation directly and
the db2 python driver installation will go through fine.

When trying to use the driver make sure LD_LIBRARY_PATH env variable
is set to lib64 directory of DB2 {if your python is 32-bit then to
lib32} and you are ready.

Let us know if you need further help/information.

Thanks

Praveen

Pronoy Chopra

unread,
Aug 18, 2012, 12:42:06 PM8/18/12
to ibm...@googlegroups.com
Okay I successfully fixed that problem. But I had to edit the setup.py file 

I commented out the try and except portion that imports the ibm_db_home = os.environ['IBM_DB_HOME'] and directly used the values. I know, it should've done it on its own but it was raising the KeyError. I checked using IDLE and it seemed to work, but not through the script.

I commented out that block and put this:

ibm_db_home = '/home/db2inst1/sqllib'
ibm_db_dir = ibm_db_home
ibm_db_lib = ibm_db_home + '/' + libDir


Either way the installation now proceeds, but I get this error now:

ibm_db.h:15:21: fatal error: sqlcli1.h: No such file or directory

I looked in the include folder and there is only one file asn.h rest are missing. Do I have to install something else for this?

Praveen

unread,
Aug 18, 2012, 1:01:47 PM8/18/12
to ibm_db
Hi Pronoy,

If the environment variable IBM_DB_HOME is not set then the exception
is expected.

Coming to the issue of missing include files, looks like during DB2
installation application development tools have not been selected for
installation. Select the application development tools for
installation and things should be in place.

BTW, which version and edition of DB2 are you using?

Thanks

Praveen

Pronoy Chopra

unread,
Aug 18, 2012, 1:06:07 PM8/18/12
to ibm...@googlegroups.com
I am using DB2 10.1 for linux 64 bit.

The problem of the IBM_DB_HOME env variable is as I explained. When I tried it in IDLE like so:

import os
foo = os.environ['IBM_DB_HOME']
print foo

it gives me /home/db2inst1/sqllib

But the setup.py fails. 

Also, I haven't installed the Data Studio Admin Client. Do I need to install that?

Praveen

unread,
Aug 18, 2012, 11:42:45 PM8/18/12
to ibm_db
Hi Pronoy,

No, you will not need the Data Studio admin client for using the DB2
Python driver.

Thanks

Praveen

Rahul

unread,
Aug 21, 2012, 4:15:30 AM8/21/12
to ibm...@googlegroups.com
Hi Pronoy,
  The IBM_DB_HOME environment variable problem may occurs due to you have set this env variable for current user but tried to run the setup.py with sudo.

 To overcome this problem you can run your shell as root through command "sudo -s" then after set the IBM_DB_HOME environment variable.

Thanks,
Rahul
Reply all
Reply to author
Forward
0 new messages