4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Db2 Community EditionのRHEL9へのインストール手順

4
Last updated at Posted at 2026-02-16

Db2 12.1 Community Editionとは

Db2 for Linux, UNIX and Windows 12.1では、無料の「Db2 Community Edition」が以下の環境であれば期限の制約なく使えます。

-IBM Db2 Community Edition
・最大4コア、最大8GBのメモリー
・Db2 12.1のCommunity Editionは、非生産環境(非プロダクション環境)でのみ使用可能

Db2 12.1からは、無料の「Db2 Community Edition」が「非生産環境(非プロダクション環境)でのみ使用可能」となったことが注意する点です。
しかし、4コア 8GBメモリー以内であれば、機能制限なく自習やテストに利用することができます。

Db2 Server Fixpackから新規インストールが可能

Db2のfixpackは公開サイトからダウンロード可能であり(※IBMidは必要)、最新のfixpackモジュールを使って新規インストールができます。

  • Server Fixpackからインストールすると、Db2 Community Editionとして期限の制限なく利用できます。
  • Universal Fixpackからインストールすると、90日間の評価版となります。

Db2 Community Editionとして使用したい場合は、Server Fixpackを使ってインストールしてください。

Db2 Fixpacks ダウンロードサイトから導入モジュールのダウンロード

Download Db2 fix packs by version for Db2 for Linux, UNIX and Windows

より、

Db2 12.1の一番上にある、

スクリーンショット 2026-02-16 13.18.31.png

MOD 3 CSB を選びます(2026/02時点)。

次の画面のDownloadsを選択し、

Linuxの、
IBM Db2 Server Fix Pack

を選択し、Fix Centralよりダウンロードします。

インストール手順

環境

  • RHEL 9.6(4コア、8GBメモリー)

インストール・イメージの配置

rootユーザーで、/tmpディレクトリーにDb2イメージを配置します。

Fix Centralより、special_74153_v12.1.3_linuxx64_server_dec.tar.gz (1.47 GB)をダウンロードします(2026/02時点)。

(※)wgetコマンドでダウンロードする例

# cd /tmp
# dnf install -y wget
# wget https://xxxxxxx[※Fix Centralよりspecial_74153_v12.1.3_linuxx64_server_dec.tar.gzのリンクをコピーしたアドレスをいれる]

ダウンロードしたファイルを確認します。

# ls -l spe*
-rw-------. 1 root root 1580783276 Jan 22 12:05 special_74153_v12.1.3_linuxx64_server_dec.tar.gz

インストール・イメージを解凍

rootユーザーで、/tmpディレクトリーにてDb2インストール・イメージを解凍します。

# tar -zxvf special_74153_v12.1.3_linuxx64_server_dec.tar.gz
server_dec/
server_dec/db2/
server_dec/db2/license/
server_dec/db2/license/ja_JP.eucJP/
server_dec/db2/license/ja_JP.eucJP/client_LI_ja
server_dec/db2/license/ja_JP.eucJP/rtcl_LI_ja
server_dec/db2/license/ja_JP.eucJP/consv_LI_ja
server_dec/db2/license/ja_JP.eucJP/db2server_LI_ja
(以下略)

インストール前提条件の検証

インストール前に、db2prereqcheckコマンドを使って、インストールの前提条件を満たしているかチェックします。

参考:db2prereqcheck - インストール前提条件の検査

インストール・イメージを解凍した、/tmp/server_dec ディレクトリーに移動します。

# pwd
/tmp/server_dec
# ls -ltr
total 84
-r-xr-xr-x. 1 bin bin  5095 Jan 22 09:54 installFixPack
-r-xr-xr-x. 1 bin bin  5059 Jan 22 09:54 db2setup
-r-xr-xr-x. 1 bin bin  5059 Jan 22 09:54 db2prereqcheck
-r--r--r--. 1 bin bin 16891 Jan 22 09:54 db2checkCOL.tar.gz
-r-xr-xr-x. 1 bin bin  5254 Jan 22 09:54 db2ckupgrade
-r-xr-xr-x. 1 bin bin  5077 Jan 22 09:54 db2_install
-r-xr-xr-x. 1 bin bin  5207 Jan 22 09:54 db2_deinstall
-r-xr-xr-x. 1 bin bin  5041 Jan 22 09:54 db2ls
-r--r--r--. 1 bin bin  4987 Jan 22 09:54 db2checkCOL_readme.txt
drwxr-xr-x. 6 bin bin   134 Jan 22 09:54 db2

