首页 > 数据库 >达梦数据库系列—46.DMHS实现DM8到DM8的同步

达梦数据库系列—46.DMHS实现DM8到DM8的同步

时间:2024-08-12 16:52:56浏览次数:13  
标签:dm dmhs 46 HSEXEC DMHS DM8 节点

目录

DMHS实现DM8到DM8的同步

1、准备介质

2、安装

图形化安装

静默方式安装

3、准备DM8数据库

软件安装

数据库创建

打开归档

开启附加日志

创建辅助表

创建连接用户

创建测试用户和表

4、同步配置

修改服务配置

双向同步配置

单向同步配置

5、启动DMHS服务

装载字典

启动cpt模块

启动exec模块

6、查看信息


DMHS实现DM8到DM8的同步

源端:DM8,麒麟V10

目标端:DM8,麒麟V10

介质:

1、准备介质

2、安装

图形化安装

静默方式安装

3、准备DM8数据库

软件安装

数据库创建

没有数据库可参考该步骤创建,否则略过。

dmdba用户:

节点一:

dminit path=/dm/data PAGE_SIZE=32 EXTENT_SIZE=32 CASE_SENSITIVE=y CHARSET=1 DB_NAME=HS01 INSTANCE_NAME=HS01 PORT_NUM=5239

root用户:

cd /home/dmdba/dmdbms/script/root/

./dm_service_installer.sh -t dmserver -dm_ini /dm/data/HS01/dm.ini -p HS01

节点二:

dminit path=/dm/data PAGE_SIZE=32 EXTENT_SIZE=32 CASE_SENSITIVE=y CHARSET=1 DB_NAME=HS02 INSTANCE_NAME=HS02 PORT_NUM=5239

root用户:

cd /home/dmdba/dmdbms/script/root/

./dm_service_installer.sh -t dmserver -dm_ini /dm/data/HS02/dm.ini -p HS02

打开归档

节点一:

ALTER DATABASE MOUNT;

ALTER DATABASE ADD ARCHIVELOG 'TYPE = LOCAL,DEST = /dm/data/HS01/arch,FILE_SIZE = 128,SPACE_LIMIT = 1024';

ALTER DATABASE ARCHIVELOG;

ALTER DATABASE OPEN;

select para_value from v$dm_ini where para_name in ('ARCH_INI');

节点二:

ALTER DATABASE MOUNT;

ALTER DATABASE ADD ARCHIVELOG 'TYPE = LOCAL,DEST = /dm/data/HS02/arch,FILE_SIZE = 128,SPACE_LIMIT = 1024';

ALTER DATABASE ARCHIVELOG;

ALTER DATABASE OPEN;

select para_value from v$dm_ini where para_name in ('ARCH_INI');

开启附加日志

两节点分别执行:

SP_SET_PARA_VALUE(1,'RLOG_APPEND_LOGIC',1);

select para_value from v$dm_ini where para_name in ('RLOG_APPEND_LOGIC');

创建辅助表

两节点分别执行:

set define off

set char_code utf8

start /dmhs/scripts/ddl_sql_dm8.sql

共9个辅助表,4个触发器:

select owner, table_name from dba_tables where owner = 'SYSDBA' and table_name like 'DMHS%' and status = 'VALID';

select owner, trigger_name from dba_triggers where owner = 'SYSDBA' and trigger_name like 'DMHS%' and status = 'Y';

创建连接用户

两节点分别执行:

CREATE TABLESPACE HSEXEC DATAFILE 'HSEXEC.DBF' size 128;

CREATE USER HSEXEC IDENTIFIED by "HSEXEC" DEFAULT TABLESPACE HSEXEC DEFAULT INDEX TABLESPACE HSEXEC;

GRANT VTI TO HSEXEC;

GRANT PUBLIC TO HSEXEC;

GRANT RESOURCE TO HSEXEC;

GRANT DBA TO HSEXEC;

创建测试用户和表

4、同步配置

修改服务配置

节点一:

cd /dmhs/bin

cp TemplateDmhsService DmhsService

vim DmhsService

节点二:

同上

双向同步配置

节点一:

cd /dmhs/bin

vim dmhs.hs

exec_policy=2表示执行事务出错时,忽略出错的操作后继续执行;ddl_continue=1表示DDL操作同步出错时,继续往下操作。

<?xml version="1.0" encoding="GB2312" standalone="no"?>

