在 Red Hat Enterprise Linux 上安装 IBM DB2

IBM DB2 数据库可以安装在 Linux、UNIX 或者 Windows 操作系统上。
我们将从命令界面在 Red Hat Enterprise Linux Server 上安装 DB2 Version 10.1.
IBM DB2 是用于事务和分析操作的下一代数据平台。

步骤 1:从以下 URL 下载 IBM DB2 Package for Red Hat Linux。
我们可以免费使用 IBM DB2 数据库 90 天。

我们已经在 /opt 目录下下载了 DB2_ESE_10_Linux_x86-64.tar.gz 包。

# ls
DB2_ESE_10_Linux_x86-64.tar.gz

步骤 2:解压 IBM DB2 下载包,如下所示。

# tar -xvzf DB2_ESE_10_Linux_x86-64.tar.gz
# ls
DB2_ESE_10_Linux_x86-64.tar.gz ese

第 3 步:现在安装 IBM DB2 包。

# cd ese
# ls
db2 db2ckupgrade db2_deinstall db2_install db2ls db2preregcheck db2setup ibm_im installFixPack n1pack
[root@Server ese]# ./db2_install
DBI1324W
 Support of the db2 install command is deprecated. For
 more information, see the DB2 Information Center.
 Default directory for installation of products - /opt/ibm/db2/V10.1
 **
 Install into default directory (/opt/ibm/db2/V10.1) ? [yes/no]
yes (Press Enter)
Specify one of the following keywords to install DB2 products.
ESE
 CLIENT
 RTCL
Enter "help" to redisplay product names.
 Enter "quit" to exit.
 ***
 ESE
 ***
 Do you want to install the DB2 pureScale Feature? [yes/no]
 no
DB2 installation is being initialized.
 Total number of tasks to be performed: 46

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

第 4 步:现在检查服务器上安装了哪些 DB2 包。
要检查已安装的软件包,我们可以读取 /tmp 目录下的日志文件 (db2_install.log.xxxxx)。

DB2 Setup log file started at:  Thu Nov 26 22:23:43 2015 IST
============================================================
Operating system information: Linux 2.6.32-220.el6.x86_64.#1 SMP Wed Nov x 08:03:13 EST 2015 x86_64
WARNING: Notification SMTP server has not been specified. Notifications cannot be 
sent to contacts in your contact list until this is specified. For more information
see the DB2 administration documentation.
Product to install:                        DB2 Enterprise Server Edition
Previously Installed Components:
Selected Components:
Base client support

DB2 Setup log file finished at:  Thu x Nov 2015 10:25:26 PM IST

第 5 步:现在创建 db2 实例和受保护的用户。

[db2inst1@Server ~]# id db2inst1
uid=500(db2inst1) gid=500(db2igrp1) groups=500 (db2igrp1)
[db2inst1@Server ~]# id db2fenc1
uid=501(db2fenc1) gid=500(db2fgrp1) groups=500 (db2fgrp1)

第 6 步:现在创建 db2 实例。

[root@Server instance]# ./db2icrt -a SERVER_ENCRYPT -p DB2_db2inst1 -s ese -u db2fenc1 db2inst1
DBI1446I  The db2icrt command is running, please wait.
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)
..

步骤 8:创建示例数据库。

[db2inst1@Server ~] db2 “create database sample”

IBM DB2 数据库已准备好使用。

日期:2020-09-17 00:14:00 来源:oir作者:oir