Db2 pureScale は導入しないので、-iオプションをつけて、Db2 pureScale 環境に関連しない前提条件を検査するように指定します。

今回、インストールするのは v12.1.3 なので、-vオプションには 12.1.3.0 を指定します。

メッセージを見て、必要に応じて足りないライブラリは追加します。

(※)足りないライブラリ導入方法の例

dnf install -y ksh
dnf  group -y install "Development Tools"
dnf install -y libstdc++.so.6
dnf install -y libaio.so.1
dnf install -y libnuma.so.1
dnf install -y libaio
dnf install -y pam.i686

以下のように、すべての前提条件が満たされていることを確認します。

# ./db2prereqcheck -i -v 12.1.3.0

==========================================================================

Fri Feb 13 06:58:21 2026
Checking prerequisites for DB2 installation. Version "12.1.3.0". Operating system "Linux"

Validating "kernel level " ...
   Required minimum operating system kernel level: "5.14.0".
   Actual operating system kernel level: "5.14.0".
   Requirement matched.

Validating "Linux distribution " ...
   Required minimum operating system distribution: "RHEL"; Version: "9"; Service pack: "4".
   Actual operating system distribution Version: "9"; Service pack: "6".
   Requirement matched.

Validating "ksh symbolic link" ...
   Requirement matched.

Validating "Bin user" ...
   Requirement matched.

Validating "HOME free space" ...
The directory "/root" has enough space on host "itzvsi-11000072fg-2whp5y8u".
   Requirement matched.

Validating "libxcrypt-compat" ...
   Package (or file) found: "libxcrypt-compat"
   Requirement matched.

Validating "libcurl.so.4 library" ...
   Requirement matched.

Validating "C++ Library version " ...
   Required minimum C++ library: "libstdc++.so.6"
   Standard C++ library is located in the following directory: "/usr/lib64/libstdc++.so.6.0.29".
   Actual C++ library: "CXXABI_1.3.1"
   Requirement matched.


Validating "32 bit version of "libstdc++.so.6" " ...
   Found the 32 bit "/lib/libstdc++.so.6" in the following directory "/lib".
   Requirement matched.

Validating "libaio.so version " ...
DBT3553I  The db2prereqcheck utility successfully loaded the libaio.so.1 file.
   Requirement matched.

Validating "libaio.so.1 symbolic link " ...
   Requirement matched.

Validating "libnuma.so version " ...
DBT3610I  The db2prereqcheck utility successfully loaded the libnuma.so.1 file.
   Requirement matched.

Validating "/lib/libpam.so*" ...
   Requirement matched.
DBT3533I  The db2prereqcheck utility has confirmed that all installation prerequisites were met.

インストールの実行

今回はdb2_installコマンドを使用してインストールします。

参考:db2_install - Db2 データベース製品のインストール・コマンド

インストール・イメージを解凍した、/tmp/server_dec ディレクトリーに移動して実行します。
途中のライセンスやデフォルトディレクトリーの選択には「yes」と、Db2 productsの選択には「SERVER」と入力します。

# ./db2_install
Read the license agreement file in the db2/license directory.

***********************************************************
To accept those terms, enter "yes". Otherwise, enter "no" to cancel the install process. [yes/no]
yes


Default directory for installation of products - /opt/ibm/db2/V12.1

***********************************************************
Install into default directory (/opt/ibm/db2/V12.1) ? [yes/no]
yes


Specify one of the following keywords to install DB2 products.

  SERVER
  CONSV
  CLIENT
  RTCL

Enter "help" to redisplay product names.

Enter "quit" to exit.

***********************************************************
SERVER
***********************************************************
Do you want to install the DB2 pureScale Feature? [yes/no]
no
DB2 installation is being initialized.

 Total number of tasks to be performed: 56
