LINUX安装db2V10.5步骤

db2命令

DB2开启监控

LINUX安装db2V10.5步骤  

2017-04-01 10:08:35|  分类: db2 |举报 |字号 订阅

       

  下载LOFTER 我的照片书  |转自:http://blog.csdn.net/hanzheng260561728/article/details/50878666
Install
DB2 10.5 on Redhat Linux 6.5 for x86_64


Byadmin-Last updated:Tuesday, June 10, 2014 -Save
& Share
-Leave a Comment


Install DB2 10.5 on Redhat Linux 6.5 for x86_64

近期发现在互联网上关于DB2 10.5的安装资料还是很少,如是打算发一篇关于DB2 10.5在Redhat Linux 6.5上安装的步骤,其实其安装和DB2以前的安装过程类似,简要的安装步骤如下,供参考。

1.安装配置环境

操作系统版本: Red Hat Enterprise Linux Server release 6.5 (Santiago) 数据库版本: DB2/LINUXX8664 10.5.3


[root@xuhz ~]# uname -a

Linux xuhz 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

[root@xuhz ~]# uname -r

2.6.32-431.el6.x86_64

[root@xuhz ~]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 6.5 (Santiago)


2.安装数据库软件

2.1 上传安装软件和license文件到某文件夹


[root@xuhz ~]# cd /software/

[root@xuhz software]# ls -l

total 1359328

drwxrwxrwx. 6 honcho honcho 4096 Jun 9 05:05 aese_c

-rwxrwxrwx. 1 honcho honcho 1391940725 Jun 9 05:05 DB2_Svr_10.5.0.3_Linux_x86-64PVU.tar.gz


2.2 解压缩安装包


[root@xuhz software]# gunzip DB2_Svr_10.5.0.3_Linux_x86-64PVU.tar.gz

[root@xuhz software]# tar -xvf DB2_Svr_10.5.0.3_Linux_x86-64PVU.tar


2.3 安装前预检测


[root@xuhz software]# ls -l

drwxrwxrwx. 6 honcho honcho 4096 Jun 9 05:05 aese_c

-rwxrwxrwx. 1 honcho honcho 1560576000 Jun 9 05:05 DB2_Svr_10.5.0.3_Linux_x86-64PVU.tar

drwxr-xr-x. 5 root root 4096 Feb 7 08:33 server

[root@xuhz software]# cd server/

[root@xuhz server]# ls

db2 db2checkCOL_readme.txt db2checkCOL.tar.gz db2ckupgrade db2_deinstall db2_install db2ls db2prereqcheck db2setup ibm_im installFixPack nlpack

[root@xuhz server]# ./db2prereqcheck -v 10.5.0.3 -s -o /tmp/db_check.log

Requirement not matched for DB2 database "Server" . Version: "10.5.0.3".

Summary of prerequisites that are not met on the current system: DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/libpam.so*".



DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "libstdc++.so.6".





Requirement not matched for DB2 database "Server" with pureScale feature. Version: "10.5.0.3".

Summary of prerequisites that are not met on the current system: DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/libpam.so*".



DBT3588W The db2prereqcheck utility was unable to validate the configuration of the log_mtts_per_seg parameter on the following host machine: "xuhz". Reason code: "1".



DBT3566E The db2prereqcheck utility detected that the service named "rdma" is not enabled on host "xuhz".



DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "libstdc++.so.6".



DBT3563E The db2prereqcheck utility determined that SELinux is enabled, which is not supported with GPFS.


上述报错IBM 给出了如下解释:

DBT3514W
The db2prereqcheck utility failed to find the following 32-bit library file: library-file-name.
Explanation
You can verify installation prerequisites for DB2 database using the db2prereqcheck utility.
This message is returned when the db2prereqcheck utility cannot find the 32-bit version of a required library file. If the named file is missing, 32-bit database applications might not function properly.
User response
Respond to this message in one of the following ways:
1> If you do not intend to use 32-bit applications with DB2 database, then no response is required.
2> If you do intend to use 32-bit applications with DB2 database, ensure that the named 32-bit library file exists on the system before installing DB2 database.


