Installing DB2 Manually

Summarized from [url=http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.qb.server.doc/doc/t0007068.html]DB2 9.7 Official Document[/url]


# tar -xzf DB2*.tar.gz

./db2_install

# adding instance/fenced/dasadmin groups
groupadd -g 999 db2iadm1
groupadd -g 998 db2fadm1
groupadd -g 997 dasadm1


# create db2 users and their home directories
useradd -u 1004 -g db2iadm1 -m -d /home/db2inst1 db2inst1 -p <password>
touch /home/db2inst1/.profile
chown db2inst1 /home/db2inst1/.profile
useradd -u 1002 -g dasadm1 -m -d /opt/ibm/db2/V9.7/dasusr1 dasusr1 -p <password>
touch /opt/ibm/db2/V9.7/dasusr1/.profile
chown dasusr1 /opt/ibm/db2/V9.7/dasusr1/.profile
useradd -u 1003 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1 -p <password>

passwd db2inst1
passwd db2fenc1
passwd dasusr1
# add additional user to dasadm1 if needed
usermod -a -G dasadm1 <user>


# create instance

## new instance 'db2inst1' under db2inst1's home
<install_dir>/instance/db2icrt -p 50000 -u db2fenc1 db2inst1

## create das server under dasusr1' home
<install_dir>/instance/dascrt -u dasusr1
## add instance owner(db2inst1) to dasadm1 group
usermod -a -G dasadm1 db2inst1

# optional, create links for headers and libs
/opt/ibm/db2/V9.7/cfg/db2ln

# tcpip config: add following line into /etc/services
db2c_db2inst1 50000/tcp

# login as db2inst1 to configure this instance

## add following line to /home/db2inst1/.profile and re-login
. sqllib/db2profile
## set communication protocol
db2 update dbm cfg using svcename 50000
db2set DB2COMM=tcpip
## add licence
db2licm -a <licence_file_name>
## create sample database
db2sampl

# add Linux user as db2iadm1

## add user to db2idm1 group
usermod -a -G dasadm1 <username>
## login in as instance owner and connect to database sample
su - dbin2st1
db2 connect to sample
## grant DBADM privilege to db2iadm1 group
db2 GRANT DBADM ON DATABASE to group db2iadm1;
exit # exit login as db2inst1
## add following line to your ~/.profile
## . /db2home/db2inst1/sqllib/db2profile

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值