Total estimated time for all tasks to be performed: 3011 second(s)

Task #1 start
Description: Checking license agreement acceptance
Estimated time 1 second(s)
Task #1 end

Task #2 start
Description: Base Client Support for installation with root privileges
Estimated time 3 second(s)
Task #2 end

Task #3 start
Description: Product Messages - English
Estimated time 14 second(s)
Task #3 end

Task #4 start
Description: Base client support
Estimated time 316 second(s)
Task #4 end

Task #5 start
Description: Java Runtime Support
Estimated time 203 second(s)
Task #5 end

Task #6 start
Description: Java Help (HTML) - English
Estimated time 7 second(s)
Task #6 end

Task #7 start
Description: SQL procedures
Estimated time 3 second(s)
Task #7 end

Task #8 start
Description: Java Common files
Estimated time 18 second(s)
Task #8 end

Task #9 start
Description: ICU Utilities
Estimated time 43 second(s)
Task #9 end

Task #10 start
Description: Base server support for installation with root privileges
Estimated time 3 second(s)
Task #10 end

Task #11 start
Description: Java support
Estimated time 11 second(s)
Task #11 end

Task #12 start
Description: Global Secure ToolKit
Estimated time 75 second(s)
Task #12 end

Task #13 start
Description: Base server support
Estimated time 784 second(s)
Task #13 end

Task #14 start
Description: Relational wrappers common
Estimated time 3 second(s)
Task #14 end

Task #15 start
Description: DB2 data source support
Estimated time 7 second(s)
Task #15 end

Task #16 start
Description: Control Center Help (HTML) - English
Estimated time 13 second(s)
Task #16 end

Task #17 start
Description: DB2 Text Search
Estimated time 110 second(s)
Task #17 end

Task #18 start
Description: Oracle data source support
Estimated time 5 second(s)
Task #18 end

Task #19 start
Description: ODBC data source support
Estimated time 259 second(s)
Task #19 end

Task #20 start
Description: Communication support - TCP/IP
Estimated time 3 second(s)
Task #20 end

Task #21 start
Description: Application data sources
Estimated time 4 second(s)
Task #21 end

Task #22 start
Description: DB2 LDAP support
Estimated time 4 second(s)
Task #22 end

Task #23 start
Description: Command Line Processor Plus
Estimated time 8 second(s)
Task #23 end

Task #24 start
Description: EnterpriseDB code
Estimated time 3 second(s)
Task #24 end

Task #25 start
Description: Scientific Data Sources
Estimated time 5 second(s)
Task #25 end

Task #26 start
Description: Sybase data source support
Estimated time 3 second(s)
Task #26 end

Task #27 start
Description: Base application development tools
Estimated time 36 second(s)
Task #27 end

Task #28 start
Description: DB2 Instance Setup wizard
Estimated time 15 second(s)
Task #28 end

Task #29 start
Description: Spatial Extender client
Estimated time 3 second(s)
Task #29 end

Task #30 start
Description: Connect support
Estimated time 3 second(s)
Task #30 end

Task #31 start
Description: Informix data source support
Estimated time 4 second(s)
Task #31 end

Task #32 start
Description: IBM Software Development Kit (SDK) for Java(TM)
Estimated time 466 second(s)
Task #32 end

Task #33 start
Description: Replication tools
Estimated time 61 second(s)
Task #33 end

Task #34 start
Description: Parallel Extension
Estimated time 3 second(s)
Task #34 end

Task #35 start
Description: itlm
Estimated time 3 second(s)
Task #35 end

Task #36 start
Description: Structured file data sources
Estimated time 5 second(s)
Task #36 end

Task #37 start
Description: Teradata data source support
Estimated time 3 second(s)
Task #37 end

Task #38 start
Description: Spatial Extender server support
Estimated time 20 second(s)
Task #38 end

Task #39 start
Description: JDBC data source support
Estimated time 266 second(s)
Task #39 end

Task #40 start
Description: Pacemaker
Estimated time 100 second(s)
Task #40 end

Task #41 start
Description: SQL Server data source support
Estimated time 4 second(s)
Task #41 end

