Detailed installation process of DB2 database under inux

  
 This article mainly introduces the DB2 database in the inux installation process detailed, the steps in this article, the operation of the command is also full, the need for friends can refer to the recent work because of the need to learn DB2 database, this tutorial
Explain the installation steps of the DB2 database under inux.
Please check the DB2 version and license instructions before installation to increase understanding. First understand what version of the installation, here I am using the latest Express-C version, this version is for personal learning.
The management client no longer has a control center since v9.7, but uses the Data Studio Client.
Linux version:
The official free version of the DB2 database under the Linux version, CentOS6.2 for the operating system
.
installation process:
1, Downloads: db2_v101_linuxia32_expc.tar.gz
2, decompression, will have in the current directory after extracting a complete folder ./expc


[ ,null,null,0],root @ localhost opt] # tar -zxvf db2_v101_linuxia32_expc.tar.gz


3, enter the directory

[root @ localhost opt] # cd expc /


4, performed installation

[root @ localhost expc] # ./db2_install


5, add users and groups:
group (user name)
db2iadm1 (db2inst1)
db2fadm1 ( db2fenc1)

[root @ localhost expc] # groupadd -g 2000 db2iadm1 [root @ localhost expc] # groupadd -g 2001 db2fadm1 [root @ localhost expc] # useradd -m -g db2iadm1 -d /home /db2inst1 db2inst1 [root @ localhost expc] # useradd -m -g db2fadm1 -d /home /db2fenc1 db2fenc1 [root @ localhost expc] # passwd db2inst1 [root @ localhost expc] # passwd db2fenc1


6, install a license (product license) PS: If ExpressC version would not have done

[root @ localhost adm] # pwd /opt /ibm /db2 /V10.1 /adm [root @ localhost adm] # chmod -R 775 *[db2inst1@localhost adm]$ ./db2licm -a /tmp/seagull/db2v10/license/db2ese_c.lic


7, and create an instance of the sample database

[root @ localhost instance] # pwd /opt /ibm /db2 /V10. 1/instance[root@localhost instance]# chmod -R 775 *[root@localhost instance]# ./db2icrt -p 50000 -u db2fenc1 db2inst1[root@localhost instance]# su - db2inst1[db2inst1@localhost ~]$ db2samplCreating 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@localhost ~]$ db2startSQL1026N The database manager is already active.[db2inst1@localhost ~]$ db2 connect to sampleDatabase Connection InformationDatabase server = DB2/LINUX 10.1.2SQL authorization ID = DB2INST1Local database alias = SAMPLE[db2inst1 @localhost ~]$ db2 "select * from staff"


8.Create das management server
For the remote client to control the database service with the control center Needs to be installed on the database server das, of course, if only a remote connection rather than remote management, you can not install, I installed it here.

[root @ localhost expc] # groupadd -g 2002 db2asgrp [root @ localhost expc] # useradd -m -g db2asgrp -d /home /db2as db2as [root @ localhost expc] # passwd db2as [db2as @ localhost ~] $ su - db2as # here to test the new user [db2as @ localhost ~] $ su # here to root privileges [root @ localhost ~] # cd /opt/ibm/db2/V10.1/instance/[root@localhost Instance]# ./dascrt -u db2asDBI1070I Program dascrt completed successfully.[root@localhost instance]# su - db2as[db2as@localhost ~]$ db2admin startSQL4409W The DB2 Administration Server is already active.


9. port number

vim /etc /services


increase in the last line # PS: VIM shortcut key input in command mode & ldquo; G & rdquo; skip to the last row.

db2inst1 50000 /tcp


10, db2 configuration, to switch to the user db2inst1

su & ndash; db2inst1db2set DB2_EXTENDED_OPTIMIZATION = ONdb2set DB2_DISABLE_FLUSH_LOG = ONdb2set AUTOSTART = YESdb2set DB2_STRIPED_CONTAINERS = ONdb2set DB2_HASH_JOIN = Ydb2set DB2COMM = tcpipdb2set DB2_PARALLEL_IO = * db2set DB2CODEPAGE = 819 # PS: this place is more important # db2 update database manager configuration using svcename db2inst1


11. the SVCENAME set to /etc /services in the port number or service name Yet?

[db2inst1 @ localhost ~] $ db2 get dbm cfg

Copyright © Windows knowledge All Rights Reserved