老孟 DB2 V9.7 ESE(一)产品部署 基于centOS 6.4
来源:互联网 发布:买网站域名 编辑:程序博客网 时间:2024/05/22 13:14
本文安装系统CENTOS 6.4 DB2位数64
安装中涉及目录位置各位可自行定义
生产系统为安全和性能考虑,一般将DB2实例目录、日志目录、归档日志目录、表空间目录区分开,可建立/db2home
/db2home/log
/db2home/arclog
/db2home/db
本文章安装的是DB2 ESE 就是企业版,因为后继文档还要搭建HADR,这个是有期限的,现在EXPRESS-C是免费的。
关于文档:较之前的版本来说现在好多了,提供了部分中文文档。全部的中文文档和英文文档可以打包下载:
http://www-01.ibm.com/support/docview.wss?rs=71&uid=swg27015148
网络使用不是很方便的同学,或者网速慢的同学,可以下载DB2 信息中心到本地进行安装,下载地址在上面链接中的:A downloadable version of the latest DB2 Version 9.7 Information Center is also available for local installations.部分。
准备工作
准备centOS系统 64 bit:虚拟机或单独机器安装。下载地址 http://mirrors.163.com/centos/6.4/isos/x86_64/
下载DB2:访问 http://www-01.ibm.com/software/data/db2/ ,右上角输入DB2 V9.7 DOWNLOAD,查询结果中寻找下载。下载可通过HTTP或者IBM下载工具(需要安装JRE)。下载包名为 v9.7_linuxx64_server.tar.gz
安装centOS系统
上传DB2安装包至/software 目录
解压DB2安装包 gunzip v9.7_linuxx64_server.tar.gz
tar -xvf v9.7_linuxx64_server.tar
安装前检查
进入安装目录 cd /software/server
./db2prereqcheck 进行安装前检查
这里面会主要提到两个问题
1、
WARNING:DBT3534W The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
这个是说centOS开启了内存地址随机化机制(address space layout randomization)功能,这个功能对DB2本身没有太大影响,有个别工具db2pd db2egcf 会出现异常,若有强迫症
官方解释:
DBT3534Wdb2prereqcheck 实用程序确定 ASLR 设置为 ON 并且这可能导致某些工具发生问题。说明地址空间布局随机化 (ASLR) 缺省情况下在某些 Linux 分发上已激活。ASLR 被设计为在随机地址装入共享内存对象。ASLR 启用后,DB2 数据库不能保证地址对共享内存对象可用。地址空间中的此冲突意味着尝试将共享内存对象附加至特定地址的进程可能无法完成任务,从而导致 shmat 子例程失败。但是,后续使用新进程重试共享内存附加时可能会成功。结果是一组随机失败。已知会见到此错误的一些进程包括:db2pd、db2egcf 和 db2vend。此问题可能导致的一些错误包括以下各项db2pd 命令可能会报告找不到数据,即使实例或数据库处于活动状态。db2egcf 进程(用于监视)可能会错误地确定实例已关闭并启动故障转移操作。在备份和日志归档操作中,db2vend 进程可能会失败,并产生错误,指示未能启动子进程。用户响应通过设置以下内核参数来关闭随机化:kernel.randomize_va_space=0通过发出以下命令来临时禁用随机化并重新启动 DB2 实例:echo 0 > /proc/sys/kernel/randomize_va_space或者sysctl -w kernel.randomize_va_space=0上面两条命令是临时更改,重启后,该值会还原成2要想永远对centOS关闭,则编辑/etc/sysctl.conf 文件新增一行kernel.randomize_va_space = 0保存退出后,运行sysctl -p 使之生效,重启后也有效了。
2、
WARNING: The 32-bit library file libpam.so is not found on the system.这个是DB2要求的一个32位的pam库
官网解释如下
Error descriptionThe db2prereqcheck utility was enhanced to check for libpam.soin DB2 version 9.7 FP6 via APAR IC78338 and the validation isdone by looking up "libpam.so" (either a file or a symboliclink) on the system. The original approach was to look up thefile libpam.so.0 on system, however this would not work onsystems with updated PAM module. PAM module could be updatedfrom time to time and if we hard-coded db2prereqcheck to checkfor libpam.so.0, then the check would fail on newer system wherethe module might have updated to upper version like libpam.so.1.In most case a symbolic link of libpam.so would be created topoint to latest version of libpam.so.x, hence havedb2prereqcheck to look for libpam.so (either a file or a symbollink). This approach was to avoid any further issue with PAMmodule upgrade on affected platform. However this may not workon older system which has libpam.so.0 only.Local fixCreate a symbolic link named libpam.so that points tolibpam.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包[root@centos-0 server]# yum -y install pam.i686到安装后生成的库文件[root@centos-0 lib]# find / | grep libpam.so/lib64/libpam.so.0.82.2/lib64/libpam.so.0/lib/libpam.so.0.82.2/lib/libpam.so.0对找到的SO文件用file命令测试[root@centos-0 lib]# file /lib/libpam.so.0.82.2/lib/libpam.so.0.82.2: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped建立符号链接[root@centos-0 lib]# ln -s /lib/libpam.so.0.82.2 /lib/libpam.so
安装
[root@centos-0 server]# ./db2_install WARNING:DBT3534W The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools. Default directory for installation of products - /opt/ibm/db2/V9.7***********************************************************Do you want to choose a different directory to install [yes/no] ?no 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.***********************************************************eseWARNING:DBT3534W The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.DB2 installation is being initialized. Total number of tasks to be performed: 48 Total estimated time for all tasks to be performed: 1990 Task #1 startDescription: Checking license agreement acceptance Estimated time 1 second(s) .......Task #48 startDescription: Updating global profile registry Estimated time 3 second(s) Task #48 end A minor error occurred while installing "DB2 Enterprise Server Edition " onthis computer. Some features may not function correctly.For more information see the DB2 installation log at"/tmp/db2_install.log.17061"
ESE 一共48个步骤,最后安装完成后,有个提示:说有个较小的错误发生了,可能会影响某些功能的正常使用,这个一般没问题
具体看日志如下
Installing or updating SA MP :.......FailureExecuting control tasks :.......SuccessUpdating global registry :.......SuccessThe installation of IBM Tivoli Monitoring for Databases failed. The log filecan be found at /opt/ibm/db2/V9.7/itma/logs/itm_install.log.Starting DB2 Fault Monitor :.......SuccessUpdating the db2ls link :.......SuccessRegistering DB2 licenses :.......SuccessSetting default global profile registry variables :.......SuccessInitializing instance list :.......SuccessRegistering DB2 Update Service :.......SuccessUpdating global profile registry :.......SuccessWARNING: 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.7Space required: 1068 MBInstall SA MP: NoTSAMP_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. Theseprerequisites have not been met.The mentioned log file has the details for the unsatisfiedprerequisites.To find out more about the system prerequisites for the SA MP BaseComponent, see the SA MP Base Component documentation's Installation andConfiguration Guide.SA MP cannot be installed or updated.User response:Modify your system to meet the prerequisites; and use the installSAMutility 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 = 1prereqSAM: OPT_NOLICCHECK = 1prereqSAM: Detected operating system LinuxprereqSAM: Detected architecture i386xprereqSAM: Error: The following distribution is not supportedprereqSAM: Error: Prerequisite checking for the ITSAMP installation failed Linux i386xCentOS release 6.4 (Final)prereqSAM: Most severe error code returned 23prereqSAM: Unable to perform prerequisite checking
恩,是说在检查SA MP安装的时候失败,返回错误码23:
好吧,到这个时候,应该找不到问题解决了吧,别急,再仔细看看日志 ,哦?有个错误号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.SymptomWhile 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.CauseThe DBI1130E error messages is returned when some of the pre-requisites needed for installing the particular component are missing or are not installed.EnvironmentNote: 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 problemThe error message from the install log should read as below:DBI1130E The SA MP Base Component could not be installed or updatedbecause 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 TivoliSystem Automation for Multiplatforms Base Component (SA MP BaseComponent). These prerequisites have not been met.The mentioned log file has the details for the unsatisfiedprerequisites.To find out more about the system prerequisites for the SA MP BaseComponent, see the Installation and Configuration Guide athttp://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.storagermprereqSAM: Error: Prerequisite checking for the ITSAMP installation failed AIX 6100-04prereqSAM: Most severe error code returned 21prereqSAM: 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 problemThis 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 scriptTo resolve this issue, install the reported operating system package mentioned in the prereqSAM.log.123456 file and re-run the installation.Related informationDBI1130E
接下来::::验证一下许可吧
[root@centos-0 V9.7]# cd /opt/ibm/db2/V9.7/adm[root@centos-0 adm]# ./db2licm -lProduct name: "DB2 Enterprise Server Edition"License type: "Trial"Expiry date: "02/14/2014"Product identifier: "db2ese"Version information: "9.7"Product name: "DB2 Connect Server"License type: "Trial"Expiry date: "02/14/2014"Product identifier: "db2consv"Version information: "9.7"90天,唉,感觉90天不够用的,去找license吧
接下来
大工告成!~
关于官方内核参数
之前V8的时候调整过参数,直到前几天看同事搭建ORACLE的时候,还是需要手动调整参数。
从9.7 FP2以后,内核参数是无需手动调整的,版本10全系列都不用调整,在DB2运行时动态计算。这个必须赞一个
但还是理解一下原来的参数设置吧。
ipcs purpose : Reports interprocess communication facility status.(个人理解是 inter process communication status 的缩写)
lpcs -l 列出当前设置,注意这个设置在centos中是存储在/etc/sysctl.conf 文件中
# ipcs -l ------ Shared Memory Limits -------- max number of segments = 4096 // SHMMNI max seg size (kbytes) = 32768 // SHMMAX max total shared memory (kbytes) = 8388608 // SHMALL min seg size (bytes) = 1 ------ Semaphore Limits -------- max number of arrays = 1024 // SEMMNI max semaphores per array = 250 // SEMMSL max semaphores system wide = 256000 // SEMMNS max ops per semop call = 32 // SEMOPM semaphore max value = 32767 ------ Messages: Limits -------- max queues system wide = 1024 // MSGMNI max size of message (bytes) = 65536 // MSGMAX default max size of queue (bytes) = 65536 // MSGMNB
DB2 官方文档给出如下解释:
第一部分,SHMMAX 限制是 Linux 系统上共享内存段的最大大小。SHMALL 限制是系统上共享内存页的最大分配。
建议将 SHMMAX 值设置为等于系统上的物理内存量。然而,x86 系统上需要的最小内存量为 268435456 (256 MB),对于 64 位系统,需要的最小内存量为 1073741824 (1 GB)。
下一部分包括可用于操作系统的信号量。内核参数 sem 由以下四个标记组成:SEMMSL、SEMMNS、SEMOPM 和 SEMMNI。SEMMNS 是 SEMMSL 乘以 SEMMNI 的结果。数据库管理器要求在必要时增大阵列数 (SEMMNI)。通常情况下,SEMMNI 应该是系统上需要的最大代理程序数乘以数据库服务器计算机上的逻辑分区数再加上数据库服务器计算机上的本地应用程序连接数的和的两倍。
第三部分包括系统上的消息
MSGMNI 参数将影响可以启动的代理程序数;MSGMAX 参数将影响队列中可以发送的消息的大小,MSGMNB 参数将影响队列的大小。
应该将 MSGMAX 参数更改为 64 KB(即,65536 个字节),并且应该将 MSGMNB 增大到 65536。
- 老孟 DB2 V9.7 ESE(一)产品部署 基于centOS 6.4
- 老孟 DB2 V9.7 ESE(二)实例及DB创建连接 基于centOS 6.4
- DB2 v9.7安装
- DB2 老笔记系列(一)
- DB2 V9.7中新特性(一)---关于锁的改进
- DB2 V9.7 语句集中器的使用(一)
- [DB2]linux下安装db2 v9.7
- [DB2]Linux下安装db2 v9.7
- DB2 V9.7 HADR总结
- DB2 V9.7中新特性(二)---关于锁的改进-数据库日志内容(一)
- DB2 V9.7 语句集中器的使用(二)
- Centos66 Db2 V9.1 升级到V9.7
- 基于Windows在VirtualBox部署CentOS 7
- Darknet (一) YOLO 基于 CentOS CPU 的部署使用
- DB2 V9.7 中文联机文档
- DB2 V9.7 SQL10007N错误解决。
- 在Linux下安装DB2 V9.7
- DB2 V9.7中的DATAACCESS权限
- MyEclipse 项目有红感叹号
- 【python】文件操作
- 定义一个函数,其参数为年、月、日的值,返回这一天为该年的第几天
- Asp.Net MVC中的约定
- java【源码】员工管理系统
- 老孟 DB2 V9.7 ESE(一)产品部署 基于centOS 6.4
- 黑马程序员第-myeclipse快捷键大全
- 猜一个数
- 【python】字符串的用法阶进
- jQuery中.bind(),.live()和.delegate()的区别
- HttpURLConnection和HttpClient获取Json数据
- 微信安卓内置浏览器文本换行bug解决
- 【资料整理】CentOS5.6 升级 Python2.4.3 到 2.7.5
- linux下安装svn 解决svn: Unrecognized URL scheme