目前平台不打算使用32bit applications,故可以忽略以上警告信息。


2.4 采用命令行来安装数据库软件


[root@xuhz server]# ./db2_install

Requirement not matched for DB2 database "Server" . Version: "10.5.0.3".

Summary of prerequisites that are not met on the current system:

DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/libpam.so*".





DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "libstdc++.so.6".





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.5



***********************************************************

Install into default directory (/opt/ibm/db2/V10.5) ? [yes/no] -------------------- 这里选择安装目录,选择推荐目录即可

yes





Specify one of the following keywords to install DB2 products.



SERVER

CONSV

EXP

CLIENT

RTCL



Enter "help" to redisplay product names. --------------- 选择安装产品类型,这里选择SERVER



Enter "quit" to exit.



***********************************************************

SERVER

***********************************************************

Do you want to install the DB2 pureScale Feature? [yes/no] ---------------- 选择是否安装pureScale功能,这里选择不安装

no

Requirement not matched for DB2 database "Server" . Version: "10.5.0.3".

Summary of prerequisites that are not met on the current system:

DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/libpam.so*".





DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: "libstdc++.so.6".





DB2 installation is being initialized.



Total number of tasks to be performed: 48

Total estimated time for all tasks to be performed: 1873 second(s)



Task #1 start

Description: Checking license agreement acceptance

Estimated time 1 second(s)

Task #1 end

...................................................................................................................

...................................................................................................................

Task #50 start

Description: Updating global profile registry

Estimated time 3 second(s)

Task #50 end



The execution completed successfully.



For more information see the DB2 installation log at

"/tmp/db2_install.log.2881".


2.5 注册liences


[root@xuhz adm]# /opt/ibm/db2/V10.5/adm/db2licm -l

Product name: "DB2 Enterprise Server Edition"

License type: "License not registered"

Expiry date: "License not registered"

Product identifier: "db2ese"

Version information: "10.5"

[root@xuhz adm]# cd /software/aese_c/db2/license

[root@xuhz license]# ls

db2aese_c.lic sam32.lic UNIX Windows

[root@xuhz license]# /opt/ibm/db2/V10.5/adm/db2licm -a db2aese_c.lic



LIC1402I License added successfully.





LIC1426I This product is now licensed for use as outlined in your License Agreement. USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V10.5/license/en_US.iso88591"

[root@xuhz license]# /opt/ibm/db2/V10.5/adm/db2licm -l

Product name: "DB2 Advanced Enterprise Server Edition"

License type: "CPU Option"

Expiry date: "Permanent"

Product identifier: "db2aese"

Version information: "10.5"

Enforcement policy: "Soft Stop"


3.配置DB2 Instance

3.1 创建用户和组

用户用途 用户名 用户组

实例所有者 db2inst1 db2iadm1

受防护的用户 db2fenc1 db2fadm1

DB2 管理服务器用户 dasusr1 dasadm1

注:实例所有者主目录是将在其中创建DB2实例的位置;受防护的用户用于在DB2数据库所使用的地址空间之外运行用户定义的函数(UDF)和存储过程;DB2管理服务器用户的用户标识用于在系统上运行DB2管理服务器。


[root@xuhz ~]# groupadd db2iadm1

[root@xuhz ~]# groupadd db2fadm1

[root@xuhz ~]# groupadd dasadm1

[root@xuhz ~]# useradd -u 600 -g db2iadm1 -m -d /home/db2inst1 db2inst1

[root@xuhz ~]# useradd -u 601 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1

[root@xuhz ~]# useradd -u 602 -g dasadm1 -m -d /home/dasusr1 dasusr1

[root@xuhz ~]# passwd db2inst1

Changing password for user db2inst1.

New password:

BAD PASSWORD: it is based on a dictionary word

Retype new password:

passwd: all authentication tokens updated successfully.

[root@xuhz ~]# passwd db2fenc1

Changing password for user db2fenc1.

New password:

