首页 > 数据库 >DB2 Linux环境安装

DB2 Linux环境安装

时间:2024-12-03 15:56:48浏览次数:4  
标签:Task end Estimated Linux start second time DB2 安装

注:以下所述内容均以db2 for linux v9.7 x64 enterprise edition为标准

1 先决条件
操作系统版本 Linux 支持的最低级别操作系统包括:
Red Hat Enterprise Linux (RHEL) 5 更新 2.0.4
SUSE Linux Enterprise Server (SLES) 10 Service Pack 2
SUSE Linux Enterprise Server (SLES) 11
Ubuntu 8.0.4.1

程序包要求 Libaio
compat-libstdc++(包含 libstdc++.so.5)
libstdc++(libstdc++.so.6)
pdksh 或 ksh93
rsh-server
xinetd
openssh
openssh-server
nfs-utils
安全选项 SELINUX保持关闭

2 修改内核参数(以60%系统容量)
/etc/sysctl.conf kernel.shmmni=4096
kernel.shmmax=329853488332
kernel.shmall=80530636
kernel.sem=250 256000 32 4096
kernel.msgmni=32768
kernel.msgmax=65536
kernel.msgmnb=65536

  1. 导出原db2 database参数以参考
    db2inst3@/home/db2inst3>db2cfexp ./ods5cfg.templ template
    db2inst3@/home/db2inst3>cat ods5cfg.templ

4创建用户
groupadd -g 1000 db2iadm1
groupadd -g 1001 db2fadm1
useradd -u 1000 -g db2iadm1 -d /home/db2inst1 -m db2inst1
useradd -u 1001 -g db2fadm1 -d /home/db2fenc1 -m db2fenc1
echo '1q2w3e' |passwd --stdin db2inst1
echo '1q2w3e' |passwd --stdin db2fenc1

5创建目录和挂载信息
mkdir /database
mkdir /db2log
mkdir /db2arch
mkdir /backup
chown db2inst1:db2iadm1 /database
chown db2inst1:db2iadm1 /db2log
chown db2inst1:db2iadm1 /db2arch
chown db2inst1:db2iadm1 /backup

6此次在全新环境和跨平台安装,不采用响应式和向导安装,使用db2_install安装产品组件
查看原安装目录
db2inst1@/opt/IBM/db2/V9.5>db2level
DB21085I Instance "db2inst3" uses "64" bits and DB2 code release "SQL09057"
with level identifier "06080107".
Informational tokens are "DB2 v9.5.0.7", "s101129", "IP23136", and Fix Pack
"7".
Product is installed at "/opt/IBM/db2/V9.5".
使用ROOT用户执行
cd /tmp
tar -xvf db2_97_ese.linux64_x86_64bit.tar
cd ese
./db2_install
WARNING:
The 32 bit library file libstdc++.so.6 is not found on the system.
32-bit applications may be affected.

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.

ESE
CLIENT
RTCL

Enter "help" to redisplay product names.

Enter "quit" to exit.


help

Specify one of the following keywords to install DB2 products.

ESE
CLIENT
RTCL

Enter "help" to redisplay product names.

Enter "quit" to exit.


ese
WARNING:
The 32 bit library file libstdc++.so.6 is not found on the system.
32-bit applications may be affected.
DB2 installation is being initialized.

Total number of tasks to be performed: 47
Total estimated time for all tasks to be performed: 2019

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 12 second(s)
Task #3 end

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

Task #5 start
Description: Java Runtime Support
Estimated time 109 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: Base server support for installation with root privileges
Estimated time 7 second(s)
Task #7 end

Task #8 start
Description: Integrated Flash Copy Support
Estimated time 53 second(s)
Task #8 end

Task #9 start
Description: Global Secure ToolKit
Estimated time 29 second(s)
Task #9 end

Task #10 start
Description: Java support
Estimated time 11 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 46 second(s)
Task #12 end

Task #13 start
Description: Java Common files
Estimated time 20 second(s)
Task #13 end

Task #14 start
Description: Base server support
Estimated time 230 second(s)
Task #14 end

Task #15 start
Description: IBM Software Development Kit (SDK) for Java(TM)
Estimated time 34 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 19 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 41 second(s)
Task #23 end

Task #24 start
Description: Command Line Processor Plus
Estimated time 3 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: Spatial Extender client
Estimated time 3 second(s)
Task #28 end

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