Task #42 start
Description: Sample database source
Estimated time 6 second(s)
Task #42 end

Task #43 start
Description: Federated Data Access Support
Estimated time 3 second(s)
Task #43 end

Task #44 start
Description: Guardium Installation Manager Client
Estimated time 3 second(s)
Task #44 end

Task #45 start
Description: First Steps
Estimated time 3 second(s)
Task #45 end

Task #46 start
Description: Product Signature for Db2 Server Edition
Estimated time 8 second(s)
Task #46 end

Task #47 start
Description: Setting Db2 library path
Estimated time 180 second(s)
Task #47 end

Task #48 start
Description: Enabling the watchdog
Estimated time 20 second(s)
Task #48 end

Task #49 start
Description: Installing or updating Db2 resource agent scripts for Pacemaker
Estimated time 20 second(s)
Task #49 end

Task #50 start
Description: Executing control tasks
Estimated time 20 second(s)
Task #50 end

Task #51 start
Description: Updating global registry
Estimated time 20 second(s)
Task #51 end

Task #52 start
Description: Starting Db2 Fault Monitor
Estimated time 10 second(s)
Unit db2fmcd.service could not be found.
Task #52 end

Task #53 start
Description: Updating the db2ls and db2greg link
Estimated time 1 second(s)
Task #53 end

Task #54 start
Description: Registering Db2 licenses
Estimated time 5 second(s)
Task #54 end

Task #55 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #55 end

Task #56 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #56 end

Task #57 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #57 end

The execution completed successfully.

For more information see the DB2 installation log at
"/tmp/db2_install.log.672382".

これでDb2が導入できました。

Db2 Community Editionライセンスの確認

Db2インストール先のディレクトリーである /opt/ibm/db2/V12.1/adm に移動し、
db2licmコマンドを実行して、導入したDb2のライセンス情報を確認します。

参考:db2licm - ライセンス管理ツール・コマンド

Db2 Community Editionであることが表示されました!

# pwd
/opt/ibm/db2/V12.1/adm

# ./db2licm -l
Product name:                     "DB2 Community Edition"
License type:                     "Community"
Expiry date:                      "Permanent"
Product identifier:               "db2dec"
Version information:              "12.1"
Max amount of memory (GB):        "8"
Max number of cores:              "4"
Enforcement policy:               "Soft Stop"
Features:
IBM DB2 Performance Management Offering:              "Not licensed"

【補足】Db2 Universal Fixpackを使用して新規インストールした場合は、Db2 Community Editionのライセンスは表示されず、以下のように、90日間の試用版と表示されます。

# ./db2licm -l
Product name:                     "DB2 Advanced Enterprise Server Edition"
License type:                     "Trial"
Expiry date:                      "05/19/2026"
Product identifier:               "db2aese"
Version information:              "12.1"

インスタンスの作成

db2icrt コマンドを使用し、インスタンス db2inst1 を作成します。

参考:db2icrt - インスタンスの作成コマンド

<インスタンス作成コマンド>

/opt/ibm/db2/V12.1/instance/db2icrt -u <fenced ユーザー> <インスタンス名>

ユーザーは事前に作成しておきます。

参考:Db2 データベース・インストール用のグループおよびユーザー ID の作成 (Linux および UNIX)

(※)グループとユーザーを作成する例
サンプル)
インスタンス所有者 db2inst1 グループ db2iadm1
fencedユーザー db2fenc1 グループ db2fsdm1

groupadd -g 999 db2iadm1
groupadd -g 998 db2fsdm1
   

useradd -u 1004 -g db2iadm1 -m -d /home/db2inst1 db2inst1 
useradd -u 1003 -g db2fsdm1 -m -d /home/db2fenc1 db2fenc1 

passwd db2inst1
passwd db2fenc1

db2icrt コマンドを使用し、インスタンス db2inst1 を作成します。

# pwd
/opt/ibm/db2/V12.1/instance

# ./db2icrt -a server -u db2fenc1 db2inst1
DBI1446I  The db2icrt command is running.


DB2 installation is being initialized.

 Total number of tasks to be performed: 4
Total estimated time for all tasks to be performed: 309 second(s)

