Oracle7 Server Distributed Systems Volume II: Replicated Data
Understanding Column Groups
The symmetric replication facility uses a column group to detect and resolve update conflicts. A column group links a collection of columns in a table to a single "logical column". A column group can consist of a single column, any number of columns, or all of the columns in a table. Each column, however, can belong to only one column group.
The conflict detection mechanism detects update conflict column group by column group, so all columns must be a part of some column group.
You do not have to assign all of the columns in a table to a column group. However, you can only designate a conflict resolution method for the columns you assign to a column group.
Shadow Column Groups
Any column that you do not assign to a column group is automatically assigned to a "shadow" column group for conflict detection. A shadow column group is not visible to the user. You cannot assign a conflict resolution method to the columns in a shadow group. Do not use a shadow group for columns if you expect conflicts to occur on those columns.
Designating a Conflict Resolution Method
Having column groups allows you to designate different methods of resolving conflicts for different types of data. For example, numeric data is often suited for an arithmetical resolution method, and character data is often suited for a timestamp resolution method.
Data Convergence vs Data Integrity
Oracle evaluates each column group individually, so some portions of a row can be updated using the data from the originating site, while other portions can maintain the values of the data at the destination site. When you use multiple column groups, a conflict resolution mechanism can result in data convergence (all sites having the same values for a given row) without necessarily resulting in data integrity (data convergence on the appropriate value). For example, if the zip code column uses the latest timestamp resolution method while the city column uses the site priority resolution method, all sites could converge on a zip code that does match the city.
Attention: If two or more columns in a table must remain consistent with respect to each other, place these columns within the same column group.
Detecting Update Conflicts in a Column Group
When examining a row to determine if an update conflict has occurred, the replication facility uses the following algorithm:
- Starting with the first column group, examine each field to determine if it has changed and, if so, if there is a conflict between the old, new, and current values.
- If no conflict occurred, continue with the next column group. If a conflict occurred, call the conflict resolution routine with the lowest assigned sequence number for that column group.
- If the conflict resolution routine successfully resolves the conflict, hold the appropriate values for the columns pending determination of status.
- If the routine cannot resolve the conflict, the replication facility continues with the next priority routine in the sequence you assign until the conflict is resolved or no more routines are available.
- After evaluating all column groups (including the shadow column group) and successfully resolving any errors, the symmetric replication facility stores the new values for the columns.
- If the replication facility is unable to resolve the conflict for a column group (including the shadow column group, which has no designated conflict resolution method), it logs an error in the DefError view and does not change the local row.