I just figured out how to speed up my process of preparing DB2 for
TBSM database installation and wanted to share with you guys. Today I
wanted to share something rather universal, not just for TBSM use, so
people from other areas may enjoy too. It's command line DB2 instance
creation process with saving time on not having to take few other
actions more by running the following commands in right order and with
right parameters.
This is Linux ready, with some modifications will be fine for other UNIXes.
You do all as root.
1. Create groups - you need them first, standard names:
groupadd db2iadm1
groupadd db2fadm1
groupadd dasadm1
2. Create home dirs - let's assume we run home at /home:
mkdir /home/db2inst1
mkdir /home/db2fenc1
mkdir /home/dasusr1
3. Add users (standard names, bash assumed existing, remove -s flag and value if not available at your box)
mkgroup db2iadm1
useradd -g db2iadm1 -s /bin/bash -d /home/db2inst1 db2inst1
mkgroup db2fadm1
useradd -g db2fadm1 -s /bin/bash -d /home/db2fadm1 db2fenc1
mkgroup dasadm1
useradd -g dasadm1 -s /bin/bash -d /home/dasusr1 dasusr1
4. Setting passwords:
passwd db2inst1
db2inst1's New password:
Re-enter db2inst1's new password:
passwd db2fenc1
Changing password for "db2fenc1"
db2fenc1's New password:
Re-enter db2fenc1's new password:
passwd dasusr1
5.
Reconfirm all the passwords, different security policy for new password
may apply for different distribution installations, example:
su - db2inst1
db2inst1's Password:
[compat]: You are required to change your password. Please choose a new one.
db2inst1's New password:
Re-enter db2inst1's new password:
6.
Ensure home directories are owned by right users, it will help with
setting up environment variables automatically for DB2 instance by the
installer:
chown db2inst1:db2iadm1 /home/db2inst1/
chown db2fenc1:db2fadm1 /home/db2fenc1
chown dasusr1:dasadm1 /home/dasusr1
7.
Configuring the DB2 instance for TBSM DB - remember of passing port
number, it will save you time later by configuring TCPIP and service
name automatically now:
[root@yourmachine]:\ # cd /opt/IBM/db2/V9.7/instance
[root@yourmachine]:\ # ./db2icrt -a SERVER -p 50000 -s ese -u db2fenc1 db2inst1
DBI1070I Program db2icrt completed successfully.
[root@yourmachine]:\ # ./db2iauto -on db2inst1
[root@yourmachine]:\ # su - db2inst1
Few postinstall steps, do all as DB2 instance administrative user this time:
8. Check on DB2 variables. DB2COMM is one you need to be set up for reaching the instance from TBSM later on:
[db2inst1@yourmachine]: # db2set
DB2COMM=tcpip
DB2AUTOSTART=YES
9. Check on the license expiration date, make sure it's Permanent before you roll out your TBSM to production:
[db2inst1@yourmachine]: # db2licm -l
Product name: "DB2 Enterprise Server Edition"
License type: "Trial"
Expiry date: "10/01/2012"
Product identifier: "db2ese"
Version information: "9.7"
Product name: "DB2 Connect Server"
License type: "Trial"
Expiry date: "10/01/2012"
Product identifier: "db2consv"
Version information: "9.7"
10. Check on the code level if any fixpacks need to be installed before TBSM (in TBSM 6.1 minimum is 9.5 FP3 or 9.7 FP3)
[db2inst1@yourmachine]: # db2level
DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09076"
with level identifier "08070107".
Informational tokens are "DB2 v9.7.0.6", "s120516", "IP23321", and Fix Pack
"6".
Product is installed at "/opt/IBM/db2/V9.7".
11. Check on whether your DB2 instance is up and running:
[db2inst1@yourmachine]: # db2start
SQL1026N The database manager is already active.
12. You can make sure whether any databases were installed successfully at any time by running this command:
[db2inst1@yourmachine]: # db2 list db directory
SQL1031N The database directory cannot be found on the indicated file system.
SQLSTATE=58031
13. Create sample db manually, connect to it, disconnect and drop - the simplest test ever, in order to make sure all went ok
14. You're ready to install TBSM
There's bunch of disk requirements for TBSM database installation in DB2 specifically, but I will describe it next time.
Thank you.