首页 > 开发 > 综合 > 正文

高级复制中如何应对主体站点故障

2024-07-21 02:05:50
字体:
来源:转载
供稿:网友


高级复制中如何应对主体站点故障作者:eygle出处:http://blog.eygle.com日期:february 18, 2005
« 在高级复制中如何切换主体定义站点 | blog首页 | 自己动手,丰衣足食 »
在同步复制中
一旦任意主体站点出现故障,数据库将会出现问题。


sql> select * from scott.dept;deptno dname loc------ -------------- ------------- 10 accounting new york 20 research dallas 30 sales chicago 40 operations boston 33 oracle beijing 35 oracle beijing6 rows selectedsql>

此时dml操作不能进行

sql> insert into scott.dept values (36,'oracle','beijing');insert into scott.dept values (36,'oracle','beijing')ora-02068: following severe error from testora9ora-03113: end-of-file on communication channelora-02068: following severe error from testora9ora-03113: end-of-file on communication channelsql> select gname,dblink,masterdef from dba_repsites;gname dblink masterdef ------------------------------ ----------------------------------rep_tt conner.hurray.com.cn y rep_tt testora9.hurray.com.cn n

简单的,我们可以移除出问题的主体站点

sql> exec dbms_repcat.remove_master_databases(gname => 'rep_tt',master_list => 'testora9.hurray.com.cn');pl/sql procedure successfully completed

此后dml操作可以继续:

sql> insert into scott.dept values (36,'oracle','beijing');1 row insertedsql> commit;commit completesql> select gname,dblink,masterdef from dba_repsites;gname dblink masterdef ------------------------------ ----------------------------------rep_tt conner.hurray.com.cn y

如果故障站点修复之后,需要重新加入复制组,可以先在故障站点删除复制组:

sql> exec dbms_repcat.drop_master_repgroup(gname => 'rep_tt',drop_contents => false,all_sites => false)pl/sql procedure successfully completed

然后在主体定义站点重新加入该主体站点:

sql> exec dbms_repcat.suspend_master_activity(gname => 'rep_tt')pl/sql procedure successfully completedsql> execute dbms_repcat.add_master_database(gname=>'rep_tt', master=>'testora9.hurray.com.cn',use_existing_objects=>true, copy_rows=>false, propagation_mode => 'synchronous');pl/sql procedure successfully completedsql> execute dbms_repcat.resume_master_activity('rep_tt',true);pl/sql procedure successfully completedsql>

此时复制恢复正常。
接下来你需要解决的是数据冲突,可以参考:使用 dbms_rectifier_diff解决高级复制中的数据冲突问题
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表