Installing db2 express c in Ubuntu

0. update your apt database:
sudo apt-get update


1. update your Source-List /etc/apt/source.list, uncommnent the following lines:

deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner


2. install db2express-c:

sudo apt-get install db2exc


3. if you met error like below,then make sure you have memory larger than 512MB. I met the error when I gave my VM 256MB memory (the official requirements said it is 256MB/512MB...). Another solution could be found [url=https://www.ibm.com/developerworks/mydeveloperworks/blogs/checkingin/entry/sql1042c_when_trying_to_start_db2_on_linux4?lang=en]here[/url] (saying you need to run db2start one more time).
Message: SQL1042C  An unexpected system error occurred.  SQLSTATE=58004


4. verify installation:
# login as db2 instance owner
sudo su - db2inst1
# create sample database
db2sampl
# connect to sample database
db2 connect to sample
# list tables and query by db2 command line interface (CLI)
db2 list tables
db2 "select * from emp"


5. create sample database user

# exit the login of db2inst1
exit
# create a new Ubuntu user since db2 use system authentication
sudo useradd -d /home/db2user db2user
# set password for db2user
sudo passwd db2user
# login as db2inst1 again to grant privilege to new user "db2user"
sudo su - db2inst1
db2 connect to sample
db2 grant DBADM on database to user db2user


6. change db2inst1 password:

# i'm not sure what the default password is
# but you'd better change it to make your system safe
sudo passwd db2inst1


more information:
the user name "db2inst1" may be different if you have installed db2 in your system before. (the last number '1' will increase by your installations)
if you met any other problems check the diagnostic log first:
/home/db2inst3/sqllib/db2dump/db2diag.log
[url=http://www.ibm.com/developerworks/wikis/display/im/Ubuntu+10.04+-+DB2+9.7]IBM Official DB2 for Ubuntu Wiki[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值