`
zealotds
  • 浏览: 122374 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

Installing DB2 Manually

db2 
阅读更多
Summarized from DB2 9.7 Official Document

# 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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics