Updating a Publication v6.2
Existing publications can be updated in the following ways:
- Tables can be added to the publication
- Tables can be removed from the publication
- Filter rules can be updated on publication tables
Adding Tables to a Publication
For a single-master replication system, you can add tables to a publication, even while there are existing subscriptions associated with the publication. Similarly for a multi-master replication system, you can add tables to a publication while there are additional primary nodes in the replication system.
The following are the steps to add tables to an existing publication.
Step 1: Make sure the publication server whose node is the parent of the publication you wish to change is running and has been registered in the xDB Replication Console you are using. See Registering a Publication Server for directions on starting and registering a publication server.
Step 2 (For SMR only): Select the Publication node of the publication to which you wish to add tables.
Step 2 (For MMR only): Select the Publication node under the Publication Database node representing the primary definition node.
Figure 7-68: Selecting a publication to which to add tables
Step 3: Open the Add Tables dialog box in any of the following ways:
- From the Publication menu, choose Update Publication, then Add Tables.
- Click the secondary mouse button on the Publication node, choose Update Publication, and then choose Add Tables.
- Click the primary mouse button on the Add Publication Tables icon.
Figure 7-69: Opening the Add Tables dialog box
Step 4: Fill in the following fields in the Add Tables tab of the Add Tables dialog box:
- Add. Check the boxes next to the table names from the Available Tables list that are to be added to the publication. If the publication is a snapshot-only publication, then views would appear in the Available Tables list as well. The Available Tables list contains only tables and views that are not already members of other publications under the same Publication Database node. Alternatively or in addition, click the
Use Wildcard Selection
button to use wildcard pattern matching for selecting tables to be added to the publication. - Select All. Check this box if you want to include all tables and views in the Available Tables list in the publication.
- Use Wildcard Selection. Click this button to use the wildcard selector to choose tables for the publication. See Selecting Tables with the Wildcard Selector for information on the wildcard selector.
Figure 7-70: Add Tables dialog box
If you wish to omit certain rows of the publication tables or views from being replicated follow the directions in the next step to create a filter, otherwise go on to Step 6.
Step 5 (Optional): If you want to filter the rows of the publication tables or views, click the Table Filters tab. Define filter rules by entering a unique, descriptive filter name and an appropriate SQL WHERE
clause in the Filter dialog box to select the rows you want to replicate.
For a single-master replication system, see Adding a Publication for information on defining table filters on a publication table.
For a multi-master replication system, see Adding a Publication.
Step 6 (For SMR only): Click the Add Tables
button. If Publication Updated Successfully appears, click the OK
button, otherwise investigate the error and make the necessary corrections.
Figure 7-71: Successfully added tables to publication
Step 6 (For MMR only): Click the Add Tables
button. The Data Sync Check
dialog box appears warning you that synchronization replication is performed before the table is added.
If you wish to perform synchronization at some later point in time then add the table, click the No button.
If you wish to proceed, click the Yes
button. If Publication Updated Successfully appears, click the OK
button, otherwise investigate the error and make the necessary corrections.
Figure 7-72: Data Sync Check dialog box
Step 7: The replication tree appears as follows with the newly added table under the Publication node. Click the Refresh
icon. The newly added table appears under the Subscription nodes of a single-master replication system or the additional primary nodes of a multi-master replication system.
Figure 7-73: Publication and subscription with added table
Step 8 (For MMR only): If you want to modify or see the default conflict resolution options assigned to the newly added table, follow the directions in Section Updating the Conflict Resolution Options.
Step 9 (Optional): If you defined table filters on the newly added table, and you wish to use these filters on any subscriptions or primary nodes, you must enable the filters on the table within the desired subscriptions or primary nodes.
For a single-master replication system, see Enabling/Disabling Table Filters on a Subscription <enable_filters_on_subscription> for directions on enabling table filters on a subscription.
For a multi-master replication system, see Enabling/Disabling Table Filters on a Primary node for directions on enabling table filters on a primary node.
Removing Tables from a Publication
You can remove one or more tables from a publication, but only if the following condition is true:
- The tables to be removed are not parent tables referenced by foreign key constraints of child tables that are not selected for removal as well.
Figure 7-74: Entity relationship diagram of tables with foreign key constraints
In the preceding entity relationship diagram, the emp
table has a foreign key constraint referencing the dept table, and the jobhist
table has two foreign key constraints. One constraint references the emp
table and the other references the dept
table.
If all three tables are in the publication, then you can remove the following combinations of tables:
- Remove the
jobhist
table only. - Remove both the
jobhist
table and theemp
table.
Step 1: Make sure the publication server whose node is the parent of the publication you wish to change is running and has been registered in the xDB Replication Console you are using. See Registering a Publication Server for directions on starting and registering a publication server.
Step 2 (For SMR only): Select the Publication node of the publication from which you wish to remove tables.
Step 2 (For MMR only): Select the Publication node under the Publication Database node representing the primary definition node.
Figure 7-75: Selecting a publication from which to remove tables
Step 3: Open the Remove Tables
dialog box in any of the following ways:
- From the
Publication
menu, chooseUpdate Publication
, thenRemove Tables
. - Click the secondary mouse button on the Publication node, choose
Update Publication
, and then chooseRemove Tables
. - Click the primary mouse button on the
Remove Publication Tables
icon.
Figure 7-76: Opening the Remove Tables dialog box by clicking the toolbar icon
Step 4: Use the Remove Tables
dialog box as follows:
Figure 7-77: Remove Tables dialog box
- Remove. Check the boxes next to the table names from the Available Tables list that are to be removed from the publication. If the publication is a snapshot-only publication, then views would appear in the Available Tables list as well. Alternatively or in addition, click the
Use Wildcard Selection
button to use wildcard pattern matching for selecting tables to be removed from the publication. - Use Wildcard Selection. Click this button to use the wildcard selector to choose tables to remove from the publication. See Selecting Tables with the Wildcard Selector for information on the wildcard selector.
Step 5: Click the Remove
button, then click the Yes
button of the confirmation box.
Figure 7-78: Remove Tables confirmation
Step 6: Click the OK
button in response to Tables Removed Successfully.
Figure 7-79: Successfully removed tables from publication
The replication tree appears as follows without the removed table under the Publication node.
Figure 7-80: Publication minus removed table