centos7安装DB2
操作系统 linux centos7
DB2版本 11.1
1、取包
IBM MRS Tool
将安装包放在 /home/software 下面
mkdir -p /home/software cd /home/software wget https://iwm.dhe.ibm.com/sdfdl/v2/regs2/db2pmopn/Express-C/DB2ExpressC11/Xa.2/Xb.aA_60_-i7wWKFMFpbW1xl1qHwml3g-MFTE0ro0tBPjI/Xc.Express-C/DB2ExpressC11/v11.1_linuxx64_expc.tar.gz/Xd./Xf.lPr.D1vk/Xg.12511196/Xi.swg-db2expressc/XY.regsrvs/XZ.2XBfQgr9wa2iZ0fSlN-jCwFRWac-vegO/v11.1_linuxx64_expc.tar.gztar -zxvf v11.1_linuxx64_expc.tar.gz
2、安装所需依赖
yum install -y bc binutils* compat-libcap1* compat-libstdc* elfutils-libelf* elfutils-libelf-devel* fontconfig-devel* glibc* glibc-devel* ksh libaio* libaio-devel* libX11* libXau* libXi* libXtst* libXrender* libXrender-devel* libgcc* libstdc++* libstdc++-devel* libxcb* make net-tools nfs-utils smartmontools sysstat unixODBC gcc gcc-c++ python python-configshell python-rtslib python-six targetcli ntpyum install -y libstdc++.i686yum install -y pam.i686yum install pam-1.1.8-23.el7.i686 -yyum install libstdc++.so.6 -y
3、安装前环境检测
cd /home/software/expc
[db2inst1@pear expc]$ ./db2prereqcheck
会有一些错误,但是影响不大
4、安装数据库
[db2inst1@pear expc]$./db2_install
5、创建用户、用户组
groupadd -g 2000 db2iadm1
groupadd -g 2001 db2fadm1
useradd -m -g db2iadm1 -d /home/db2inst1 db2inst1
useradd -m -g db2fadm1 -d /home/db2fenc1 db2fenc1
passwd db2inst1
Db2@1997
6、添加证书
cd /opt/ibm/db2/V11.1/adm
chmod -R 755 *
./db2licm -a /home/software/expc/db2/license/db2expc_uw.lic
7、启动数据库监听
cd /opt/ibm/db2/V11.1/instance/
chmod -R 775 *
./db2icrt -p 50000 -u db2fenc1 db2inst1
进入数据库
切换用户
su -l db2inst1
创建样本数据库
db2sampl
测试连接
密码为上面用户的密码