Task #1 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #1 end

Task #2 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #2 end

Task #3 start
Description: Configuring Db2 instances
Estimated time 300 second(s)
Task #3 end

Task #4 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #4 end

The execution completed successfully.

For more information see the DB2 installation log at "/tmp/db2icrt.log.696398".
DBI1070I  Program db2icrt completed successfully.


これで、db2inst1というインスタンスが作成されました。

確認

作成したインスタンスのユーザー db2inst1 にスイッチします。

# su - db2inst1

db2levelコマンドで、導入されたDb2のバージョンを確認します。

参考:db2level - Db2 サービス・レベルの表示コマンド

$ db2level
DB21085I  This instance or install (instance name, where applicable:
"db2inst1") uses "64" bits and DB2 code release "SQL12013" with level
identifier "02040110".
Informational tokens are "DB2 v12.1.3.0", "special_74153",
"DYN2601211339AMD64_74153", and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V12.1".

db2startコマンドでDb2を開始します。
参考:db2start - Start Db2 コマンド

$ db2start
02/13/2026 07:34:17     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.

Db2付属のSAMPLEデータベースを作成します。
参考:db2sampl - サンプル・データベースの作成コマンド

$ db2sampl -sql

  Creating database "SAMPLE"...
  Connecting to database "SAMPLE"...
  Creating tables and data in schema "DB2INST1"...

  'db2sampl' processing complete.

このSAMPLEデータベースを使ってDb2を操作してみることができます。

$ db2 connect to sample

   Database Connection Information

 Database server        = DB2/LINUXX8664 12.1.3.0
 SQL authorization ID   = DB2INST1
 Local database alias   = SAMPLE


$ db2 list tables

Table/View                      Schema          Type  Creation time
------------------------------- --------------- ----- --------------------------
ACT                             DB2INST1        T     2026-02-16-05.06.54.293035
ADEFUSR                         DB2INST1        S     2026-02-16-05.06.55.406008
CL_SCHED                        DB2INST1        T     2026-02-16-05.06.53.369015
DEPARTMENT                      DB2INST1        T     2026-02-16-05.06.53.415332
DEPT                            DB2INST1        A     2026-02-16-05.06.53.519996
EMP                             DB2INST1        A     2026-02-16-05.06.53.642924
EMPACT                          DB2INST1        A     2026-02-16-05.06.54.291854
EMPLOYEE                        DB2INST1        T     2026-02-16-05.06.53.520728
EMPMDC                          DB2INST1        T     2026-02-16-05.06.55.743884
EMPPROJACT                      DB2INST1        T     2026-02-16-05.06.54.248975
EMP_ACT                         DB2INST1        A     2026-02-16-05.06.54.292488
EMP_PHOTO                       DB2INST1        T     2026-02-16-05.06.53.643415
EMP_RESUME                      DB2INST1        T     2026-02-16-05.06.53.848860
IN_TRAY                         DB2INST1        T     2026-02-16-05.06.54.412025
ORG                             DB2INST1        T     2026-02-16-05.06.54.466268
PROJ                            DB2INST1        A     2026-02-16-05.06.54.134655
PROJACT                         DB2INST1        T     2026-02-16-05.06.54.135239
PROJECT                         DB2INST1        T     2026-02-16-05.06.54.031806
SALES                           DB2INST1        T     2026-02-16-05.06.54.567257
STAFF                           DB2INST1        T     2026-02-16-05.06.54.524435
STAFFG                          DB2INST1        T     2026-02-16-05.06.55.237362
(以下略)


$ db2 "select name from staff where id = 20"

NAME
---------
Pernal

  1 record(s) selected.

以上です。

参考

Db2 12.1 マニュアルのトップページ

Db2 12.1 システム要件

稼働環境の前提要件等の確認はこちらです(英語)

Db2 Fixpacks ダウンロードサイト

日本のサポート部門によるFAQ集

こちらのサイトには、IBMのソフトウェア・テクニカル・サポートによく寄せられる質問 (FAQ) の一覧があり、非常に有用な情報が数多く記載されています。

[Db2] Db2 サポートによく寄せられる質問

4
1
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?