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.
Procedure
To manually enable shadow table support and query routing:
- Log in to the DB2 server as db2-cdc-user.
- Connect to db2-database-name as
shown in the following example:
db2 CONNECT TO db2-database-name
- Enable intrapartition parallelism as shown in the following
example:
db2 "CALL ADMIN_SET_INTRA_PARALLEL('YES')"
db2 SET CURRENT DEGREE 'ANY'
- 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
- Issue your queries that reference source tables that have
shadow tables.