How to install a DB2 database in LINUX

Source: Internet
Author: User

In LINUX, how does one install the DB2 database? The following describes how to install the DB2 database in LINUX. We hope this will help you install the DB2 database.

1. Run./db2_install to install the necessary files. In the product keyword section, enter DB2.ESE.

2. Run as root user. Create three groups corresponding to three DB2 users: instance owner, fenced user, and DAS user. The command is as follows:
Groupadd-g 999 db2iadm1
Groupadd-g 998 db2fadm1
Groupadd-g 997 db2asgrp

3. Run as the root user, create three DB2 users, and specify the directory where the three users are located, which is generally/opt. The command is as follows:
Useradd-u 1004-g db2iadm1-m-d/db2home/db2inst1 db2inst1-p passwd
Useradd-u 1003-g db2fadm1-m-d/db2home/db2fenc1 db2fenc1-p passwd
Useradd-u 1002-g db2asgrp-m-d/db2home/dasusr1 dasusr1-p passwd

4. Run the command as the root user and set the password for the three users. The command is as follows:
Passwd db2inst1
Passwd db2fenc1
Passwd dasusr1

5. Create a DB2 instance. Run the db2icrt command:

A. Run as root user

B. Enter the following command:

/Opt/IBM/db2/V8.1/instance/db2icrt [-a AuthType]-u FencedID InstNme

Where:

-AuthType indicates the instance authentication type. The default value is SERVER.

Types include CLIENT, DCS, SERVER_ENCRYPT, or DCS_ENCRYPT.

-FencedID indicates the name of the DB2 fenced user.

-InstNme indicates the name of the instance to be created.

Example:

./Db2icrt-u db2fenc1 db2inst1

6. Create a TCP/IP connection for the DB2 instance

A. Update the/etc/services file and specify the service name and port number requested by the DB2 server to listen to the client, for example, add the next line to/etc/services

Db2c_db2inst1 50001/tcp # DB2 connection service port

Where:

• Db2c_db2inst1 indicates the connected service name
• 50001 indicates the service port number
• Tcp indicates the TCP/IP protocol

The service name and port number must be unique in the system.

B. Update the configuration file of database manager on the server:

I. log in as a DB2 instance user.
Ii. Set the DB2 instance Environment:

. INSTHOME/sqllib/db2profile

Iii. Update the SVCENAME parameter in the DBM configuration file. You must specify the service name or port number.

Example:

Db2 update dbm cfg using SVCENAME db2c_db2inst1

Run the following command to check the SVCENAME:

Db2 get dbm cfg | grep SVC

C. Set tcpip as the DB2COMM registration parameter. Run the following command as a DB2 instance User:

Db2set DB2COMM = tcpip

D. Restart DB2:

Db2stop
Db2start

7. installation license

The license must be installed on the computer on each DB2 server, using the db2licm command

A. log in as a root or DB2 instance user.

B. Enter the following command

/Opt/IBM/db2/V8.1/adm/db2licm-

Filename is the absolute path of the DB2 server license file.

In the/db2/license directory of the mount disk, if the cd mount is in mnt, the command format is as follows:

/Opt/IBM/db2/V8.1/adm/db2licm-a/mnt/db2/license/db2ese. lic

After the installation, the DB2 license is generally in the nodelock under the/var/lum directory.

8. Create a DB2 Management Server (DAS ).

A. log in as a root user.

B. Execute the following command to create the DAS:

/Opt/IBM/db2/V8.1/instance/dascrt-u DASuser
Here, DASuser is the user name of the DAS created on the local machine.

The preceding section describes how to install the DB2 database in LINUX.

DB2 tablespace Management

DB2 Management page size limit

Several Simple DB2 operation statements

Read stability at the DB2 isolation level

Four precautions for DB2 Data Import

   

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.