CDC(11.4) for DB2步骤
一、 CDC环境用户创建
在数据库服务器创建cdc环境安装用户组及用户
groupadd cdcgrp
useradd -g cdcgrp -G dba,asmdba -m -d "/home/cdcusr" cdcusr
二、安装准备前数据库验证
1.数据库开启日志归档
查看数据当前日志模式
需要切换到db2用户下
# su - db2inst1
连接数据库
$ db2 connect to db_name
$ db2 get db cfg for test | grep -i log
执行下面操作更改数据库日志模式
[db2inst1@YL61 ~]$ db2 force applications all
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
[db2inst1@YL61 ~]$ db2 backup db test
Backup successful. The timestamp for this backup image is : 20200214164117
[db2inst1@YL61 ~]$ db2 connect to test
Database Connection Information
Database server = DB2/LINUXX8664 11.1.4.4
SQL authorization ID = DB2INST1
Local database alias = TEST
[db2inst1@YL61 ~]$ db2 update db cfg for test using LOGARCHMETH1 disk:/home/db2inst1/new_logs
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@YL61 ~]$ db2 backup db test
Backup successful. The timestamp for this backup image is : 20200214164205
[db2inst1@YL61 ~]$ db2 backup db test online compress include logs
Backup successful. The timestamp for this backup image is : 20200214164230
[db2inst1@YL61 ~]$ db2 terminate
DB20000I The TERMINATE command completed successfully.
[db2inst1@YL61 ~]$ db2stop
SQL1064N DB2STOP processing was successful.
[db2inst1@YL61 ~]$ db2start
SQL1063N DB2START processing was successful.
[db2inst1@YL61 ~]$ db2 connect to test
Database Connection Information
Database server = DB2/LINUXX8664 11.1.4.4
SQL authorization ID = DB2INST1
Local database alias = TEST
[db2inst1@YL61 ~]$ db2 get db cfg for test | grep -i log
三、CDC安装配置
1.上传安装文件
上传安装文件到服务器cdcusr用户的当前目录/home/cdcusr
介质上添加可执行权限,然后开始安装
# chmod 700 setup-iidr-11.4.0.2-5103-aix-power.bin
2.cdc for DB2安装
# sh ./setup-iidr-11.4.0.2-5103-aix-power.bin
第一步:选择语言,推荐English
第二步:选择安装新的产品
第三步:选择安装的产品类型,本次安装以DB2为例,选择2
第四步:选择IBM Data Replication
第五步:根据安装路径规划输入安装路径
/home/cdcusr/ibm/InfoSphereDataReplication/ReplicationEngineforIBMDB2
第六步:选择1同意许可,接下来一直回车选择默认选择即可,直到安装完成
第七步:选择实例和产品日志存放目录,默认Enter键
第八步:默认,点击entry键继续
第八步:安装完成,选择2退出
四、创建CDC实例
a.创建认证证书
最新版本的CDC创建实例必须要指定加密文件和信任证书,需要先创建出来 以下命令中的LPMDEVDB1,取hostname
使用如下命令创建主机私钥: /home/cdcusr/ibm/InfoSphereChangeDataCapture/ReplicationEngineforIBMDB2/jre64/jre/bin/keytool -genkeypair -noprompt -alias self -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -dname "CN=LPMDEVDB1" -validity 365 -keypass password -keystore privatekey.jks -storepass password -storetype JKS
使用下面命令导出私钥证书: /home/cdcusr/ibm/InfoSphereChangeDataCapture/ReplicationEngineforIBMDB2/jre64/jre/bin/keytool -exportcert -noprompt -rfc -alias self -file LPMDEVDB1.crt -keystore privatekey.jks -storepass password -storetype JKS
使用下面命令导入证书: /home/cdcusr/ibm/InfoSphereChangeDataCapture/ReplicationEngineforIBMDB2/jre64/jre/bin/keytool -importcert -noprompt -alias LPMDEVDB1 -file LPMDEVDB1.crt -keypass password -keystore trust.jks -storepass password -storetype JKS |
b.创建CDC实例
su - cdc cd /home/cdcusr/ibm/InfoSphereChangeDataCapture/ReplicationEngineforIBMDB2/bin 执行 ./dmconfigurets |
安装过程如下图所示:
点击Enter键,继续下一步
输入CDC实例名称:cdc_tc,继续下一步
默认服务器端口,点击Enter键,继续下一步
存储上限和内存上限,点击Enter键,继续下一步
默认,点击Enter键,继续下一步
默认,点击Enter键,继续下一步
选择1,下一步
选择1,下一步
输入profile name:en1,下一步
不使用加密模式,配置加密时选择disable
配置主机私钥路径及文件名,密码为password
/home/cdcusr/privatekey.jks
选择1 JKS(Java),进入下图,配置trust.jks路径,密码为password
/home/cdcusr/trust.jks
再次选择1JKS(Java),完成加密配置
选择4,查询已配置的Encryption profile,点击下一步
选择已配置的Encryption profile;en1
默认,点击下一步
选择db2实例
用户:cdcusr 密码:1234abcd
刷新装入程序路径:/home/cdcusr/load
五、CDC启停操作
以下命令在
/home/cdcusr/ibm/InfoSphereChangeDataCapture/ReplicationEngineforIBMDB2/bin
启动CDC配置窗口命令:
./dmconfigurets
启动CDC实例命令:
nohup ./dmts64 -I cdc_gjyw &
停止CDC实例命令:
./dmshutdown -I cdc_gjyw
- 点赞
- 收藏
- 关注作者
评论(0)