Centos7 DB2的安装

Centos7 DB2的安装

    • DB2准备
    • DB2安装
    • 问题
    • 参考

Centos版本:CentOS Linux release 7.7.1908

DB2准备

Express-C版本的DB2:

mkdir -p /data/soft
cd /data/soft/
# 将下载好的v11.1_linuxx64_expc.tar.gz文件移至当前路径
wget -b https://iwm.dhe.ibm.com/sdfdl/v2/regs2/db2pmopn/Express-C/DB2ExpressC11/Xa.2/Xb.aA_60_-i7xHV3LNY9W4oKmoUGNqLFdWmv_0RweZQ_Zg/Xc.Express-C/DB2ExpressC11/v11.1_linuxx64_expc.tar.gz/Xd./Xf.LPr.D1vk/Xg.10657605/Xi.swg-db2expressc/XY.regsrvs/XZ.D39ZibHnK_V4S3EMp-P_qI1pVQo/v11.1_linuxx64_expc.tar.gz

DB2安装

tar -zxvf v11.1_linuxx64_expc.tar.gz
cd expc/
./db2_install
# 输入两次yes,等待其安装完成
# 创建用户组并设置密码
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
passwd db2fenc1
# 安装 license(产品许可证) PS:如果是ExpressC版本就不用做
cd /opt/ibm/db2/V11.1/adm/
chmod -R 775 *
./db2licm -a /data/soft/expc/db2/license/db2expc_uw.lic
# 创建实例和样本数据库
cd /opt/ibm/db2/V11.1/instance/
chmod -R 755 *
./db2icrt -p 50000 -u db2fenc1 db2inst1
# DBI1070I  Program db2icrt completed successfully.
su - db2inst1
db2sampl 

#  Starting the DB2 instance...
#  Creating database "SAMPLE"...
#  Connecting to database "SAMPLE"...
#  Creating tables and data in schema "DB2INST1"...
#  Creating tables with XML columns and XML data in schema "DB2INST1"...
#  Stopping the DB2 instance...

#  'db2sampl' processing complete.

db2start
# SQL1063N  DB2START processing was successful.
db2 connect to sample
#   Database Connection Information
# Database server        = DB2/LINUXX8664 11.1.4.4
# SQL authorization ID   = DB2INST1
# Local database alias   = SAMPLE
# 验证安装
db2level
db2 "select * from staff"
db2licm -l
netstat -an | grep 50000

问题

  • Q:DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: “/lib/libpam.so*”.
  • R:yum install pam-devel.i686
  • Q:DBT3520E The db2prereqcheck utility could not find the library file libaio.so.1.
  • R:yum install libaio-devel libaio
  • Q:DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: “libstdc++.so.6”.
  • R:yum install libstdc++.so.6

参考

  • https://blog.csdn.net/xiadeliang1111/article/details/88574912?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1

你可能感兴趣的:(SQL)