Before creating a text index on a nickname using a replication capture
table, you must perform the following steps:
- Set up the DB2 federated database with all server definitions and wrapper
definitions.
- Set up the replication control tables and the capture programs at the
remote server. This is where the source table for the nickname
resides. See Chapter 2, "Setting up for Replication" in the DB2
Replication Guide and Reference, Version 8. If DB2 does not
automatically create nicknames, you must create nicknames in the federated DB2
database using one schema name for the following tables:
- IBMSNAP_SIGNAL
- IBMSNAP_PRUNE_SET
- IBMSNAP_PRUNCNTL
- IBMSNAP_REGISTER
- IBMSNAP_REG_SYNC (Non-DB2 remote sources only)
After this step, nicknames for the replication control tables are available
as nicknames under one "capture control schema" on the federated DB2
database. This schema name is important for the DB2TEXT CREATE INDEX
command.
- Register the table as a replication source. For details, see
Chapter 3, "Registering tables and views as replication sources" in the
DB2 Replication Guide and Reference, Version 8. For
restrictions on registering the nickname the index is to be created on, see
page ***.
- If DB2 does not automatically create a nickname in the registration step,
create a nickname for the replication capture table in the federated
database. The replication capture table can either be a Change Data
(CD) table or a Consistent Change Data (CCD) table. This nickname is a
parameter for the DB2TEXT CREATE INDEX command.
Note that the column names IBMSNAP_OPERATION, IBMSNAP_COMMITSEQ,
IBMSNAP_INTENTSEQ, and the names of the primary key columns must not be
changed.
- If you are using DB2 replication source, ensure that your capture program
is running. We strongly recommend not to use a cold start for the
capture program. If a cold start is used, all rows in the
IBMSNAP_SIGNAL table for APPLY_QUAL LIKE 'NSE%' have to be
reinserted. In the following SQL statement you can see how this is
done:
INSERT INTO <capture control schema>.IBMSNAP_SIGNAL
SELECT CURRENT TIMESTAMP, 'CMD', 'CAPSTART', MAP_ID, 'P'
FROM <capture control schema>.IBMSNAP_PRUNCNTL
WHERE APPLY_QUAL LIKE 'NSE%';
- You can use the following example to create a text index on a nickname
using replication:
DB2TEXT
CREATE INDEX <indexname> FOR TEXT ON <nickname> (< text column>)
REPLICATION CAPTURE TABLE <capture nickname>
CONTROL TABLE SCHEMA <capture control schema>