关于accessServer的使用案例(一)

这篇博客详细介绍了如何通过命令行工具进行数据库预定的管理。首先展示了关闭预定的步骤,包括设置会话、连接服务器和数据存储器,然后选择并关闭预定。接着,演示了预定的重建过程,涉及到配置可重建、设置变量、添加表映射以及启动镜像。最后,说明了如何打开预定,包括重新连接和启动镜像监控。这些操作对于数据库同步和维护至关重要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

####################   关闭预定   ######################
$ACCESSSRVER_HOME/bin/chcclp -L zh_CN
# 设置session
Repl >chcclp session set to cdc;
# 设置详细输出
Repl >set verbose;
# 链接服务
Repl > connect server hostname xxx port xxx username xxx password xxx;
# 打开数据存储器链接
Repl >connect datastore name xxx1 context source;
Repl >connect datastore name xxx2 context target;
# 选中预定
Repl >select subscription name xxx_x;
# 关闭预定
Repl >end replication name xxx_x method immediate;
# 断开数据存储器链接
Repl >disconnect datastore name xxx1;
Repl >disconnect datastore name xxx2;
# 断开服务器链接
Repl >disconnect server;

####################   重建预定   ######################
Repl > chcclp session set to cdc;
Repl > set verbose;
# 配置可重建
Repl > set property recreateSubscription yes;
# 设置变量
Repl > set variable name "source_schema" value "PEHAPP";
Repl > set variable name "target_schema" value "PE";
# 打开链接
Repl > connect server hostname 197.0.1.71 port 10101 username jjking password wjjnag;
Repl > connect datastore name DS_PE;
Repl > connect datastore name DS_BRMS;
Repl > select datastore name DS_PE context source;
Repl > select datastore name DS_BRMS context target;
# 操作
Repl > add subscription name PE_BRMS persistency yes;
Repl > lock subscription;
Repl > add table mapping sourceSchema "%source_schema%" sourceTable "T_JRNL_%TIME%" targetSchema "%target_schema%" targetTable "T_JRNL";
Repl > unlock subscription;
# 关闭链接
Repl > disconnect datastore DS_PE;
Repl > disconnect datastore DS_BRMS;
Repl > disconnect server;

###################   打开预定   #######################
Repl > chcclp session set to cdc;
Repl > set verbose;
# 配置可重建
Repl > set property recreateSubscription yes;
# 打开链接
Repl > connect server hostname 197.0.1.71 port 10101 username jjking password wjjnag;
Repl > connect datastore name DS_PE;
Repl > connect datastore name DS_BRMS;
Repl > select datastore name DS_PE context source;
Repl > select datastore name DS_BRMS context target;
# 操作
Repl > select subscription name PE_BRMS;
Repl > start mirroring method continuous;
Repl > monitor replication filter subscription name PE_BRMS;
# 关闭链接
Repl > disconnect datastore DS_PE;
Repl > disconnect datastore DS_BRMS;
Repl > disconnect server;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值