Task #30 start
Description: DB2 Update Service
Estimated time 4 second(s)
Task #30 end

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

Task #32 start
Description: Product Signature for DB2 Enterprise Server Edition
Estimated time 5 second(s)
Task #32 end

Task #33 start
Description: Sample database source
Estimated time 4 second(s)
Task #33 end

Task #34 start
Description: DB2 Text Search
Estimated time 198 second(s)
Task #34 end

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

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

Task #37 start
Description: Installing or updating SA MP
Estimated time 40 second(s)
Task #37 end

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

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

Task #40 start
Description: Installing IBM Tivoli Monitoring for Databases
Estimated time 600 second(s)
Task #40 end

Task #41 start
Description: Starting DB2 Fault Monitor
Estimated time 10 second(s)
Task #41 end

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

Task #43 start
Description: Registering DB2 licenses
Estimated time 5 second(s)
Task #43 end

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

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

Task #46 start
Description: Registering DB2 Update Service
Estimated time 30 second(s)
Task #46 end

Task #47 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #47 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.87815".

注:此warning经查日志信息仅影响HADR主动回切功能,不影响企业版使用

7 修改系统参数
echo ‘127.0.1.111 ods5’ >> /etc/hosts
echo ‘db2inst1 50000/tcp’ >> /etc/services
echo ‘
db2list1  soft nofile 65536
db2inst1  hard nofile 65536
db2inst1  soft nproc  65536
db2inst1  hard nproc  65536
‘ >> /etc/security/limits.conf

8 创建实例
cd /opt/ibm/db2/V9.7/instance
./db2icrt -u db2fenc1 db2inst1

9 修改db2创建数据库默认路径为/database
db2 get dbm cfg | grep -i DFTDBPATH
Default database path (DFTDBPATH) = /home/db2inst1
db2 update dbm cfg using DFTDBPATH /database
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
db2 => create database dbtest
DB20000I The CREATE DATABASE command completed successfully.
[root@ods5 database]# ll
total 20
drwxrwxr-x. 3 db2inst1 db2iadm1 4096 Mar 13 17:41 db2inst1

10创建示例库
su – db2inst1
db2sampl
db2 create database dbtest

11 修改db2日志位置
db2 update db cfg for dbtest using NEWLOGPATH /db2log
db2 get db cfg for dbtest | grep LOGPATH
Changed path to log files (NEWLOGPATH) = /db2log/NODE0000/
Overflow log path (OVERFLOWLOGPATH) =
Mirror log path (MIRRORLOGPATH) =

[db2inst1@ods5 database]$ db2 update db cfg for dbtest using LOGARCHMETH1 disk:/db2arch
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ods5 database]$ db2 get db cfg for dbtest | grep LOGARCH
First log archive method (LOGARCHMETH1) = DISK:/db2arch/
Options for logarchmeth1 (LOGARCHOPT1) =
Second log archive method (LOGARCHMETH2) = OFF
Options for logarchmeth2 (LOGARCHOPT2) =

12修改db2其他设置
db2set DB2_PARALLEL_IO=*
db2set DB2_SKIPINSERTED=YES
db2set DB2_USE_ALTERNATE_PAGE_CLEANING=YES
db2set DB2_EVALUNCOMMITTED=YES
db2set DB2_ANTIJOIN=EXTEND
db2set DB2_SKIPDELETED=YES
db2set DB2CODEPAGE=1208

13 修改日志模式
[db2inst1@ods5 database]$ db2 update db cfg for dbtest using LOGRETAIN RECOVERY
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.

14 重启数据库并备份,数据库到正常模式
[db2inst1@ods5 database]$ db2stop
03/13/2018 18:18:01 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
[db2inst1@ods5 database]$ db2start
03/13/2018 18:18:05 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
[db2inst1@ods5 database]$ db2 connect to dbtest
SQL1116N A connection to or activation of database "DBTEST" cannot be made
because of BACKUP PENDING. SQLSTATE=57019
[db2inst1@ods5 database]$ db2 backup db dbtest to /backup

Backup successful. The timestamp for this backup image is : 20180313182254

[db2inst1@ods5 database]$ db2 connect to dbtest

Database Connection Information

Database server = DB2/LINUXX8664 9.7.0
SQL authorization ID = DB2INST1
Local database alias = DBTEST

