Installing DB2 under CentOS 6.9

Source: Internet
Author: User
Tags db2 db2 connect db2 connect to db2 installation



Operating system: centos6.9_x64



DB2 installation files: db2_v101_linuxx64_expc.tar.gz





Installing the Database
tar zxvf db2_v101_linuxx64_expc. Tar . GZCD expc/. /db2_install


Select the default installation path: Yes





Configuration database


Create 3 groups of users


901902903 DB2DADM1


Create 3 Users


101 -D/home/db2inst1-  m102 -D  /home/db2fenc1-m 103 -D  /home/db2dasusr1-m  DB2DASUSR1


Add 3 user passwords


passwd Db2inst1 passwd db2fenc1 passwd DB2DASUSR1


Check whether user groups and users are created successfully


Cat grep DB2 cat /etc/passwdgrep DB2


Create an instance


Cd/opt/ibm/db2/v10. 1/instance. /DASCRT-u db2dasusr1. /db2icrt-a server-u db2fenc1 Db2inst1


Configuring DB2 self-booting


Cd/opt/ibm/db2/v10. 1/instance. /db2iauto-on Db2inst1


Configuring the DB2 Network Service port


su 50000


Modify DB2 connection mode to TCP/IP


Db2set Db2comm=tcpip
Working with databases


Start the database


su -db2inst1 Db2start


Create a database


DB2 Create DB TestDB using CodeSet utf-88192





Connect to the database:


DB2 Connect to TestDB





Show connections


DB2 List Applications





SQL Test Code:


create table tb1( id integer not null primary key,username varchar(200),password varchar(200));
insert into tb1(id,username,password) values(188,‘stevenjohn‘,‘stevenanthony‘)  ;
select * from tb1;

drop table tb1;


Python Test code:



https://github.com/mike-zhang/pyExamples/blob/master/databaseRelate/db2Opt/db2Test1.py



All right, that's it, I hope it helps you.



This article GitHub address:



https://github.com/mike-zhang/mikeBlogEssays/blob/master/2017/20170706_cenos6.9 under Installation Db2.rst



Welcome to Supplement



Installing DB2 under CentOS 6.9


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.