Ubuntu 8.04 Installation DB2 method

Source: Internet
Author: User
Tags db2 db2 express semaphore

Reference documents:

How-to:ubuntu 7.10 Server x86 32-bit and DB2 express-c v9.5

DB2 v9.7 Infomation Center

Scenario: On the IBM System x3550 Server, the DB2 v9.7 ESE trial database is installed with the Db2_install command on the Ubuntu server 8.0.4 operating system.

I. Pre-installation steps

1. Install a few packages and execute the command:

sudo apt-get install Libaio1
sudo apt-get install libstdc++5

2.copy install files to the target system and unzip them. If the solution is from Windwos and then uploaded to Ubuntu, then you need to set up the installation files and related files to perform the properties.

3. Set Ulimit (server version of this step is skipped)

4. Modify Kernel Parameters

1) View kernel parameters

Ipcs-l

The display is as follows:

cuser@localhost:~$ ipcs-l------Shared Memory Limits--------max number of segments = 4096 Max seg size (Kbytes) = 3276 8 Max Total Shared memory (Kbytes) = 8388608 min seg size (bytes) = 1------semaphore Limits--------max number of array s = 128 Max semaphores per array = up Max semaphores system wide = 32000 Max Ops per semop call = semaphore max value = 32767------messages:limits--------max queues system wide = max size of message (bytes) = 8192 default max size O F Queue (bytes) = 16384

2) Edit the/etc/sysctl.conf file. If this file does not exist, you should create it. Add the following content:

kernel.sem=250 256000 1024 #示例: Shmmax kernel.shmmax=1073741824 #示例 for 64-bit systems: 90% Shmall for 4GB of memory 8 kernel.msgmax=65535 kernel.msgmnb=65535

For descriptions of these parameters, refer to DB2 infocenter:

It is recommended that the SHMMAX value be set to equal the amount of physical memory on the system. However, the minimum value required on the x86 system is 268435456 (256 MB), and on a 64-bit system, the value will be 1073741824 (1 GB).
By default, Shmall is set to 8 GB (8388608 KB = 8 GB). If you have more physical memory than this value, and you want to use the physical memory for DB2, this parameter is increased to approximately 90% of the computer's physical memory. For example, assuming that the computer system has GB of memory and uses these memory primarily for DB2, the Shmall should be set to 3774873 (GB 90% is 14.4 GB; 3774873 GB divided by 4 KB (this is the base page size) )。 The IPCS output has converted Shmall to kilobytes (KB). This is because the kernel needs to use this value as a number of pages. If you are upgrading to DB2 version 9.7 and you do not use the default Shmall setting, you must increase the Shmall setting by another 4 GB. The Fast Communication Manager (FCM) requires this to increase memory for use by another buffer or channel.
Kernel parameter SEM consists of the following four tags: semmsl, semmns, SEMOPM and Semmni. Semmns is the result of SEMMSL multiplied by Semmni. The database manager needs to increase the number of arrays (Semmni) as needed. Typically, the Semmni should be twice the maximum number of agents expected on the system multiplied by the number of logical partitions on the database server computer plus the number of local application connections on the database server computer.
Msgmni will affect the number of agent processes that can be started, Msgmax will affect the size of messages that can be sent in one queue, and MSGMNB will affect the queue size.
The Msgmax should be changed to 65535 KB (that is, 65,535 bytes), and the MSGMNB should be larger.

3 The SYSCTL is run with the-p parameter to mount the SYSCTL setting from the default file/etc/sysctl.conf:

sudo sysctl-p

Two. Installing the database

1. Run installation command

sudo./db2_install

2. Specify the installation path, generally do not change the path, English environment type "no" plus carriage return, Chinese environment type "no" plus carriage return.

3. Choose to install the product, here I choose ESE, and then enter.

4. Install all the way, the last hint of a warning, said there are small errors, not to tube it, is installed.

Three. Post-Installation steps

1. Create users and user groups

1 Create user groups:

sudo groupadd-g 999 db2iadm1
sudo groupadd-g 998 db2fadm1
sudo groupadd-g 997 dasadm1
2 Create the User:
sudo useradd-u 1004-g db2iadm1-m-d/home/db2inst1 db2inst1
sudo useradd-u 1003-g db2fadm1-m-d/home/db2fenc1 db2fenc1
sudo useradd-u 1002-g dasadm1-m-d/home/dasusr1 DASUSR1
3 Set the user's password
sudo passwd db2inst1
sudo passwd db2fenc1
sudo passwd dasusr1

2. Create DB2 Management Services
Sudo/opt/ibm/db2/v9.7/instance/dascrt-u DASUSR1

3. Create a DB2 instance
Sudo/opt/ibm/db2/v9.7/instance/db2icrt-a server-u db2fenc1 Db2inst1

4. Set the port used by DB2
Su-db2inst1
/bin/bash
Chsh-s/bin/bash db2inst1 (DB2 needs bash, this command modifies the default sh)

/home/db2inst1/sqllib/db2profile

DB2 update dbm CFG using svcename 50000

5. Set up DB2 communication protocol
Db2set Db2comm=tcpip


6. Start DB2
Db2start

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.