DB2在Linux下的安装

无情 阅读:174 2022-06-06 14:04:59 评论:0

DB2在Linux下的安装

本文部分内容属网络搜寻,后经亲试验证整理

目 录

  1. 安装环境说明
  2. 基础准备
  3. 安装步骤
    3.1. 安装包上传解压
    3.2. 安装前检查
    3.3. 安装

安装环境说明

操作系统:SUSE Linux Enterprise Server 11 (x86_64)

数据库:db2 V9.7(64bit)

基础准备

操作系统,SLES-11-SP3-DVD-x86_64-GM-DVD1.iso

数据库,v9.7fp6_linuxx64_server.tar.gz

安装步骤

安装包上传解压

将上述下载的DB2解压至/home/software:tar -xvf v9.7fp6_linuxx64_server.tar.gz

安装前检查

进入解压后的目录,执行下述命令:/home/software/sever/db2prereqcheck

常见问题问题一

这个是说开启了内存地址随机化机制(address space layout randomization)功能,这个功能对DB2本身没有太大影响,有个别工具db2pd db2egcf 会出现异常,若有强迫症,如下:

官方解释:

DBT3534W 
db2prereqcheck实用程序确定ASLR设置为ON并且这可能导致某些工具发生问题。 
 
说明 
地址空间布局随机化(ASLR)缺省情况下在某些Linux分发上已激活。ASLR被设计为在随机地址装入共享内存对象。 
ASLR启用后,DB2数据库不能保证地址对共享内存对象可用。 
地址空间中的此冲突意味着尝试将共享内存对象附加至特定地址的进程可能无法完成任务,从而导致shmat子例程失败。但是,后续使用新进程重试共享内存附加时可能会成功。结果是一组随机失败。已知会见到此错误的一些进程包括:db2pd、db2egcf和db2vend。 
此问题可能导致的一些错误包括以下各项: 
db2pd命令可能会报告找不到数据,即使实例或数据库处于活动状态。 
db2egcf进程(用于监视)可能会错误地确定实例已关闭并启动故障转移操作。 
在备份和日志归档操作中,db2vend进程可能会失败,并产生错误,指示未能启动子进程。 
用户响应 
通过设置以下内核参数来关闭随机化: 
kernel.randomize_va_space=0 
通过发出以下命令来临时禁用随机化并重新启动DB2实例: 
echo0>/proc/sys/kernel/randomize_va_space 
或者 
sysctl -w kernel.randomize_va_space=0 
 
上面两条命令是临时更改,重启后,该值会还原成2 
要想永远关闭,则编辑/etc/sysctl.conf文件 
新增一行kernel.randomize_va_space=0 
保存退出后,运行sysctl-p使之生效,重启后也有效了。 

常见问题问题二

这个是DB2要求的一个32位的pam库

官网解释如下

Errordescription 
Thedb2prereqcheckutilitywasenhancedtocheckforlibpam.so 
inDB2version9.7FP6viaAPARIC78338andthevalidationis 
donebylookingup"libpam.so"(eitherafileorasymbolic 
link)onthesystem.Theoriginalapproachwastolookupthe 
filelibpam.so.0onsystem,howeverthiswouldnotworkon 
systemswithupdatedPAMmodule.PAMmodulecouldbeupdated 
fromtimetotimeandifwehard-codeddb2prereqchecktocheck 
forlibpam.so.0,thenthecheckwouldfailonnewersystemwhere 
themodulemighthaveupdatedtoupperversionlikelibpam.so.1. 
 
Inmostcaseasymboliclinkoflibpam.sowouldbecreatedto 
pointtolatestversionoflibpam.so.x,hencehave 
db2prereqchecktolookforlibpam.so(eitherafileorasymbol 
link).ThisapproachwastoavoidanyfurtherissuewithPAM 
moduleupgradeonaffectedplatform.Howeverthismaynotwork 
onoldersystemwhichhaslibpam.so.0only. 
Localfix 
Createasymboliclinknamedlibpam.sothatpointsto 
libpam.so.0: 

参考IBM官方解决方案IC87092:
http://www-01.ibm.com/support/docview.wss?rs=0&q1=IC87092&uid=swg1IC87092&loc=zh_CN&cs=utf-8&lang=
大概意思就是说,DB2会找libpam.so文件,通常会找lipan.so.0,但可能涉及不定期更新,因此需要手工做个软链接到最新的文件
以下是具体操作:
安装PAM包(用zypper命令,具体用法可百度),到安装后生成的库文件
建立符号链接

