DB2 10.5 for Linux, UNIX, and Windows

Manually enabling shadow table support and query routing

You can manually enable shadow table support and query routing for a database connection by enabling intrapartition parallelism and directing the optimizer to consider shadow tables for query optimization when the replication latency is within user-defined limit.

Before you begin

Procedure

To manually enable shadow table support and query routing:

  1. Log in to the DB2 server as db2-cdc-user.
  2. Connect to db2-database-name as shown in the following example:
    db2 CONNECT TO db2-database-name
  3. Enable intrapartition parallelism as shown in the following example:
    db2 "CALL ADMIN_SET_INTRA_PARALLEL('YES')"
    db2 SET CURRENT DEGREE 'ANY'
  4. Set database connection properties to direct the optimizer to consider shadow tables for query optimization The CURRENT REFRESH AGE special register must be set to a duration other than zero or ANY. For example, if you specify refresh-age as500, the refresh age is set to 5 minutes and 0 seconds. The following example shows the statements to set these properties:
    db2 SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION REPLICATION
    db2 SET CURRENT REFRESH AGE refresh-age
  5. Issue your queries that reference source tables that have shadow tables.