高級(jí)復(fù)制中如何應(yīng)對主體站點(diǎn)故障作者:eygle出處:http://blog.eygle.com日期:february 18, 2005
« 在高級(jí)復(fù)制中如何切換主體定義站點(diǎn) | blog首頁 | 自己動(dòng)手,豐衣足食 »
在同步復(fù)制中
一旦任意主體站點(diǎn)出現(xiàn)故障,數(shù)據(jù)庫將會(huì)出現(xiàn)問題。
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>
此時(shí)dml操作不能進(jìn)行
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
簡單的,我們可以移除出問題的主體站點(diǎn)
sql> exec dbms_repcat.remove_master_databases(gname => 'rep_tt',master_list => 'testora9.hurray.com.cn');pl/sql procedure successfully completed
此后dml操作可以繼續(xù):
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
如果故障站點(diǎn)修復(fù)之后,需要重新加入復(fù)制組,可以先在故障站點(diǎn)刪除復(fù)制組:
sql> exec dbms_repcat.drop_master_repgroup(gname => 'rep_tt',drop_contents => false,all_sites => false)pl/sql procedure successfully completed
然后在主體定義站點(diǎn)重新加入該主體站點(diǎn):
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>
此時(shí)復(fù)制恢復(fù)正常。
接下來你需要解決的是數(shù)據(jù)沖突,可以參考:使用 dbms_rectifier_diff解決高級(jí)復(fù)制中的數(shù)據(jù)沖突問題