System environment
CentOS 6.5 x86_64
DB2 v10.5 x86_64
First, installation steps
1. Place the DB2 database installation package in the/OPT directory
[Root@localhost DB2] # cd/opt [Root@localhost opt] # ls [Root@localhost opt] # Tar–unzip V10.5_ntx64_server_t.zip [Root@localhost opt] # CD Server
2. Perform the installation
./db2_install or./setup
3, registered license
[Root@localhost opt] # CD Ibm/db2/v10.5/adm [Root@localhost ADM] # pwd [Root@localhost ADM] # ls [Root@localhostadm] # /opt/ibm/db2/v10.5/adm/db2licm–a/opt/server/db2/license/db2serv_uw.lic
4. Create two user groups
[Root@localhost ADM] # groupadd-g 901 db2iadm1 [Root@localhost ADM] # groupadd-g 902 DB2FADM1
5. Creation of two users
(the user who owns the instance, the protected user, respectively) and the user group specified
[Root@localhost ADM] # Useradd- g db2iadm1-u 101-d /home/db2inst1-m db2inst1[root@localhost ADM]# useradd-g db2fadm1-u 102-d /home/db2fenc1-m db2fenc1
6. Add two user's password
[Root@localhost ADM] # passwd Db2inst1
[Email protected] adm]# passwd db2fenc1
7. Check whether user groups and users are created successfully
grep DB2 Users grep DB2
Second, DB2 use configuration
1. Create an instance
Enter the/opt/ibm/db2/v10.5/instance directory
[Root@localhost ADM] # cd/opt/ibm/db2/v10.5/instance [Root@localhost instance] # pwd [Root@localhost instance] # ./DB2ICRT –u db2fenc1 db2inst1 (Create DB2 instance)
2, Configuration DB2
1) Set DB2 self-boot (note: Still under the root user)
[Root@localhost instance] # pwd [Root@localhost instance] # ./db2iauto-on Db2inst1
2) Modify the Network service port (note: Under Db2inst1 users)
Modify the service port of DB2 to 50658, the lower port is 50000 by default
[Root@localhost instance] # Su-db2inst1 [db2inst1@localhost50658
Description
The author believes that there is no need to modify the default port number, unless it conflicts with other service ports on the server, here is just a method.
3) Modify the DB2 connection mode to TCP/IP
[Db2inst1@localhost ~]$ db2set Db2comm=tcpip
Modify the DB2 connection mode to TCPIP, and then access the database on the DB2 server through JDBC, ODBC, etc., and other machines that have the DB2 client installed can also access the database.
3. View DB2 License Status
[Root@localhost ~]$ Su- db2inst1[db2inst1@localhost ~]$ db2licm-l
4. View DB2 version
[Root@localhost ~]$ su db2inst1[db2inst1@localhost ~]$ db2level
Third, create the default database
Execute directly in the command-line window (under the Db2inst1 instance user):
Db2sampl
Note, here the author simple installation is DB2 Enterprise Edition (hehe, this is my internship in a company copy). If the reader needs (use only for learning) but does not want to spend $ to buy, can give me a message.
Database: DB2 v10.5 Installation Guide