[root@SUSE-Linux]#ln -s /lib/libpam.so.0.82.2 /lib/libpam.so 

安装

执行如下:

SUSE-Linux:/home/moiase/zhaoty/db2/server # ./db2_install  
 
Default directory for installation of products - /opt/ibm/db2/V9.7 
 
*********************************************************** 
 
Do you want to choose a different directory to install [yes/no] ? 
yes 
Enter full path name for the install directory - 
 
------------------------------------------------ 
 
/ibm/db2/V9.7 
 
 
Specify one of the following keywords to install DB2 products. 
 
  AESE  
  ESE  
  CONSV  
  WSE  
  EXP  
  PE  
  CLIENT  
  RTCL  
 
Enter "help" to redisplay product names. 
 
Enter "quit" to exit. 
 
*********************************************************** 
 
ESE 
DB2 installation is being initialized. 
 
 Total number of tasks to be performed: 48  
Total estimated time for all tasks to be performed: 2005  
 
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: The DB2 required component.  
Estimated time 11 second(s)  
Task #3 end  
 
Task #4 start 
Description: Product Messages - English  
Estimated time 12 second(s)  
Task #4 end  
 
Task #5 start 
Description: Base client support  
Estimated time 200 second(s)  
Task #5 end  
 
Task #6 start 
Description: Java Runtime Support  
Estimated time 121 second(s)  
Task #6 end  
 
Task #7 start 
Description: Java Help (HTML) - English  
Estimated time 7 second(s)  
Task #7 end  
 
Task #8 start 
Description: Base server support for installation with root privileges  
Estimated time 7 second(s)  
Task #8 end  
 
Task #9 start 
Description: Global Secure ToolKit  
Estimated time 51 second(s)  
Task #9 end  
 
Task #10 start 
Description: Java support  
Estimated time 12 second(s)  
Task #10 end  
 
Task #11 start 
Description: SQL procedures  
Estimated time 3 second(s)  
Task #11 end  
 
Task #12 start 
Description: ICU Utilities  
Estimated time 40 second(s)  
Task #12 end  
 
Task #13 start 
Description: Java Common files  
Estimated time 23 second(s)  
Task #13 end  
 
Task #14 start 
Description: Base server support  
Estimated time 259 second(s)  
Task #14 end  
 
Task #15 start 
Description: IBM Software Development Kit (SDK) for Java(TM)  
Estimated time 35 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: Connect support  
Estimated time 3 second(s)  
Task #17 end  
 
Task #18 start 
Description: Communication support - TCP/IP  
Estimated time 3 second(s)  
Task #18 end  
 
Task #19 start 
Description: Parallel Extension  
Estimated time 3 second(s)  
Task #19 end  
 
Task #20 start 
Description: EnterpriseDB code  
Estimated time 3 second(s)  
Task #20 end  
 
Task #21 start 
Description: Replication tools  
Estimated time 22 second(s)  
Task #21 end  
 
Task #22 start 
Description: Relational wrappers common  
Estimated time 3 second(s)  
Task #22 end  
 
Task #23 start 
Description: Control Center  
Estimated time 51 second(s)  
Task #23 end  
 
Task #24 start 
Description: Command Line Processor Plus  
Estimated time 6 second(s)  
Task #24 end  
 
Task #25 start 
Description: DB2 data source support  
Estimated time 6 second(s)  
Task #25 end  
 
Task #26 start 
Description: DB2 LDAP support  
Estimated time 4 second(s)  
Task #26 end  
 
Task #27 start 
Description: DB2 Instance Setup wizard  
Estimated time 8 second(s)  
Task #27 end  
 
Task #28 start 
Description: Integrated Flash Copy Support  
Estimated time 53 second(s)  
Task #28 end  
 
Task #29 start 
Description: Spatial Extender client  
Estimated time 3 second(s)  
Task #29 end  
 
Task #30 start 
Description: Base application development tools  
Estimated time 35 second(s)  
Task #30 end  
 
Task #31 start 
Description: DB2 Update Service  
Estimated time 4 second(s)  
Task #31 end  
 
Task #32 start 
Description: First Steps  
Estimated time 3 second(s)  
Task #32 end  
 
Task #33 start 
Description: Product Signature for DB2 Enterprise Server Edition  
Estimated time 4 second(s)  
Task #33 end  
 
Task #34 start 
Description: Sample database source  
Estimated time 4 second(s)  
Task #34 end  
 
Task #35 start 
Description: DB2 Text Search  
Estimated time 70 second(s)  
Task #35 end  
 
