1.系统需求
需要 64 位 AIX 内核
AIX 6.1 TL 2
注: POWER7? 系统3 需要 AIX 6.1 TL4。
最低 C++ 运行时级别需要 xlC.rte 9.0.0.8 和 xlC.aix61.rte 9.0.0.8(或更高版本)文件集。这些文件集包含在 2008 年 6 月发布的“用于 AIX 的 IBM C++ 运行时环境组件”程序包中。
tar xvf XLCC++10.1.tar
smit安装
验证#lslpp -l|grep -i vac
准备工作:
root:
fsize = -1
core = 4194304
cpu = -1
data = -1
rss = -1
stack = 4194304
nofiles = 2000
db2inst1:
core = -1
rss = -1
fsize = -1
data = -1
2.安装产品
##################################################################
#解压缩包
gunzip DB2_ESE_97_AIX.tar.gz
tar -xvf DB2_ESE_97_AIX.tar
#执行安装命令
cd ese
./db2_install
Default directory for installation of products - /opt/IBM/db2/V9.7
***********************************************************
Do you want to choose a different directory to install [yes/no] ?
no
#t.163.com
Specify one or more of the following keywords,
separated by spaces, to install DB2 products.
CLIENT
RTCL
ESE
#event
#info
#eventId
Enter "help" to redisplay product names.
Enter "quit" to exit.
***********************************************************
ESE
##################################################################
#安装patch
./installFixPack -b /opt/IBM/db2/V9.7
##################################################################
#注册license
cd /opt/IBM/db2/V9.7/adm/
./db2licm -a /tmp/ibm/db2install/db2ese_c.lic
#www.huihui.cn
二、添加用户和组添加组:
# mkgroup db2grp1
# mkgroup db2fgrp1
# mkgroup dasadm1
添加用户:
# useradd -g db2grp1 db2inst1
# useradd -g db2fgrp1 db2fenc1
创建相关目录修改属组:
# mkdir db2inst1
#chown -R db2inst1:db2grp1 db2inst1
# mkdir db2fenc1
# chown -R db2fenc1:db2fgrp1 db2fenc1
#share
修改口令:# passwd db2inst1
初始口令:123abc
三、创建数据库实例
################db2inst1实例部分################
cd /opt/IBM/db2/V9.1/instance
./db2icrt -u db2fenc1 db2inst1
#配置实例级环境变量
su - db2inst1
db2set DB2_SKIPINSERTED=on
db2set DB2_USE_ALTERNATE_PAGE_CLEANING=on
db2set DB2_EVALUNCOMMITTED=on
db2set DB2_SKIPDELETED=on
db2set DB2COMM=tcpip
db2set DB2CODEPAGE=1386
db2set DB2TERRITORY=86
db2set DB2_PARALLEL_IO=*
#/-8193374227993879348
#/528916243427337960
#/-848017298884271392
#/-7418597188039120523
#/-4666275235354677978
#/-2609067386216315889
#/-2686328078439637134
#/8205175707800538282
#/3675775524837088653
#/-5681345416491130111
#/6919015491807413847
#/-9216661596314915706
#/6946725672704661432
#/399979588808198808
#/7067429729833239414
#/-5492255447897087537
#/3786685348764275471
#/-983804535235742441
#/2906930636061256447
#/-1814526055811662359
#/-4504065968169899587
#/3285381807344234956
#/8620899461183531803
#/8046205431154409290
#/-4966948438298010557
#/-6438628147712492060
#/3307654788707552623
#/-4473691010479655069
#/2247592446291035356
#/7708252349711261231
#/-4459651876231388602
#/-8575720556171960115
#/-1033600399184319776
#/-1453489495846017455
#/5515391544470207059
#/-8192213429174199650
#/5220359848400533162
#/-5332336875218938917
#/3643893389319230831
#/1926793710751266067
#/2470848745869901161
#/-1582643192517807295
#/-6758439023189343578
#/4558090341459639813
#/-6635289463261135888
#/2542564967829400551
#/8854297812341130768
#/4161101118766932894
#/-47887965595136954
#/-21824521125867460
#/9402432
#/9402619
#/9402859
#/9402958
#/9403047
#/9403327
#/9403447
#/9403531
#/9403642
#/9403759
#/9403850
#/9404211
#/9404345
#/9404416
#/9404541
#/9404630
#/9404885
#/9404971
#/9405056
#/9405136
db2 update dbm cfg using SVCENAME DB2_db2inst1
db2 update dbm cfg using DFT_MON_BUFPOOL ON
db2 update dbm cfg using DFT_MON_LOCK ON
db2 update dbm cfg using DFT_MON_SORT ON
db2 update dbm cfg using DFT_MON_STMT ON
db2 update dbm cfg using DFT_MON_TABLE ON
db2 update dbm cfg using DFT_MON_UOW ON
db2 update dbm cfg using MON_HEAP_SZ 10240
四、创建db2inst1实例环境变量并添加如下内容
if [ -f /home/db2inst1/sqllib/db2profile ];
then
. /home/db2inst1/sqllib/db2profile
fi
export DSMI_LOG=/home/db2inst1
export CLASSPATH=$CLASSPATH:/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:/home/db2inst
1/sqllib/java/jdk64/lib:/home/db2inst1/sqllib/lib:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/sqlj.zip export LD_LIBRARY_PATH=/home/db2inst1/sqllib/lib:.
五、创建数据库
测试库:
db2 "CREATE DATABASE esb_db ON /esbdb USING CODESET UTF-8 TERRITORY CN "
六、卸载db2
cd /opt/IBM/db2/V9.1/install
./db2_deinstall -a
rm -rf IBM
还原环境变量、
删除用户组
# rmgroup db2grp
# rmgroup db2fgrp
# rmgroup daadm