<dmhs>

    <base>

        <lang>en</lang>

        <mgr_port>5345</mgr_port>

        <ckpt_interval>60</ckpt_interval>

        <siteid>11</siteid>

        <version>2.0</version>

    </base>

    <cpt>

        <name>cpt1</name>

        <db_type>dm8</db_type>

        <db_server>192.168.64.131</db_server>

        <db_user>HSEXEC</db_user>

        <db_ssl_path/>

        <db_ssl_pwd/>

        <db_pwd>8888888888</db_pwd>

        <char_code>PG_UTF8</char_code>

        <db_port>5239</db_port>

        <ddl_mask>op:TABLE:VIEW:PROCEDURE:FUNCTION:TRIGGER:INDEX:CHECK:SEQUENCE:TYPE:PACKAGE:SYNONYM</ddl_mask>

        <parse_thr>1</parse_thr>

        <arch>

            <clear_flag>1</clear_flag>

            <clear_interval>600</clear_interval>

        </arch>

        <send>

            <ip>192.168.64.132</ip>

            <mgr_port>5345</mgr_port>

            <data_port>5346</data_port>

            <trigger>1</trigger>

            <constraint>1</constraint>

            <identity>1</identity>

            <net_turns>0</net_turns>

            <filter>

                <enable>

<item>HSTEST.T1</item>

<item>HSTEST.T2</item>

                </enable>

            </filter>

            <map>

<item>HSTEST.T1==HSTEST1.T1</item>

<item>HSTEST.T2==HSTEST1.T2</item>

            </map>

        </send>

    </cpt>

    <exec>

        <recv>

            <mgr_port>5345</mgr_port>

            <data_port>5346</data_port>

        </recv>

        <enable>1</enable>

        <name>exec1</name>

        <db_type>DM8</db_type>

        <db_server>192.168.64.131</db_server>

        <db_user>HSEXEC</db_user>

        <db_pwd>8888888888</db_pwd>

        <db_port>5239</db_port>

 <exec_thr>1</exec_thr>

 <exec_sql>1024</exec_sql>

 <exec_trx> 5000 </exec_trx>

 <exec_rows>1000</exec_rows>

 <save_mask>EXEC</save_mask>

 <exec_policy>2</exec_policy>

 <ddl_continue>1</ddl_continue>

    </exec>

</dmhs>

节点二:

cd /dmhs/bin

vim dmhs.hs

<?xml version="1.0" encoding="GB2312" standalone="no"?>

<dmhs>

    <base>

        <lang>en</lang>

        <mgr_port>5345</mgr_port>

        <ckpt_interval>60</ckpt_interval>

        <siiteid>12</siteid>

        <version>2.0</version>

    </base>

    <cpt>

        <name>cpt1</name>

        <db_type>dm8</db_type>

        <db_server>192.168.64.132</db_server>

        <db_user>HSEXEC</db_user>

        <db_ssl_path/>

        <db_ssl_pwd/>

        <db_pwd>HSEXEC</db_pwd>

        <char_code>PG_UTF8</char_code>

        <db_port>5239</db_port>

        <ddl_mask>op:TABLE:VIEW:PROCEDURE:FUNCTION:TRIGGER:INDEX:CHECK:SEQUENCE:TYPE:PACKAGE:SYNONYM</ddl_mask>

        <parse_thr>1</parse_thr>

        <arch>

            <clear_flag>1</clear_flag>

            <clear_interval>600</clear_interval>

        </arch>

        <send>

            <ip>192.168.64.131</ip>

            <mgr_port>5345</mgr_port>

            <data_port>5346</data_port>

            <trigger>1</trigger>

            <constraint>1</constraint>

            <identity>1</identity>

            <net_turns>0</net_turns>

            <filter>

                <enable>

<item>HSTEST1.T1</item>

<item>HSTEST1.T2</item>

                </enable>

            </filter>

            <map>

<item>HSTEST1.T1==HSTEST.T1</item>