Task #36 start 
Description: Informix data source support  
Estimated time 4 second(s)  
Task #36 end  
 
Task #37 start 
Description: Setting DB2 library path  
Estimated time 180 second(s)  
Task #37 end  
 
Task #38 start 
Description: Installing or updating SA MP  
Estimated time 40 second(s)  
Task #38 end  
 
Task #39 start 
Description: Executing control tasks  
Estimated time 20 second(s)  
Task #39 end  
 
Task #40 start 
Description: Updating global registry  
Estimated time 20 second(s)  
Task #40 end  
 
Task #41 start 
Description: Installing IBM Tivoli Monitoring for Databases  
Estimated time 600 second(s)  
Task #41 end  
 
Task #42 start 
Description: Starting DB2 Fault Monitor  
Estimated time 10 second(s)  
Task #42 end  
 
Task #43 start 
Description: Updating the db2ls link  
Estimated time 1 second(s)  
Task #43 end  
 
Task #44 start 
Description: Registering DB2 licenses  
Estimated time 5 second(s)  
Task #44 end  
 
Task #45 start 
Description: Setting default global profile registry variables  
Estimated time 1 second(s)  
Task #45 end  
 
Task #46 start 
Description: Initializing instance list  
Estimated time 5 second(s)  
Task #46 end  
 
Task #47 start 
Description: Registering DB2 Update Service  
Estimated time 30 second(s)  
Task #47 end  
 
Task #48 start 
Description: Updating global profile registry  
Estimated time 3 second(s)  
Task #48 end  
 
A minor error occurred while installing "DB2 Enterprise Server Edition " on 
this computer. Some features may not function correctly. 
 
For more information see the DB2 installation log at 
"/tmp/db2_install.log.4771". 

ESE 一共48个步骤,最后安装完成后,有个提示:说有个较小的错误发生了,可能会影响某些功能的正常使用,这个一般没问题
具体看日志如下

Installing or updating SA MP :.......Failure   
Executing control tasks :.......Success   
Updating global registry :.......Success   
The installation of IBM Tivoli Monitoring for Databases  failed. The log file   
can be found at /opt/ibm/db2/V9.7/itma/logs/itm_install.log.   
 
Starting DB2 Fault Monitor :.......Success   
Updating the db2ls link :.......Success   
Registering DB2 licenses :.......Success   
Setting default global profile registry variables :.......Success   
Initializing instance list :.......Success   
Registering DB2 Update Service :.......Success   
Updating global profile registry :.......Success   
WARNING: A minor error occurred while installing "DB2 Enterprise Server Edition   
" on this computer. Some features may not function correctly.   
 
Post Install Recommendations   

看到了吧,就是SA MP安装失败,那么这个鸟东西是做什么的呢?为什么会失败,失败后有什么影响呢?

还是看这个日志,刚刚看的是最后方,再看看开始的地方

Target directory:                               /opt/ibm/db2/V9.7   
 
Space required:                                 1068 MB   
Install SA MP:                                  No   
 
TSAMP_VERSION=3.2.2.1   
 DBI1130E  The IBM Tivoli System Automation for Multiplatforms (SA MP)   
      could not be installed or updated because system prerequisites   
      were not met. See the log file /tmp/prereqSAM.log.17992 for details.   
 
Explanation:   
 
There are system prerequisites for installing or updating SA MP. These   
prerequisites have not been met.   
 
The mentioned log file has the details for the unsatisfied   
prerequisites.   
 
To find out more about the system prerequisites for the SA MP Base   
Component, see the SA MP Base Component documentation's Installation and   
Configuration Guide.   
 
SA MP cannot be installed or updated.   
 
User response:   
 
Modify your system to meet the prerequisites; and use the installSAM   
utility to manually install SA MP.   

哦,原来SA MP 是 IBM Tivoli System Automation for Multiplatforms 缩写,再看看后面的日志文件为啥失败

prereqSAM:  OPTIONS         = '-l /tmp/prereqSAM.log.17992 --noliccheck --silent'   
prereqSAM:  OPT_SILENT      = 1   
prereqSAM:  OPT_NOLICCHECK  = 1   
prereqSAM: Detected operating system  Linux   
. 
. 
. 
prereqSAM: Most severe error code returned  21 
prereqSAM: Unable to perform prerequisite checking   

恩,是说在检查SA MP安装的时候失败,返回错误码21:
好吧,到这个时候,应该找不到问题解决了吧,别急,再仔细看看日志 ,哦?有个错误号DBI1130E
大家注意,在好的软件遇到问题的时候,第一反应要知道两个内容,错误解释和错误编号,如果有的话

