Column Groups and Priority Groups
Column groups and priority groups provide interfaces to a variety of built-in conflict resolution techniques and the easiest way to configure your application to resolve conflicts automatically. Let’s look at them one at a time.
Column Groups
A column group is a set of one or more columns associated with a single conflict resolution method. A column cannot belong to more than one column group, and columns that are not explicitly assigned to a column group are members of a shadow column group, which Oracle creates by default and which uses the default conflict resolution methods.
For example, suppose that you want to define a column group for the EMPLOYEES table described in the following table:
Column Name | Type |
---|---|
EMPLOYEE_ID | NUMBER(10) |
LAST_NAME | VARCHAR2(30) |
FIRST_NAME | VARCHAR2(20) |
SOCIAL_SECURITY_NO | VARCHAR2(11) |
MARITAL_STATUS | VARCHAR2(1) |
HOME_PHONE | VARCHAR2(12) |
PERS_GLOBAL_NAME | VARCHAR2(30) |
PERS_TIMESTAMP | DATE |
MANAGER | NUMBER(3) |
DEPT | NUMBER(3) |
SAL_GRADE | NUMBER(3) |
SENIORITY | VARCHAR2(10) |
PAYROLL_GLOBAL_NAME | VARCHAR2(30) |
PAYROLL_TIMESTAMP | DATE |
Use the procedure DBMS_REPCAT.MAKE_COLUMN_GROUP to define a column group for fields that the personnel site maintains (i.e., LAST_NAME, FIRST_NAME, SOCIAL_SECURITY_NO, MARITAL_STATUS, HOME_PHONE). The application records information about changes to these fields in PERS_GLOBAL_NAME and PERS_TIMESTAMP.
EXECUTE dbms_repcat.make_column_group( - gname => 'HR', - oname => 'EMPLOYEES', - column_group => 'CG_EMP_PERSONNEL', - list_of_column_names => ...
Get Oracle Distributed Systems now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.