DMHS环境搭建
数据库类型 | ip | |
---|---|---|
源端 | oracle | 172.20.36.45 |
目的端 | dm | 172.19.136.11 |
安装dmhs软件
/dmhs_V4.2.60_dm8_rev106302_rh6_64_veri_20220225.bin -i
至此DMHS安装完成,我们环境安装路径为/home/dmdba/dmhs,源端虚机和目的端虚机环境都需要安装
配置dmhs.hs文件
目的端
<?xml version="1.0" encoding="GB2312"?>
<dmhs>
<base>
<lang>en</lang>
<mgr_port>5345</mgr_port>
<chk_interval>3</chk_interval>
<ckpt_interval>60</ckpt_interval>
<siteid>2</siteid>
<log_policy>2</log_policy>
<version>2.0</version>
</base>
<exec>
<recv>
<data_port>5346</data_port>
</recv>
<db_type>dm8</db_type>
<db_server>172.19.136.11</db_server>
<db_user>SYSDBA</db_user>
<db_pwd>SYSDBA</db_pwd>
<char_code>PG_GBK</char_code>
<db_port>5237</db_port>
<exec_mode>1</exec_mode>
<exec_thr>128</exec_thr>
<exec_sql>4096</exec_sql>
<exec_trx>10000</exec_trx>
<exec_rows>1000</exec_rows>
<exec_policy>2</exec_policy>
<stat_tab>26</stat_tab>
<level>0</level>
<enable_merge>0</enable_merge>
<enable_depended>0</enable_depended>
<recv_caches>32</recv_caches>
<trx_max_file>2</trx_max_file>
<clear_trx_file>1</clear_trx_file>
<trx_split>1</trx_split>
<direct_exec>1</direct_exec>
<commit_wait>0</commit_wait>
<commit_prepare>1</commit_prepare>
<commit_compress>1</commit_compress>
<preload_threads>8</preload_threads>
</exec>
</dmhs>
源端
<?xml version="1.0" encoding="GB2312"?>
<dmhs>
<base>
<lang>en</lang>
<mgr_port>5345</mgr_port>
<name>JFZWFWZX_5345_cpt</name>
<ckpt_interval>60</ckpt_interval>
<siteid>1</siteid>
<log_limit_size>2</log_limit_size>
<log_policy>2</log_policy>
<version>2.0</version>
</base>
<cpt>
<db_type>Oracle11g</db_type>
<db_server>172.20.36.45:1521/hydb</db_server>
<db_port>1521</db_port>
<db_user>TEST</db_user>
<db_pwd>TEST2019</db_pwd>
<char_code>PG_GBK</char_code>
<update_fill_flag>1</update_fill_flag>
<!--<ddl_mask>OBJ:OP:PARTITION:INDEX:COMMENT</ddl_mask>-->
<parse_thr>1</parse_thr>
<send>
<ip>172.19.136.11</ip>
<mgr_port>5345</mgr_port>
<data_port>5346</data_port>
<trigger>0</trigger>
<constraint>1</constraint>
<identity>1</identity>
<net_turns>0</net_turns>
<filter>
<enable>
<item>JFZWFWZX.LYJ_OLD_TABLE_JY</item>
</enable>
</filter>
<map>
<item>TEST.*==SYSDBA.*</item>
</map>
</send>
</cpt>
</dmhs>
配置dmhs脚本服务
源端
cd /home/dmdba/dmhs/bin
cp TemplateDmhsService DmhsService
vim DmhsService
#set execute environment
#REPLACE DMHS_HOME path
DMHS_HOME=/home/dmdba/dmhs
#REPLACE program dir
PROG_DIR=/home/dmdba/dmhs/bin
#REPLACE program config path
CONF_PATH=/home/dmdba/dmhs/bin/dmhs.hs
#REPLACE need library path, LD_LIBRARY_PATH/LIBPATH
NEED_LIB_PATH=/home/dmdba/dmhs/bin:/home/dmdba/dmdbms/bin
HS_NLS_LANG=""
目的端
cd /home/dmdba/dmhs/bin
cp TemplateDmhsService DmhsService
vim DmhsService
#set execute environment
#REPLACE DMHS_HOME path
DMHS_HOME=/home/dmdba/dmhs
#REPLACE program dir
PROG_DIR=/home/dmdba/dmhs/bin
#REPLACE program config path
CONF_PATH=/home/dmdba/dmhs/bin/dmhs.hs
#REPLACE need library path, LD_LIBRARY_PATH/LIBPATH
NEED_LIB_PATH=/home/dmdba/dmhs/bin:/home/dmdba/dmdbms/bin
HS_NLS_LANG=""
开始同步
启动源端和目的端的脚本服务
cd /home/dmdba/dmhs/bin
./DmhsService start
在目的端执行
./dmhs_console
start exec
在源端执行
./dmhs_console
-
装载表空间
LOAD 0 "SCH.NAME='TEST' AND TAB.NAME='LYJ_OLD_TABLE_JY'" DICT|CREATE|COMMENT|THREAD|16|PARTITION
-
装载并同步数据
LOAD 0 "SCH.NAME='TEST' AND TAB.NAME='LYJ_OLD_TABLE_JY'" INSERT|THREAD|16|PARTITION
问题归档
-
在开启dmhs服务时出现乱码
可以将操作系统的语言改为zh_CN.GBK或者将dmhs.hs文件的lang项配置为en
-
在执行LOAD命令时出现错误
要仔细写好LOAD命令,在配置SCH.NAME='TEST’和TAB.NAME='LYJ_OLD_TABLE_JY’不要忘记小引号