Oracle7 Server Distributed Systems Volume II: Replicated Data
Creating a Multi-Master Replicated Environment
To create a multi-master replicated environment, you (the replication administrator) must use the procedures in the DBMS_REPCAT package to complete the following steps:
- First, you must select which of the sites in your new multi-master replicated environment will be the master definition site.
This site is used to create all other master sites for a given replicated object group. When selecting a master definition site, you should choose the site that is most likely to be available at all times. You can change master definition sites if necessary.
- Next, make sure that you have created all of the necessary links between the sites that you have selected to participate in your replicated environment. You must also have granted the necessary privileges to the replication administrator and surrogate replication administrator. Only the replication administrator can create a replicated environment.
- To create your replicated environment, you must begin by creating an empty master replicated object group at the site you have selected to be the master definition site. Create this replicated object group by calling DBMS_REPCAT.CREATE_MASTER_REPGROUP.
- For each object, such as a table or procedure, that you want to add to the replicated object group, you must perform the following steps:
- First, add the object to the replicated object group by calling the CREATE_MASTER_REPOBJECT procedure.
- If the object is a table that requires conflict resolution routines, call the appropriate ADD_conflicttype_RESOLUTION procedures. These procedure are described in Chapter 6.
- For each object that requires replication support, call GENERATE_REPLICATION_SUPPORT to create the necessary triggers, packages, and procedures. The owner of the replicated object must have the EXECUTE privilege on the DBMS_DEFER package in order for Oracle to create these objects successfully.
Note: If you will be adding additional master sites to your replicated environment, you may prefer to defer generating replication support until after these sites have been added. However, because the tables will be copied to the new master sites without the supporting triggers and packages any changes that occur before you generate replication support will not be replicated.
You must either call GENERATE_REPLICATION_SUPPORT for each object before adding any master sites and again after adding any master sites, or you must ensure that no updates are made to the tables at any of the master sites until after you have added all master sites and then call GENERATE_REPLICATION_SUPPORT.
- For each additional master site that you want to include in your replicated environment, call ADD_MASTER_DATABASE.
- For sites in your replication environment that are propagating their changes asynchronously, you must schedule this propagation by calling DBMS_DEFER_SYS.SCHEDULE_EXECUTION.
- Because all activity at the master definition site was
suspended when you called CREATE_MASTER_REPGROUP, you must now call RESUME_MASTER_ACTIVITY to restore normal activity.
Attention: You must generate replication support before attempting to update any tables you have registered as replicated objects. If you are unsure whether replication support has been generated for a particular object, see the RepGenerated view (see ).