<item>HSTEST1.T2==HSTEST.T2</item>

            </map>

        </send>

    </cpt>

    <exec>

        <recv>

            <mgr_port>5345</mgr_port>

            <data_port>5346</data_port>

        </recv>

        <enable>1</enable>

        <name>exec1</name>

        <db_type>DM8</db_type>

        <db_server>192.168.64.132</db_server>

        <db_user>HSEXEC</db_user>

        <db_pwd>HSEXEC</db_pwd>

        <db_port>5239</db_port>

 <exec_thr>1</exec_thr>

 <exec_sql>1024</exec_sql>

 <exec_trx> 5000 </exec_trx>

 <exec_rows>1000</exec_rows>

 <save_mask>EXEC</save_mask>

 <exec_policy>2</exec_policy>

 <ddl_continue>1</ddl_continue>

    </exec>

</dmhs>

单向同步配置

节点一:

<?xml version="1.0" encoding="GB2312" standalone="no"?>

<dmhs>

    <base>

        <lang>en</lang>

        <mgr_port>5345</mgr_port>

        <ckpt_interval>60</ckpt_interval>

        <siteid>11</siteid>

        <version>2.0</version>

    </base>

    <cpt>

        <name>cpt1</name>

        <db_type>dm8</db_type>

        <db_server>192.168.64.131</db_server>

        <db_user>HSEXEC</db_user>

        <db_ssl_path/>

        <db_ssl_pwd/>

        <db_pwd>8888888888</db_pwd>

        <char_code>PG_UTF8</char_code>

        <db_port>5239</db_port>

        <ddl_mask>op:TABLE:VIEW:PROCEDURE:FUNCTION:TRIGGER:INDEX:CHECK:SEQUENCE:TYPE:PACKAGE:SYNONYM</ddl_mask>

        <parse_thr>1</parse_thr>

        <arch>

            <clear_flag>1</clear_flag>

            <clear_interval>600</clear_interval>

        </arch>

        <send>

            <ip>192.168.64.132</ip>

            <mgr_port>5345</mgr_port>

            <data_port>5346</data_port>

            <trigger>1</trigger>

            <constraint>1</constraint>

            <identity>1</identity>

            <net_turns>0</net_turns>

            <filter>

                <enable>

<item>HSTEST.T1</item>

<item>HSTEST.T2</item>

                </enable>

            </filter>

            <map>

<item>HSTEST.T1==HSTEST1.T1</item>

<item>HSTEST.T2==HSTEST1.T2</item>

            </map>

        </send>

    </cpt>

</dmhs>

节点二:

<?xml version="1.0" encoding="GB2312" standalone="no"?>

<dmhs>

    <base>

        <lang>en</lang>

        <mgr_port>5345</mgr_port>

        <ckpt_interval>60</ckpt_interval>

        <siteid>12</siteid>

        <version>2.0</version>

    </base>

    <exec>

        <recv>

            <mgr_port>5345</mgr_port>

            <data_port>5346</data_port>

        </recv>

        <enable>1</enable>

        <name>exec1</name>

        <db_type>DM8</db_type>

        <db_server>192.168.64.132</db_server>

        <db_user>HSEXEC</db_user>

        <db_pwd>HSEXEC</db_pwd>

        <db_port>5239</db_port>

 <exec_thr>1</exec_thr>

 <exec_sql>1024</exec_sql>

 <exec_trx> 5000 </exec_trx>

 <exec_rows>1000</exec_rows>

 <save_mask>EXEC</save_mask>

 <exec_policy>2</exec_policy>

 <ddl_continue>1</ddl_continue>

    </exec>

</dmhs>

5、启动DMHS服务

节点一:

cd /dmhs/bin

./DmhsService start

ps -ef |grep dmhs

节点二:

cd /dmhs/bin

./DmhsService start

ps -ef |grep dmhs

装载字典

源端:

copy 0 "sch.name = 'HSTEST'" DICT

启动cpt模块

节点一

DMHS> start cpt

DMHS> state

节点二

DMHS> start cpt

DMHS> state

启动exec模块

节点一

cd /dmhs/bin

./dmhs_console

DMHS> start exec

DMHS> state

节点二

DMHS> start exec

DMHS> state

双向同步:

节点1:

节点2:

单向同步:

节点1:

节点2:

6、查看信息

查看日志:

cd /dmhs/bin/log

tail -100f dmhs_202408.log

目标端:

exec

thr

trx

源端:

cpt

标签:dm,dmhs,46,HSEXEC,DMHS,DM8,节点
From: https://blog.csdn.net/md54333/article/details/141129374

