linux db2 安装
1、解压缩安装包
#gunzip v9.7_linuxia32_server.tar.gz
#tar -xvf v9.7_linuxia32_server.tar
2、进入解压后的文件目录,执行安装:(我们选择手动安装)
注意:DB2_install为手动安装 db2_setup为图形安装
#./Db2_install-------no-----aese
3、创建DB2运行所需的组和用户:
#groupadd -g 901 db2grp
#groupadd -g 902 db2fgrp
#groupadd -g 903 db2agrp
#useradd -g db2grp -u 801 -d /home/db2inst1-m -s /bin/bash db2inst1 --管理当前实例
#useradd -g db2fgrp -u 802 -d /home/db2fenc-m -s /bin/bash db2fenc
#useradd -g db2agrp -u 803 -d /home/db2das-m -s /bin/bash db2das --管理所有实例
4、设置密码:
passwd db2inst1
passwd db2fenc
passwd db2das
5、创建实例
#cd /opt/ibm/db2/V9.7/instance
#./dascrt -u db2das
#./db2icrt -u db2inst1 db2inst1
注意:DBI1922N The host name is not valid.报无法解析错误,在/etc/hosts文件中添加解析参数即可
注释:
Dascrt:创建的是DB2 adminstration server,每台服务器只有一个这种server,为进行DB2管理(比如运行控制中心)所必须,同时指定其管理用户是db2das。
db2icrt:创建的是实例,其名字一般和管理用户名一样,这里均为db2inst1。
6、启动DB2
# su - db2das
$ db2admin start ----启动DB2管理服务器
SQL4409W The DB2 Administration Server is already active.
$su - db2inst1
$ db2start ----启动数据库实例
05/07/2012 01:30:04 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
7、检查DB2是否起来,状态如下:
[db2inst1@jetsen ~]$ ps -ef|grep db2
db2das 10828 1 0 01:23 ? 00:00:00 /home/db2das/das/adm/db2dasrrm
root 11345 1 0 01:23 ? 00:00:00 /opt/ibm/db2/V9.7/bin/db2fmcd
db2das 11354 1 0 01:23 ? 00:00:00/opt/ibm/db2/V9.7/das/bin/db2fmd -i db2das -m/opt/ibm/db2/V9.7/das/lib/libdb2dasgcf.so.1
root 17267 2768 0 01:29 pts/1 00:00:00 su - db2das
db2das 17268 17267 0 01:29 pts/1 00:00:00 -bash
root 17329 17268 0 01:29 pts/1 00:00:00 su - db2inst1
db2inst1 17332 17329 0 01:29 pts/1 00:00:00 -bash
root 17446 1 1 01:29 pts/1 00:00:01 db2wdog 0
db2inst1 17448 17446 1 01:29 pts/1 00:00:01 db2sysc 0
root 17449 17448 0 01:29 pts/1 00:00:00 db2ckpwd 0
root 17450 17448 0 01:29 pts/1 00:00:00 db2ckpwd 0
root 17451 17448 0 01:29 pts/1 00:00:00 db2ckpwd 0 &n