How to deal with the main site fault in advanced replication
Author: eygle
Source: http://blog.eygle.com
Date: February 18, 2005
«How to switch the main definition site in advanced copy | Blog Home | Do your own
In sync copy
Once any subject site fails, the database will have problems.
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 beijing
6 rows selected
SQL>
At this time, the DML operation cannot be performed.
SQL> INSERT INTO Scott.dept Values (36, 'Oracle');
INSERT INTO Scott.dept Values (36, 'Oracle', 'Beijing')
ORA-02068: FOLLOWING Severe Error from testora9
ORA-03113: End-of-file on Communication Channel
ORA-02068: FOLLOWING Severe Error from testora9
ORA-03113: End-of-file on Communication Channel
SQL> SELECT GNAME, DBLINK, MASTERDEF from DBA_REPSITES
GNAME DBLINK MASTERDEF
------------------------------------------------------------------------------------------------------------------------------------------------------------------ ----------------
Rep_tt connection.hurray.com.cn y
Rep_tt testora9.hurray.com.cn n
Simple, we can remove the main site of the problem
SQL> EXEC DBMS_REPCAT.REMOVE_MASTER_DATABASES (GNAME => 'rep_tt', master_list => 'testora9.hurray.com.cn');
PL / SQL Procedure SuccessFully Completed
The DML operation can continue later:
SQL> INSERT INTO Scott.dept Values (36, 'Oracle');
1 row inserted
SQL> commit;
Commit completion
SQL> SELECT GNAME, DBLINK, MASTERDEF from DBA_REPSITES
GNAME DBLINK MASTERDEF
------------------------------------------------------------------------------------------------------------------------------------------------------------------ ----------------
Rep_tt connection.hurray.com.cn y
If the fault site is repaired, you need to re-join the replication group, you can remove the replication group in the fault site: SQL> EXEC DBMS_REPCAT.DROP_MASTER_REPGROUP (gname => 'rep_tt', Drop_Contents => false, all_sites => false)
PL / SQL Procedure SuccessFully Completed
Then re-join the main body site at the main definition site:
SQL> EXEC DBMS_REPCAT.SUSPEND_MASTER_AACTIVITY (GNAME => 'rep_tt')
PL / SQL Procedure SuccessFully Completed
SQL> 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 Completed
SQL> EXECUTE DBMS_REPCAT.RESUME_MASTER_ACTIVITY ('rep_tt', true);
PL / SQL Procedure SuccessFully Completed
SQL>
The copy is restored to normal.
Next you need to solve the data conflict, you can refer to:
Solve data conflicts in advanced replication using DBMS_Rectifier_Diff