官方解释如下:
这个错误消息是有关Tivoli Systems Automation (TSA) 的,对DB2的核心功能一般情况下没有什么影响。
有一种情况会产生影响,就是当做HADR的时候(就是这个 High Availability features ),当其中1台机器失败时,不能自动路由跳转到另外一台机器继续提供DB服务。

这个也是仅仅在HADR使用TSA作为跳转。如果不试用TSA组件,那么这个错误完全可以忽略不计。

如果真的需要使用TSA功能。(或者有些人实在强迫症,看不得报错?)那么可以手动执行installSAM脚本安装这个(SA MP),具体请看:
Installing IBM Tivoli System Automation for Multiplatforms (SA MP) Base Component using the installSAM install script
这个链接叫:使用 installSAM 安装脚本来安装 IBM Tivoli System Automation for Multiplatforms (SA MP) Base Component ,这个就不继续往下了,Tivoli以后再说吧。

官方原文:

Technote (troubleshooting)   
 
Problem(Abstract)   
DB2 install fails with "DBI1130E The SA MP Base Component could not be installed or updated because system prerequisites were not met." error message.   
Symptom   
While trying to install DB2 V9.5 and later, the error message DBI1130E might be returned. Additional log file /tmp/prereqSAM.log.123456 should be available for more details.   
Cause   
The DBI1130E error messages is returned when some of the pre-requisites needed for installing the particular component are missing or are not installed.   
Environment   
Note: This technote is true only for installations of DB2 Versions 9.5 and later that have the TSA component bundled with the install.   
Diagnosing the problem   
The error message from the install log should read as below:   
DBI1130E The SA MP Base Component could not be installed or updated   
because system prerequisites were not met. See the log file   
/tmp/prereqSAM.log.454724 for details.   
 
Explanation:    
There are system prerequisites for installing or updating the IBM Tivoli   
System Automation for Multiplatforms Base Component (SA MP Base   
Component). These prerequisites have not been met.   
The mentioned log file has the details for the unsatisfied   
prerequisites.   
To find out more about the system prerequisites for the SA MP Base   
Component, see the Installation and Configuration Guide at   
http://publib.boulder.ibm.com/tividd/td/IBMTivoliSystemAutomationforMultiplatforms2.2.html.   
The SA MP Base Component cannot be installed or updated.   
 
User response:    
Modify your system to meet the prerequisites; and use the installSAM utility to manually install the SA MP Base Component.   
The /tmp/prereqSAM.log.123456 might have some failures relating to AIX packages as below:   
prereqSAM: Error: The following AIX package is not installed rsct.opt.storagerm   
prereqSAM: Error: Prerequisite checking for the ITSAMP installation failed AIX 6100-04   
prereqSAM: Most severe error code returned 21   
prereqSAM: One or more prerequisite packages were not found installed    
 
Note: The package name is not restricted to rsct.opt.storagerm. There might be other operating system packages mentioned in the error messages as well.   
 
Resolving the problem   
This DBI1130E error message is related to the Tivoli Systems Automation (TSA) and this is not a component that affects core DB2 functionality, as it deals with some of the more advanced High Availability features of DB2. In essence, it handles DB2's fail-over from one machine to another. If the TSA component is not going to be used, the error message can be safely ignored.   
If the need to use TSA arises in future, the installSAM script can be used to manually install the component. The following link can help:    
 
Installing IBM Tivoli System Automation for Multiplatforms (SA MP) Base Component using the installSAM install script   
To resolve this issue, install the reported operating system package mentioned in the prereqSAM.log.123456 file and re-run the installation.   
 
Related information   
DBI1130E   

接下来::::验证一下许可吧

[root@SUSE-Linux]# cd /opt/ibm/db2/V9.7/adm   
[root@SUSE-Linux]# ./db2licm -l   
Product name:                     "DB2 Enterprise Server Edition"   
License type:                     "Trial"   
Expiry date:                      "02/14/2016"   
Product identifier:               "db2ese"   
Version information:              "9.7"   
 
Product name:                     "DB2 Connect Server"   
License type:                     "Trial"   
Expiry date:                      "02/14/2016"   
Product identifier:               "db2consv"   
Version information:              "9.7"   

90天,唉,感觉90天不够用的,去找license吧
接下来
大工告成!~


标签:mysql
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

搜索
排行榜
关注我们

一个IT知识分享的公众号