Timesten11重建复制器

本文详细介绍了在数据库复制器重建后,如何通过一系列操作确保主备机数据的一致性,包括停止复制进程、删除复制器、创建新的复制定义、启动复制进程及数据校验等关键步骤。

重建完复制器后,需要重建备机,因为在重建复制器的过程中表与复制器解除关系,重建的这段时间内日志可能会丢失,如果不重建备机的话,主备机的数据可能会不一致。

The steps are as follows(two nodes for example:node1&node2. node2 need recreate):

  • On node1,stop the replication process.

    $ttadmin -reppolicy manual ocs
    $ttadmin -repstop ocs

  • On node1,drop the replication,call ttckpt to flush the data from the memory to disk.

    $ttisql DSN
    command>drop replication REP;
    command> call ttckpt;

  • Destroy the tt on node2.

    $ttadmin -reppolicy manual DSN
    $ttadmin -rampolicy inuse DSN
    $ttadmin -repstop DSN
    $ttdaemonadmin -stop -force
    $ttdaemonadmin -start
    $ttdestroy DSN

  • On node1, create the replication definition(create replication …)
  • On node1,start the replication process

$ttadmin -repstart ocs
$ttadmin -reppolicy always ocs

  • On node1,duplicate the datastore from node1 to node2,(nohup mode avoid the window disconnected in an accident):

$ttrepadmin -duplicate -from ocs -host OCS1 -setmasterrepstart -uid ocs -pwd ocs -localhost OCS2 ocs

  • On node2,start the replication

$ttadmin -repstart DSN
$ttadmin -reppolicy always DSN

  • Recreate all the sequence of node2,use the backup definition of node2 before ttdestroy to avoid the sequence repetition value between two nodes.(the examples as belows):

Drop sequence TEST_ID_SEQ;
create sequence TEST_ID_SEQ
increment by 4
minvalue 1
maxvalue 9223372036854775807
start with 11033758037
cache 20;

  • Check the replication status:(compare same table data amount between node1 and node2,check ttlog )

$ttstatus
$ttRepAdmin -dsn ocs -receiver -list
Command>>call ttlogholds;
Command>>select count(*) from table;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值