BAD PASSWORD: it is based on a dictionary word

Retype new password:

passwd: all authentication tokens updated successfully.

[root@xuhz ~]# passwd dasusr1

Changing password for user dasusr1.

New password:

BAD PASSWORD: it is based on a dictionary word

Retype new password:

passwd: all authentication tokens updated successfully.


3.2 创建DAS


[root@xuhz ~]# cd /opt/ibm/db2/V10.5/instance/

[root@xuhz instance]# ./dascrt -u dasusr1

DBI1070I Program dascrt completed successfully.


注:版本9.7中已经不推荐使用“DB2 管理服务器(DAS)”,在以后的发行版中可能会将其除去。DAS在DB2 pureScale环境中不受支持。

3.3 创建DB2 Instance


[root@xuhz instance]# ./db2icrt -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 #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.8120".

Required: Review the following log file also for warnings or errors:

"/tmp/db2icrt_local.log.*"

DBI1070I Program db2icrt completed successfully.

[db2inst1@xuhz ~]$ db2ilist

db2inst1


4.配置DB2服务器的TCP/IP通信

4.1 设置DB2服务器的通信协议


[root@xuhz ~]# su - db2inst1

[db2inst1@xuhz ~]$ db2set -all

[i] DB2AUTOSTART=NO

[g] DB2SYSTEM=xuhz

[g] DB2INSTDEF=db2inst1

[g] DB2ADMINSERVER=dasusr1

[db2inst1@xuhz ~]$ db2set DB2COMM=tcpip

[db2inst1@xuhz ~]$ db2set -all

[i] DB2COMM=TCPIP

[i] DB2AUTOSTART=NO

[g] DB2SYSTEM=xuhz

[g] DB2INSTDEF=db2inst1

[g] DB2ADMINSERVER=dasusr1


4.2 更新服务器上services文件


[db2inst1@xuhz ~]$ cat /etc/services |grep DB2

ibm-db2 523/tcp # IBM-DB2

ibm-db2 523/udp # IBM-DB2

questdb2-lnchr 5677/tcp # Quest Central DB2 Launchr

questdb2-lnchr 5677/udp # Quest Central DB2 Launchr

DB2_db2inst1 60006/tcp # DB2 连接服务端口

DB2_db2inst1_1 60007/tcp

DB2_db2inst1_2 60008/tcp

DB2_db2inst1_3 60009/tcp

DB2_db2inst1_4 60010/tcp

DB2_db2inst1_END 60011/tcp


4.3 更新服务器数据库管理文件


[db2inst1@xuhz ~]$ db2 get dbm cfg |grep SVCENAME

TCP/IP Service name (SVCENAME) =

SSL service name (SSL_SVCENAME) =

[db2inst1@xuhz ~]$ db2 update dbm cfg using SVCENAME 60006

DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed

successfully.

[db2inst1@xuhz ~]$ db2 get dbm cfg |grep SVCENAME

TCP/IP Service name (SVCENAME) = 60006

SSL service name (SSL_SVCENAME) =


4.4 验证通信端口状态


[db2inst1@xuhz ~]$ db2start

06/09/2014 19:38:44 0 0 SQL1063N DB2START processing was successful.

SQL1063N DB2START processing was successful.

[db2inst1@xuhz ~]$ netstat -an |grep 60006

tcp 0 0 0.0.0.0:60006 0.0.0.0:* LISTEN


5. 创建数据库


[db2inst1@xuhz ~]$ db2 create db honcho using codeset UTF-8 territory CN pagesize 8192

DB20000I The CREATE DATABASE command completed successfully.

[db2inst1@xuhz ~]$ db2 connect to honcho



Database Connection Information



Database server = DB2/LINUXX8664 10.5.3

SQL authorization ID = DB2INST1

Local database alias = HONCHO


至此,DB2数据库软件安装和数据库实例及数据库创建完成,相比Oracle的安装而言DB2的安装步骤更加简单。

阅读(355)| 评论(0)

猜你喜欢

转载自my.oschina.net/rootliu/blog/1820452