首页 >网络

高級復制中如何應對主體站點故障

2019-06-03 15:16:41 | 来源: 网络

儿童液体钙什么时候吃
防止老年痴呆症的食物
风热型风湿性关节炎

  在同步复制中

  一旦任意主體站點出現故障,數據庫將會出現問題。

  SQL select * from pt;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 pt values (36,'Oracle','Beijing');insert into pt 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 Y REP_TT N

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

  SQL exec dbms_move_master_databases(gname = 'rep_tt',master_list = '');PL/SQL procedure successfully completed

  此后DML操作可以继续:

  SQL insert into pt values (36,'Oracle','Beijing');1 row insertedSQL COMMIT;Commit completeSQL select gname,dblink,masterdef from dba_repsites;GNAME DBLINK MASTERDEF ------------------------------ ----------------------------------REP_TT Y

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

  SQL exec dbms_op_master_repgroup(gname = 'rep_tt',drop_contents = false,all_sites = false)PL/SQL procedure successfully completed

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

  SQL exec dbms_spend_master_activity(gname = 'rep_tt')PL/SQL procedure successfully completedSQL execute dbms_d_master_database(gname='rep_tt', master='',use_existing_objects=true, copy_rows=false, propagation_mode = 'synchronous');PL/SQL procedure successfully completedSQL execute dbms_sume_master_activity('rep_tt',true);PL/SQL procedure successfully completedSQL

  此时复制恢复正常。

  接下来你需要解决的是数据冲突,可以参考:使用 dbms_rectifier_diff解决高级复制中的数据冲突问题

  查看本文来源

西服套装真的很美优雅知性职场就这样穿
经济发展局司机陪喝酒猝死家属申请工亡认定被驳回
山东水路运量增长铁路旅客下降

猜你喜欢