Previous |
Next |
Asynchronous multimaster and updatable materialized view replication environments must address the possibility of replication conflicts that may occur when, for example, two transactions originating from different sites update the same row at nearly the same time. When data conflicts occur, you need a mechanism to ensure that the conflict is resolved in accordance with your business rules and to ensure that the data converges correctly at all sites.
In addition to logging any conflicts that may occur in your replicated environment, Advanced Replication offers a variety of built-in conflict resolution methods that enable you to define a conflict resolution system for your database that resolves conflicts in accordance with your business rules. If you have a unique situation that Oracle's built-in conflict resolution methods cannot resolve, you have the option of building and using your own conflict resolution methods.
Conflict resolution operates at the column group level. Column groups provide the organization mechanism to group all columns that are involved in a conflict resolution method. If a conflict occurs in one of the columns of the group, the remainder of the group's columns may be used to resolve the conflict. For example, if a column group for a table contains a MIN_PRICE
, LIST_PRICE
, COST_PRICE
, and TIMESTAMP
field and a conflict arises for the LIST_PRICE
field, the TIMESTAMP
field may be used to resolve the conflict, assuming that a timestamp conflict resolution routine has been used.
Three types of conflicts are possible: update, uniqueness, and delete. The following list summarizes each type of conflict; each conflict occurs when the conflicting actions occur within the same interval:
Update Conflict: An update conflict occurs when the replication of an update to a row conflicts with another update to the same row. Update conflicts can happen when two transactions, originating from different sites, update the same row at nearly the same time.
Uniqueness Conflict: A uniqueness conflict occurs when the replication of a row attempts to violate entity integrity, such as a PRIMARY KEY
or UNIQUE
constraint. For example, consider what happens when two transactions originate from two different sites each inserting a row into a respective table replica with the same primary key value. In this case, replication of the transactions causes a uniqueness conflict.
Delete Conflict: A delete conflict occurs when two transactions originate from different sites, with one transaction deleting a row and another transaction updating or deleting the same row, because in this case the row does not exist to be either updated or deleted.
See the Oracle Database Advanced Replication for detailed information about these methods.
This topic comprises the following subtopics: