- Copy the installation tar file (my favorite mode to do this is through WinScp and Putty) and login as root on server.
- Before start check if there are all prerequisites (they can have different names in other Linux distribution): compat-libstdc++, nfs-utils, libaio1, ksh, libstdc++5.
- Now, after you have unpacked the archive containing the installation files ("tar -xvf" and/or "gunzip"), run the following statement:
./db2_install
- As DB2 server has machine level authentication, now it's time to create every groups and users that we need:
/usr/sbin/groupadd -g 999 db2iadm1
/usr/sbin/groupadd -g 998 db2fadm1
/usr/sbin/groupadd -g 997 dasadm1
/usr/sbin/groupadd -g 1000 db2dev
Users:
/usr/sbin/useradd -g db2grp1 -m -d /home/db2inst1 db2inst1 -p db2inst1
/usr/sbin/useradd -g db2fgrp1 -m -d /home/db2fenc1 db2fenc1 -p db2fenc1
/usr/sbin/useradd -g dasadm1 -m -d /home/dasusr1 dasusr1 -p dasusr1
/usr/sbin/useradd -g db2dev -m -d /home/db2user db2user –p db2user
It's necessary to verified the password:
passwd db2inst1
passwd db2fenc1
passwd dasusr1
passwd db2user
- Instance creation: db2icrt -a SERVER -p 50000 -s wse -u db2fenc1 db2inst1
- Das user creation: dascrt -u dasusr1
- Verify default shell used by DB2 users:
vi /etc/passwd
From:
db2inst1:x:1001:1001::/home/db2inst1:/bin/sh
db2fenc1:x:1002:1002::/home/db2fenc1:/bin/sh
dasusr1:x:1003:1003::/home/dasusr1:/bin/sh
to:
db2inst1:x:1001:1001::/home/db2inst1:/bin/bash
db2fenc1:x:1002:1002::/home/db2fenc1:/bin/bash
dasusr1:x:1003:1003::/home/dasusr1:/bin/bash
- Enabling remote administration as root user:
and add following lines:
ibm-db2 523/tcp # IBM DB2 DAS
ibm-db2 523/udp # IBM DB2 DAS
db2c_db2inst1 50000/tcp # IBM DB2 instance - db2inst1
as db2inst1 (instance administrator):
db2 update dbm cfg using SVCENAME db2c_db2inst1
db2set DB2COMM=tcpip
db2stop
db2start
db2set DB2COMM=tcpip
db2stop
db2start
and as dasusr1 (administration user):
db2admin stop
db2admin start
db2admin start
- Instance automatically startup, as db2inst1:
db2set DB2AUTOSTART=YES
as root:
vi /etc/init.d/db2
and put following lines:
#!/bin/bash
#
# Script to start DB2 instances on bootup.
#
set -e
. /lib/lsb/init-functions
case "$1" in
start)
/opt/ibm/db2/version/instance/db2istrt
;;
stop|restart|reload)
;;
esac
exit 0
#
# Script to start DB2 instances on bootup.
#
set -e
. /lib/lsb/init-functions
case "$1" in
start)
/opt/ibm/db2/version/instance/db2istrt
;;
stop|restart|reload)
;;
esac
exit 0
- Admin manager automatically startup:
vi /etc/rc.local
and put following lines:
su dasusr1 -c /home/dasusr1/script/startadmin.sh
exit 0
as dasusr1:
vi /home/dasusr1/script/startadmin.sh
and put following lines:
#!/bin/sh
# The following three lines have been added by UDB DB2.
if [ -f /home/dasusr1/das/dasprofile ]; then
. /home/dasusr1/das/dasprofile
fi
db2admin start
after:
chmod 777 /home/dasusr1/script/startadmin.sh
- Optimizing the Linux kernel by editing the configuration (/etc/sysctl.conf) through the rules of document "The DB2 UDB memory model" in DeveloperWorks, beautiful web site:
Example 64 bit achitecture with 2G of RAM (please look "Tuning and Monitoring Database System Performance" redbook):
kernel.sem=250 256000 32 1024
kernel.shmmni=4096
kernel.shmmax=1610612736
kernel.shmall=1932735283
kernel.msgmni=1024
kernel.msgmax=65536
kernel.msgmnb=65536
- Instance environment configuration, as db2inst1:
and put following lines:
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
export PATH=/home/db2inst1/scripts:$PATH
export DB2CODEPAGE=1252
after:
vi /home/db2inst1/sqllib/db2profile
and put following lines:
export DB2CODEPAGE=1252 (or your code page)and as root:
vi /etc/profile
and put following lines:
DB2INSTANCE=db2inst1
export DB2INSTANCE
INSTHOME=/home/db2inst1
export DB2CODEPAGE=1252
No comments:
Post a Comment