[db2inst1@ods5 database]$ db2 terminate
DB20000I The TERMINATE command completed successfully.

标签:Task,end,Estimated,Linux,start,second,time,DB2,安装
From: https://www.cnblogs.com/dbshare/p/18584251

相关文章

  • Linux基础——下载工具(wget、curl、git)
    一、curl下载curl-C--fLOhttps://mirrors.cmecloud.cn/bclinux/oe21.10/cr/update/x86_64/Packages/openssh-8.2p1-29.oe2003sp4.x86_64.rpm#下载文件到当前位置curl-O https://mirrors.cmecloud.cn/bclinux/oe21.10/cr/update/x86_64/Packages/openssh-8.2p1-29.oe2003......
  • CDH 安装步骤
    CDH集群搭建一、VirtualBox创建主节点1)点击新建。2)设置名称为node1→选择存储路径→选择类型为Linux→选择版本为Oracle-64bit或OtherLinux(版本只影响图标,没有其他影响)。3)根据电脑分配内存,可以为8GB或10GB。4)选择“现在创建虚拟硬盘”。点击“......
  • Linux常用命令之wget命令详解
    wget命令详解wget是一个在命令行中使用的工具,它用于从网络上下载文件。这个工具支持多种协议,包括HTTP、HTTPS和FTP,并且提供了丰富的选项来控制下载过程。wget的强大之处在于它的非交互性,这意味着它可以在用户没有登录的情况下运行,非常适合自动化脚本使用。以下是wget......
  • Linux常用命令之rpm命令详解
    rpm命令详解rpm命令是RedHatPackageManager的缩写,它是一个用于管理软件包的工具,主要用于基于RedHat的Linux发行版,如CentOS、Fedora等。rpm允许用户安装、更新、卸载和查询软件包,并且可以用来验证已安装软件包的完整性。基本用法rpm[选项][参数]主要功......
  • Ubuntu20.04 由源码编译安装opencv3.2 OpenCV
    Ubuntu20.04由源码编译安装opencv3.2.0获取opencv及opencv_contrib源代码创建目录以存放opencv及opencv_contrib源代码mkdir~/opencv3.2.0cd~/opencv3.2.0获取opencv源代码并切换到对应taggitclonehttps://github.com/opencv/opencv.gitcdopencvgitchecko......
  • CentOS7 yum 安装 提示 网络问题解决办法
    1.sudovi/etc/yum.repos.d/CentOS-Base.repo2.将里边文件替换(insert%d  清除所有内容)  [base]name=CentOS-$releasever-Base-Aliyunbaseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RP......
  • mac系统nvm安装步骤
    官网https://nvm.uihtm.com/#nvm-mac注意:不要使用HomeBrew安装nvm,官方不推荐,按照以下命令依次执行,推荐使用curl安装命令 安装完成之后终端输入nvm-v报错:commandnotfound,是因为还没有配置环境变量,终端继续执行以下命令:exportNVM_DIR="$HOME/.nvm"[-s"$NVM_DIR/nvm.sh"......
  • ubuntu22.0.4下CUDA12.1和cuDNN8.9.1的安装
    CUDA命令查找地址:https://developer.nvidia.com/cuda-downloadsTerminal(快捷键Ctrl+Alt+t)里输入一下命令:wgethttps://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.runsudoshcuda_12.1.0_530.30.02_linux.run马上显示一个......
  • 在Windows PE(Preinstallation Environment,预安装环境)中集成PowerShell 7,可以为系统管
    在WindowsPE(PreinstallationEnvironment,预安装环境)中集成PowerShell7,可以为系统管理员提供更强大的命令行工具和自动化脚本支持。WindowsPE本身是一个轻量级的操作系统,通常用于系统部署、恢复、维修和故障排除等任务,但它默认只集成了基本的命令行工具和脚本环境(如CMD和批处理......
  • 全网唯一的高性能在线客服系统源码(开源代码+终身使用+安装教程)
    本系统采用GolangGin框架+GORM+MySQL+Vue+ElementUI开发的独立高性能在线客服系统。客服系统访客端支持PC端、移动端、小程序、公众号中接入客服,利用超链接、网页内嵌、二维码、定制对接等方式让网上所有通道都可以快速通过本系统联系到商家。服务端可编译为二进制程序包,无需......