This chapter describes advanced Replicators that are available using Visual DBA or the Replicator Manager, including the creation of lookup tables. The chapter also includes a discussion of deadlocks.
You can create lookup tables to establish:
A horizontally partitioned table uses a base CDDS, which contains the whole replicated base table, and partitioned CDDSs that each contain only those rows that are associated with the particular value assigned to that CDDS in the lookup table.
To set up horizontal partitioning, you must complete two main tasks:
To set up horizontal partitioning, you must create and populate the lookup table in every participating database.
To create and populate a horizontal partitioning lookup table, follow these steps:
Alternatively, repeat Steps 1 and 2 for every database that participates in the horizontal replication.
Note: If you do not have a populated lookup table in every database that participates in horizontal partitioning, horizontal partitioning does not work properly.
After you create and populate the lookup table in every participating database, you must implement horizontal partitioning using one of the appropriate Ingres tools.
To implement horizontal partitioning using Visual DBA, follow these steps:
If the base CDDS is present only in a single database, it does not need any propagation paths.
The lookup table appears in the Tables list because it is a table in the database. However, it need not be registered for replication.
Note: The lookup tables are expected to be static; ordinarily they are not replicated. If desired, they can be registered. However, keep in mind that changes to the lookup table must be propagated ahead of rows in the base table or the partitioning scheme breaks down.

After you create and populate the lookup table in every participating database, you must implement horizontal partitioning using one of the appropriate Ingres tools.
To implement horizontal partitioning using Replicator Manager, follow these steps:
For more information, see Add a Database to the Database Summary List.
For more information, see Add a CDDS.
For more information, see Add Database and Server Information.
For more information, see Add Propagation Paths.
For more information, see Register Tables.
The lookup table also appears in the Table Registration Summary window because it is a table in the database. However, it need not be registered for replication.
Note: The lookup tables are expected to be static; ordinarily they are not replicated. If desired, they can be registered. However, keep in mind that changes to the lookup table must be propagated ahead of rows in the base table or the partitioning scheme breaks down.
For instructions, see Assign a Table to a Different CDDS.
For more information, see Assign Lookup Tables.
The R.E.P. company is partitioning its warehouse information: the New York location must contain information for all warehouses, and the San Francisco and London locations must only contain information for their respective sites. This example is also discussed in CDDS Example: Horizontal Partitioning.
The whse_inventory table contains the location column used to determine horizontal partitioning. The new CDDSs and their contents are illustrated in the following figure:

The CDDS Diagrams portion of the CDDS Worksheet is illustrated in the following figure:

The R.E.P. DBA creates, populates, and distributes the lookup table whse_inventory_cdds.
create table whse_inventory_cdds (
location char(3) not null,
cdds_no smallint not null)
The location column contains the location values that are used to partition the data.
location cdds_no
LON 3
SFO 4
No value is added for NYC because the New York data is not replicated to other sites.
The R.E.P. DBA implements horizontal partitioning by completing the following tasks on nyc::hq:
The DBA uses the default collision and error modes.
Note: If you are using Visual DBA, Step 4 is performed before Step 3.
CDDS 2 does not need any propagation paths because the NYC data is not replicated to any other locations.
The Database Summary portion of the CDDS Worksheet for each CDDS is as follows:
CDDS No. Database No./Name Target Type Server Number
2 (NYC) 10, nyc::hq full peer 11
3 (LON) 10, nyc::hq full peer 11
20, lon::europe full peer 12
4 (SFO) 10, nyc::hq full peer
11, sfo::west full peer
The Propagation Paths portion of the CDDS Worksheet for CDDS 3 is as follows:
Originator Local Target Comment
10 (nyc::hq) 10 (nyc::hq) 20 (lon::europe) NYC to LON
20 (lon::europe) 20 (lon::europe) 10 (nyc::hq) LON to NYC
The Propagation Paths portion of the CDDS Worksheet for CDDS 4 is as follows:
Originator Local Target Comment
10 (nyc::hq) 10 (nyc::hq) 11 (sfo::west) NYC to SFO
11 (sfo::west) 11 (sfo::west) 10 (nyc::hq) SFO to NYC
Replicator Manager: The DBA specifies the whse_inventory_cdds lookup table to whse_inventory in the Table Registration Details window by choosing the ListChoices option while the cursor is in the Horizontal Partition Lookup field.
Visual DBA: The DBA specifies the whse_inventory_cdds lookup table to whse_inventory in the CDDS Definition window by typing the lookup table name into the CDDS Lookup field.
In CDDSs that use PriorityResolution collision mode, collisions are resolved by comparing the database numbers of the colliding databases; the database with the lowest number prevails. However, you can alter the priority of individual rows by creating and assigning a priority collision resolution lookup table that contains priority numbers; the row with the highest number prevails.
A priority collision resolution lookup table allows you to specify priority according to data values in a registered table. Follow these steps to create this table based on data values:
Note: If many levels of priority are required, it is useful to establish a primary key on those lookup columns.
Alternatively, repeat the preceding steps for every database that contains the CDDS to have priority collision resolution.
The lookup table appears in the Tables list in Visual DBA or in the Table Registration Summary window in Replicator Manager because it is a table in the database. However, it need not be registered for replication because it is not replicated.
Visual DBA: Specify the priority collision resolution lookup table to the base table in the CDDS Definition dialog. For more information, see the online help topics, Altering a CDDS and CDDS Definition dialog box.
Replicator Manager: Specify the priority collision resolution lookup table to the base table in the Table Registration Detail window. For instructions, see Assign Lookup Tables.
The R.E.P. company wants to use PriorityResolution collision mode on their Inventory CDDS. The Inventory CDDS can be updated from each of the three full peer databases: New York (database 10), San Francisco (database 11), and London (database 20). Without a priority collision resolution lookup table, New York has priority over San Francisco and London, and San Francisco has priority over London. R.E.P. decides, however, that London must have a higher priority than San Francisco.
The Inventory CDDS has a table called book_inventory, which has a prim_whse_location column that indicates location of the inventory item and, presumably, the database from which its row originated.
The R.E.P. DBA implements priority collision resolution by completing the following tasks:
Create the table by entering the following SQL statement with SQL Scratchpad in Visual DBA or, in Replicator Manager, with SQL/ISQL from the command line:
create table book_inventory_priority (
prim_whse_location char(3) not null,
dd_priority smallint not null)
prim_whse_location dd_priority
NYC 10
LON 8
SFO 5
Visual DBA: The DBA specifies the book_inventory_priority lookup table to book_inventory in the Priority Lookup Table field in the CDDS Definition window.
Replicator Manager: The DBA specifies the book_inventory_priority lookup table to book_inventory in the Table Registration Details window by choosing the ListChoices option while the cursor is in the Priority Collision Resolution Lookup field.