Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install the database management system DB2 under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to install database management system DB2 under Linux". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

DB2 is a relational database management system (RDBMS) that is part of the Information Management product family. DB2 is considered to be the first database product to use SQL, a language that provides interfaces for RDBMS. DB2 was first released in 1982 and is now available on many operating system platforms, including Linux, UNIX, and Windows.

Linux version:

The official free version of the DB2 database under the Linux version, CentOS6.2 for the operating system.

Installation process:

1. Download: db2_v101_linuxia32_expc.tar.gz

2. After decompression, there will be a. / expc folder in the current directory.

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

3. Enter this directory

[root@localhost opt] # cd expc/

4. Perform installation

[root@localhost expc] #. / db2_install

5. Add groups and users:

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 license (product license) PS: if it is the ExpressC version, you don't have to do it.

[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. Create instance and 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 a das management server

In order for the remote client to use the control center to control the database server, it is necessary to install das on the database server. Of course, if it is only a remote connection rather than remote management, it can not be installed. 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 test the new user [db2as@localhost ~] $su # here enter root permission [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. Set the port number

Vim / etc/services

Add a # PS:VIM shortcut at the end, and enter "G" to jump the last line in command mode.

Db2inst1 50000/tcp

10. Db2 configuration, to switch to user db2inst1 su-db2inst1 db2set DB2_EXTENDED_OPTIMIZATION=ON db2set DB2_DISABLE_FLUSH_LOG=ON db2set AUTOSTART=YES db2set DB2_STRIPED_CONTAINERS=ON db2set DB2_HASH_JOIN=Y db2set DB2COMM=tcpip db2set DB2_PARALLEL_IO=* db2set DB2CODEPAGE=819 # PS: this place is more important # db2 update database manager configuration using svcename db2inst1

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

[db2inst1@localhost ~] $db2 get dbm cfg | grep SVCENAMETCP/IP Service name (SVCENAME) = SSL service name (SSL_SVCENAME) =

Find SVCENAME and update the settings if the current value is not the port number or service name of the server.

[db2inst1@localhost ~] $db2 update dbm cfg using SVCENAME db2inst1# db2 update dbm cfg using INDEXREC ACCESS [db2inst1@localhost ~] $db2 get dbm cfg | grep SVCENAMETCP/IP Service name (SVCENAME) = 50000SSL service name (SSL_SVCENAME) =

# PS:svcename needs to be used when the client connects

twelve。 You need to turn off the firewall before starting DB2, otherwise you will not be able to connect at all (the negligence in this place has been entangled for a long time). Execute it under root: service iptables stop

13. Open DB2, execute: db2start, if the state has been enabled, then stop first, execute: db2stop.

Set up View:

PS: there is a problem after restarting the machine, that is, the firewall does not respond, the database does not respond, and the remote cannot connect to the database. The solution is to restart the server, then shut down the firewall sequentially, and then restart the DB2 database.

This is the end of the introduction of "how to install database management system DB2 under Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report