分类: LINUX
2013-09-23 16:42:52
redhat6.3 db2 v9.7.0.4
useradd name test
passwd name
usermod -g gid test db2iadm1
./db2icrt -p portnumber -u name name 到db2 安装目录执行创建实例脚本
./db2ilist 列出instance列表
su - usera
./db2start
下面是创建实例自动化脚本脚本
#! /bin/bash
user=( user1 user1 user1 )
i=0
num=3
while [ $i -lt $num ]
do
useradd ${user[i]}
j=`expr $i + 50001`
echo ${user[i]} | passwd ${user[i]} --stdin
usermod -g 103 ${user[i]}
sh /opt/ibm/db2/V9.7/instance/db2icrt -p ${j} -u ${user[i]} ${user[i]}
i=`expr $i + 1`
done
exit
如下所示:
[db2inst1@portal01 NODE0000]$ db2ilist
db2inst1
usera
userb
userc
user1
user2
user3
userd