相关文章

  • 达梦数据库系列—47.DMHS实现Oracle12C到DM8的同步
    目录1、准备介质2、安装3、准备源端Oracle和目标端DM8软件安装数据库创建打开归档开启附加日志创建辅助表Oracle端安装ODBC创建连接用户创建测试用户和表4、同步配置修改服务配置Oracle到Dm单向同步配置Dm到Oracle单向同步配置5、启动DMHS服务初始装载装载数......
  • panic: 8e85653db463fe36 state.commit 942043166 is out of range [939698375, 93970
    根据您提供的日志信息,看起来您的etcd服务遇到了一个panic错误,具体是因为state.commit的索引值942043166超出了预期的范围[939698375,939700076]。这种情况可能是由于etcd集群中的数据不一致导致的。首先,您可以尝试查看etcd集群的状态,确认所有成员是否都在正......
  • 代码随想录day25 || 491 递增子序列,46 全排列, 47 全排列2
    491递增子序列funcfindSubsequences(nums[]int)[][]int{ //思路,在原数组上面找寻递增子序列,所以不能改变顺序, varpath[]int varres[][]int //nums=quicksort(nums) backtracking(nums,&path,&res,-200)//范围是【-100,100】,传入一个不在区间的数字就不会......
  • [lnsyoj2246/luoguCF979D]Kuro and GCD and XOR and SUM
    题意给定集合\(S\),初始为空,进行\(q\)次修改或查询操作:修改操作将\(x\)加入集合;查询操作给定\(x,s,k\),要求找到满足\[\max_{u\inS,u+x\les,k|\gcd(u,x)}\{u\oplusx\}\]的最小的\(u\)。sol集合、异或、可查可改,可以自然地想到0/1-Trie。我们假设\(k=1\),此时不需......
  • 【日记】感觉自己越来越摆了(546 字)
    正文今天想了很多乱七八糟的事情,但最后都没有什么结论。这种情况一般称为:内耗。擦药的地方有些好点了,又有一些新的地方冒了出来。参加工作一年多了,现在却才开始越发受不了这种生活。好想要什么时候参加一次正规的半程马拉松比赛。只要完赛就好了。......
  • Spring Data Rest 远程命令执⾏命令(CVE-2017-8046)
    简介:Spring是JavaEE编程领域的⼀个轻量级开源框架,该框架由⼀个叫RodJohnson的程序员在2002年最早提出并随后创建,是为了解决企业级编程开发中的复杂性,业务逻辑层和其他各层的松耦合问题,因此它将⾯向接⼝的编程思想贯穿整个系统应⽤,实现敏捷开发的应⽤型框架。框架的主要优......
  • 春秋云境 | 文件上传 | CVE-2022-29464
    靶标介绍WSO2文件上传漏洞(CVE-2022-29464)是OrangeTsai发现的WSO2上的严重漏洞。该漏洞是一种未经身份验证的无限制任意文件上传,允许未经身份验证的攻击者通过上传恶意JSP文件在WSO2服务器上获得RCE。开启靶场先到国家信息安全漏洞库查看一下这个漏洞的相关信息利用......
  • P4604 [WC2017] 挑战 题解
    题目描述任务一给定\(n\)个\(32\)位无符号整数,将它们从小到大排序。任务二有\(2n\)个人玩"石头剪刀布"游戏,他们分成两排,每排\(n\)个人,\(a_{i,j}=0/1/2\)分别表示第\(i\)排第\(j\)人出石头、剪刀、布。\(q\)次询问,每次给定\(x,y,l\),询问第一排第\(x\simx......
  • AGC046C 题解
    blog。好菜啊,不会这题,来写个题解/kel。很难直接做,先找一点性质:操作只改变相对顺序,而总数不变。这启示我们记录每个\(0\)前面的极长\(1\)连续段长度。记第\(i(1\lei\leC)\)个\(0\)对应长度为\(a_i\),就存在下面的等价表述:每次操作可以选定\(i,j(1\lei<j\leC)\),......
  • [Microsoft][ODBC Driver 17 for SQL Server]TCP 提供程序:错误代码 0x2746 - 客户端无
    我正在尝试运行odoo项目ubuntu:22.04pyodbc==4.0.28python:3.8opensslversion:OpenSSL1.1.1p21Jun2022**ERROR:DIAG[08001][Microsoft][ODBCDriver17forSQLServer]TCPProvider:Errorcode0x2746DIAG[08001][Microsoft][ODBCDriver......