There are 2 options for installing DB2 on linux machine – with GUI setup (Java forever) or in text mode. According praxis, text mode is usable in 100% cases so….
A) PREPARATION
j@debian:~/install$ uname -a
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux
j@debian:~/install$ ls -la
total 1074092
drwxr-xr-x 2 j j 4096 Jan 28 09:14 .
drwxr-xr-x 25 j j 4096 Jan 28 09:14 ..
-rwxrwx— 1 j j 1099857920 May 30 2013 v10.5_linuxx64_server_t.tar
j@debian:~/install$ tar -xf v10.5_linuxx64_server_t.tar
j@debian:~/install$ cd server_t/
j@debian:~/install/server_t$ ls -la
total 72
drwxr-xr-x 4 j j 4096 May 30 2013 .
drwxr-xr-x 3 j j 4096 Jan 28 09:21 ..
drwxr-xr-x 6 j j 4096 May 30 2013 db2
-r-xr-xr-x 1 j j 5349 May 30 2013 db2ckupgrade
-r-xr-xr-x 1 j j 5302 May 30 2013 db2_deinstall
-r-xr-xr-x 1 j j 5172 May 30 2013 db2_install
-r-xr-xr-x 1 j j 5136 May 30 2013 db2ls
-r-xr-xr-x 1 j j 5154 May 30 2013 db2prereqcheck
-r-xr-xr-x 1 j j 5154 May 30 2013 db2setup
drwxr-xr-x 10 j j 4096 May 30 2013 ibm_im
-r-xr-xr-x 1 j j 5190 May 30 2013 installFixPack
First of all – we need to pass whole prerequisities requirements.
j@debian:~/install/server_t$ ./db2prereqcheck
Don´t be scared from many output lines (512+). This utility is generic for testing requirements from DB2 9.8 – DB2 10.5, including subversions. We´re interested in 10.5 installation process = first lines are important for us:
libstdc++.so.6 is installed in 64-bit, not installed in 32-bit. I bet this wouldn´t be a problem, anyway:
root@debian:~# apt-get install lib32stdc++6
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
lib32gcc1 libc6-i386
The following NEW packages will be installed:
lib32gcc1 lib32stdc++6 libc6-i386
0 upgraded, 3 newly installed, 0 to remove and 45 not upgraded.
Need to get 4,433 kB of archives.
After this operation, 10.6 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://ftp.cz.debian.org/debian/ wheezy/main libc6-i386 amd64 2.13-38 [4,033 kB]
Get:2 http://ftp.cz.debian.org/debian/ wheezy/main lib32gcc1 amd64 1:4.7.2-5 [53.2 kB]
Get:3 http://ftp.cz.debian.org/debian/ wheezy/main lib32stdc++6 amd64 4.7.2-5 [346 kB]
Fetched 4,433 kB in 10s (430 kB/s)
Selecting previously unselected package libc6-i386.
(Reading database … 141873 files and directories currently installed.)
Unpacking libc6-i386 (from …/libc6-i386_2.13-38_amd64.deb) …
Selecting previously unselected package lib32gcc1.
Unpacking lib32gcc1 (from …/lib32gcc1_1%3a4.7.2-5_amd64.deb) …
Selecting previously unselected package lib32stdc++6.
Unpacking lib32stdc++6 (from …/lib32stdc++6_4.7.2-5_amd64.deb) …
Setting up libc6-i386 (2.13-38) …
Setting up lib32gcc1 (1:4.7.2-5) …
Setting up lib32stdc++6 (4.7.2-5) …
Running again db2prereqcheck is verifying our action:
Validating „32 bit version of „libstdc++.so.6″ “ …
Found the 64 bit „/usr/lib/x86_64-linux-gnu/libstdc++.so.6“ in the following directory „/usr/lib/x86_64-linux-gnu“.
Found the 32 bit „/usr/lib32/libstdc++.so.6“ in the following directory „/usr/lib32“.
Requirement matched.
Done.
Validating „/lib/libpam.so*“ …
DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: „/lib/libpam.so*“.
WARNING : Requirement not matched.
is more tricky 🙂 It´s always when you are trying to do anything with 32-bit library inside 64-bit OS during installation 64-bit software 😉
j@debian:~/install/server_t$ find /lib -name „*libpam*“ -print
/lib/x86_64-linux-gnu/libpamc.so.0
/lib/x86_64-linux-gnu/libpam.so.0.83.0
/lib/x86_64-linux-gnu/libpamc.so.0.82.1
/lib/x86_64-linux-gnu/libpam_misc.so.0.82.0
/lib/x86_64-linux-gnu/libpam_misc.so.0
/lib/x86_64-linux-gnu/libpam.so.0
Repository 0 ( you can try apt-get install libpam0g:i386 in your case), you don´t want to mess your system with library conflicts…. time for browsing 🙂 Ah, Eureka! So I´m simply ignoring this error message (ldap with nss) and running installation as root user finally!
B) INSTALLATION
root@debian:/home/j/install/server_t# ./db2_install
Requirement not matched for DB2 database „Server“ . Version: „10.5.0.0“.
Summary of prerequisites that are not met on the current system:
DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: „/lib/libpam.so*“.
DBI1324W Support of the db2_install command is deprecated. For
more information, see the DB2 Information Center.
Default directory for installation of products – /opt/ibm/db2/V10.5
***********************************************************
Install into default directory (/opt/ibm/db2/V10.5) ? [yes/no]
yes
Specify one of the following keywords to install DB2 products.
SERVER
CONSV
EXP
CLIENT
RTCL
Enter „help“ to redisplay product names.
Enter „quit“ to exit.
***********************************************************
SERVER
***********************************************************
Do you want to install the DB2 pureScale Feature? [yes/no]
no
Requirement not matched for DB2 database „Server“ . Version: „10.5.0.0“.
Summary of prerequisites that are not met on the current system:
DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: „/lib/libpam.so*“.
DB2 installation is being initialized.
Total number of tasks to be performed: 46
Total estimated time for all tasks to be performed: 1521 second(s)
Task #1 start
Description: Checking license agreement acceptance
Estimated time 1 second(s)
Task #1 end
Task #2 start
Description: Base Client Support for installation with root privileges
Estimated time 3 second(s)
Task #2 end
Task #3 start
Description: Product Messages – English
Estimated time 13 second(s)
Task #3 end
Task #4 start
Description: Base client support
Estimated time 293 second(s)
Task #4 end
Task #5 start
Description: Java Runtime Support
Estimated time 155 second(s)
Task #5 end
Task #6 start
Description: Java Help (HTML) – English
Estimated time 7 second(s)
Task #6 end
Task #7 start
Description: Base server support for installation with root privileges
Estimated time 7 second(s)
Task #7 end
Task #8 start
Description: Global Secure ToolKit
Estimated time 59 second(s)
Task #8 end
Task #9 start
Description: Java support
Estimated time 12 second(s)
Task #9 end
Task #10 start
Description: SQL procedures
Estimated time 3 second(s)
Task #10 end
Task #11 start
Description: ICU Utilities
Estimated time 35 second(s)
Task #11 end
Task #12 start
Description: Java Common files
Estimated time 18 second(s)
Task #12 end
Task #13 start
Description: Base server support
Estimated time 459 second(s)
Task #13 end
Task #14 start
Description: Control Center Help (HTML) – English
Estimated time 13 second(s)
Task #14 end
Task #15 start
Description: Connect support
Estimated time 3 second(s)
Task #15 end
Task #16 start
Description: Relational wrappers common
Estimated time 3 second(s)
Task #16 end
Task #17 start
Description: DB2 data source support
Estimated time 6 second(s)
Task #17 end
Task #18 start
Description: Spatial Extender server support
Estimated time 19 second(s)
Task #18 end
Task #19 start
Description: IBM Software Development Kit (SDK) for Java(TM)
Estimated time 48 second(s)
Task #19 end
Task #20 start
Description: DB2 LDAP support
Estimated time 4 second(s)
Task #20 end
Task #21 start
Description: DB2 Instance Setup wizard
Estimated time 20 second(s)
Task #21 end
Task #22 start
Description: Integrated Flash Copy Support
Estimated time 3 second(s)
Task #22 end
Task #23 start
Description: Spatial Extender client
Estimated time 3 second(s)
Task #23 end
Task #24 start
Description: Communication support – TCP/IP
Estimated time 3 second(s)
Task #24 end
Task #25 start
Description: Base application development tools
Estimated time 35 second(s)
Task #25 end
Task #26 start
Description: DB2 Update Service
Estimated time 4 second(s)
Task #26 end
Task #27 start
Description: Parallel Extension
Estimated time 3 second(s)
Task #27 end
Task #28 start
Description: EnterpriseDB code
Estimated time 4 second(s)
Task #28 end
Task #29 start
Description: Replication tools
Estimated time 53 second(s)
Task #29 end
Task #30 start
Description: Sample database source
Estimated time 4 second(s)
Task #30 end
Task #31 start
Description: itlm
Estimated time 3 second(s)
Task #31 end
Task #32 start
Description: DB2 Text Search
Estimated time 119 second(s)
Task #32 end
Task #33 start
Description: Command Line Processor Plus
Estimated time 4 second(s)
Task #33 end
Task #34 start
Description: Informix data source support
Estimated time 4 second(s)
Task #34 end
Task #35 start
Description: Oracle data source support
Estimated time 4 second(s)
Task #35 end
Task #36 start
Description: First Steps
Estimated time 3 second(s)
Task #36 end
Task #37 start
Description: Product Signature for DB2 Enterprise Server Edition
Estimated time 6 second(s)
Task #37 end
Task #38 start
Description: Guardium Installation Manager Client
Estimated time 20 second(s)
Task #38 end
Task #39 start
Description: Setting DB2 library path
Estimated time 180 second(s)
Task #39 end
Task #40 start
Description: Executing control tasks
Estimated time 20 second(s)
Task #40 end
Task #41 start
Description: Updating global registry
Estimated time 20 second(s)
Task #41 end
Task #42 start
Description: Starting DB2 Fault Monitor
Estimated time 10 second(s)
Task #42 end
Task #43 start
Description: Updating the db2ls link
Estimated time 1 second(s)
Task #43 end
Task #44 start
Description: Registering DB2 licenses
Estimated time 5 second(s)
Task #44 end
Task #45 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #45 end
Task #46 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #46 end
Task #47 start
Description: Registering DB2 Update Service
Estimated time 30 second(s)
Task #47 end
Task #48 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #48 end
The execution completed successfully.
For more information see the DB2 installation log at
„/tmp/db2_install.log.7525“.
Installation is done.
Validating installation is needed:
root@debian:/home/j/install/server_t# /opt/ibm/db2/V10.5/bin/db2val
DBI1379I The db2val command is running. This can take several minutes.
DBI1335I Installation file validation for the DB2 copy installed at
/opt/ibm/db2/V10.5 was successful.
DBI1343I The db2val command completed successfully. For details, see
the log file /tmp/db2val-140128_102757.log.
C) CONFIGURATION
root@debian:/home/j/install/server_t# groupadd -g 999 db2iadm1
root@debian:/home/j/install/server_t# groupadd -g 998 db2fadm1
root@debian:/home/j/install/server_t# groupadd -g 997 dasadm1
root@debian:/home/j/install/server_t# useradd -u 1004 -g db2iadm1 -m -d /home/db2inst1 db2inst1
root@debian:/home/j/install/server_t# useradd -u 1003 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1
root@debian:/home/j/install/server_t# useradd -u 1002 -g dasadm1 -m -d /home/dasusr1 dasusr1
root@debian:/home/j/install/server_t# passwd db2inst1
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@debian:/home/j/install/server_t# passwd db2fenc1
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@debian:/home/j/install/server_t# passwd dasusr1
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
DAS creating:
root@debian:/opt/ibm/db2/V10.5/instance# ./dascrt -u dasusr1
DBI1070I Program dascrt completed successfully.
Time for instance creation! .-)
root@debian:/home/j/install/server_t# cd /opt/ibm/db2/V10.5/instance
root@debian:/opt/ibm/db2/V10.5/instance# ./db2icrt -a server -u db2fenc1 db2inst1
DBI1446I The db2icrt command is running.
DB2 installation is being initialized.
Total number of tasks to be performed: 4
Total estimated time for all tasks to be performed: 309 second(s)
Task #1 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #1 end
Task #2 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #2 end
Task #3 start
Description: Configuring DB2 instances
Estimated time 300 second(s)
Task #3 end
Task #4 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #4 end
The execution completed successfully.
For more information see the DB2 installation log at „/tmp/db2icrt.log.27501“.
Required: Review the following log file also for warnings or errors:
„/tmp/db2icrt_local.log.*“
DBI1070I Program db2icrt completed successfully.
Ok, we have created database instance db2inst1. Time for start database manager + create sample database called SAMPLE 🙂 Beware to use bash as shell…
db2inst1@debian:/home/j$ db2start
db2start: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Well, can happen – we need to install libaio library….
root@debian:~# apt-get install libaio-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libaio1
The following NEW packages will be installed:
libaio-dev libaio1
0 upgraded, 2 newly installed, 0 to remove and 45 not upgraded.
Need to get 27.8 kB of archives.
After this operation, 142 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://http.us.debian.org/debian/ wheezy/main libaio1 amd64 0.3.109-3 [9,150 B]
Get:2 http://http.us.debian.org/debian/ wheezy/main libaio-dev amd64 0.3.109-3 [18.7 kB]
Fetched 27.8 kB in 1s (19.5 kB/s)
Selecting previously unselected package libaio1:amd64.
(Reading database … 142260 files and directories currently installed.)
Unpacking libaio1:amd64 (from …/libaio1_0.3.109-3_amd64.deb) …
Selecting previously unselected package libaio-dev.
Unpacking libaio-dev (from …/libaio-dev_0.3.109-3_amd64.deb) …
Processing triggers for man-db …
Setting up libaio1:amd64 (0.3.109-3) …
Setting up libaio-dev (0.3.109-3) …
Done. Second attempt:
db2inst1@debian:/home/j$ db2start
SQL8007W There are „90“ day(s) left in the evaluation period for the product
„DB2 Advanced Enterprise Server Edition“. For evaluation license terms and
conditions, refer to the License Agreement document located in the license
directory in the installation path of this product. If you have licensed this
product, ensure the license key is properly registered. You can register the
license by using the db2licm command line utility. The license key can be
obtained from your licensed product CD.
01/28/2014 11:28:39 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
Time to create sample database:
db2inst1@debian:/home/j$ db2sampl
Creating database „SAMPLE“…
Connecting to database „SAMPLE“…
Creating tables and data in schema „DB2INST1″…
Creating tables with XML columns and XML data in schema „DB2INST1″…
‚db2sampl‘ processing complete.
db2inst1@debian:/home/j$
D) End of journey
Installation process is at the end. There are many many things you can configure now, anyway fully functional db2 is right now.
db2inst1@debian:/home/j$ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 10.5.0
You can issue database manager commands and SQL statements from the command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd
For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with ‚db2‘.
To list the current command option settings, type LIST COMMAND OPTIONS.
For more detailed help, refer to the Online Reference Manual.
db2 => connect to sample
Database Connection Information
Database server = DB2/LINUXX8664 10.5.0
SQL authorization ID = DB2INST1
Local database alias = SAMPLE
db2 => select * from act
ACTNO ACTKWD ACTDESC
—— —— ——————–
10 MANAGE MANAGE/ADVISE
20 ECOST ESTIMATE COST
30 DEFINE DEFINE SPECS
40 LEADPR LEAD PROGRAM/DESIGN
50 SPECS WRITE SPECS
60 LOGIC DESCRIBE LOGIC
70 CODE CODE PROGRAMS
80 TEST TEST PROGRAMS
90 ADMQS ADM QUERY SYSTEM
100 TEACH TEACH CLASSES
110 COURSE DEVELOP COURSES
120 STAFF PERS AND STAFFING
130 OPERAT OPER COMPUTER SYS
140 MAINT MAINT SOFTWARE SYS
150 ADMSYS ADM OPERATING SYS
160 ADMDB ADM DATA BASES
170 ADMDC ADM DATA COMM
180 DOC DOCUMENT
18 record(s) selected.
-a-