db2 install in linux
本来是想搞oracle的,但是现在头又让搞db2,一个oracle 的安装就花了我好长时间。我的头说db2直接安装,还不让我创建实例然后db2cc db2start 都没有。我靠。我安装的不对。 还说她装的如何。nnd 。
下面就介绍我在网上搜索到的文章。比较好。成功安装db2。有点简单的,可以参考下!是Db2 v9 for Linux PPC
调整核心参数(按64位,16G内存计算)
#vi /etc/sysctl.conf 增加如下内容
kernel.shmmni=4096
kernel.shmmax=1073741824
kernel.shmall=3774873
kernel.sem=250 256000 32 1024
kernel.msgmni=1024
kernel.msgmax=65535
kernel.msgmnb=65535
#/sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.shmmni = 4096
kernel.shmmax = 1073741824
kernel.shmall = 3774873
kernel.sem = 250 256000 32 1024
kernel.msgmni = 1024
kernel.msgmax = 65535
kernel.msgmnb = 65535
#ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 1048576
max total shared memory (kbytes) = 15097856
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 1024
max semaphores per array = 250
max semaphores system wide = 256000
max ops per semop call = 32
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 1024
max size of message (bytes) = 65535
default max size of queue (bytes) = 65535
#./db2_install
no
ESE
#增加组与用户
groupadd db2iadm1
groupadd db2fadm1
groupadd db2asgrp
useradd db2inst1 -g db2iadm1
useradd db2fenc1 -g db2fadm1
useradd dasuser1 -g db2asgrp
创建管理客户机
#/opt/ibm/db2/V9.1/instance/dascrt dasuser1
创建实例
#/opt/ibm/db2/V9.1/instance/db2icrt -s ese -u db2fenc1 db2inst1
以db2inst1实例用户登录,运行如下命令
db2ilist
db2inst1
db2ls
Install Path Level Fix Pack Special Install Number Install Date
--------------------------------------------------------------------------------------------
/opt/ibm/db2/V9.1 9.1.0.0 0 Fri Aug 25 01:04:41 2006 CST
db2level
DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL09010"
with level identifier "02010107".
Informational tokens are "DB2 v9.1.0.0", "s060629", "LINUXIA32", and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V9.1".
设置如下参数:
db2set DB2_HASH_JOIN=Y
db2set DB2_RR_TO_RS=YES
db2set DB2COMM=tcpip
db2set DB2_PARALLEL_IO=*
db2 update dbm cfg using svcename 50000
运行db2 sample
db2sampl
建立测试数据库
db2 create db testdb using codeset UTF-8 territory US
或
db2 create db testdb using codeset UTF-8 territory CN