8. Using Advanced Features : Lookup Tables : How You Set Up Horizontal Partitioning : How You Create a Horizontal Partitioning Lookup Table
 
Share this page                  
How You Create a Horizontal Partitioning Lookup Table
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:
1. Create the horizontal partitioning lookup table with two types of columns:
Columns with the same name and data type as the columns in the base table that determines the partitioning. You can have one column of this sort, for example, a location column; or you can have several columns, for example, group code, division code, and region code.
A column called cdds_no, with a data type of smallint not null, that contains the CDDS number that corresponds to the partitioning value
2. Populate the horizontal partitioning lookup table using Visual DBA’s SQL Scratchpad or SQL Assistant, the SQL Terminal Monitor, or Query-By-Forms; enter the partitioning values and their corresponding CDDS numbers. You do not need to add a row for the base CDDS if the base values do not need to be replicated elsewhere.
3. Once the table is populated in one database, use copydb to copy the lookup table to the other targets. Each lookup table must be exactly the same in all databases.
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.