ACTIVATE CACHE

This command activates the cached table from either the DB2 user table or the persistent cache. After completion, search operations using the stored procedure are possible. See Stored procedure search function for further information.

This command is only available if the index was created with a CACHE TABLE option. See CREATE INDEX for further information.

Authorization

According to the DB2 catalog views, the user ID in this command must have CONTROL privilege on the table for which the full-text index was created.

Command syntax

Read syntax diagramSkip visual syntax diagram>>-ACTIVATE CACHE FOR INDEX--+------------------+--index-name--->
                             '-index-schema-"."-'

>--FOR-TEXT--+----------+--+----------------------+------------><
             '-RECREATE-'  '-|connection-options|-'

connection-options:

|--+--------------------------------------------------------------+--|
   '-CONNECT-TO--database-name--+-------------------------------+-'
                                '-USER--userid--USING--password-'

Command parameters

index-schema
The schema of the text index, as specified in the CREATE INDEX command. If no schema is specified, the user ID of the DB2 connection is used.
index-name
The name of the text index, as specified in the CREATE INDEX command.
RECREATE
Applies only to indexes using a persistent cache; an existing cache is deleted. If an update without activation has completed, the persistent cache is automatically reconstructed from the database.
CONNECT TO database-name
The name of the database that is target for this command. You can omit this parameter, if DB2DBDFT is set and the user is running the command on the server. Note that the user ID must have the required DB2 authorizations.
USER userid USING password
Use a password and userid to connect to the database. If not specified, a connection is attempted from the current user ID without a password.

Usage

You cannot issue the command if one of the following commands is running on the index:

Note

Activation of a cached table may require its recreation from scratch, even though a persistent cache was used. This occurs if an update operation was performed whilst the persistent cache was deactivated.

The amount of memory taken to build the cache is dynamically calculated from the current number of documents and the size of the result columns. Use the PCTFREE value to increase the calculated minimal amount of memory by a factor of 100/(100-PCTFREE). The PCTFREE value is specified in the CREATE or ALTER INDEX command.

Thereby, PCTFREE describes the percentage of the allocated cache that is reserved for insert operations while the cache is activated. Note that for each ACTIVATE CACHE command, the actual memory size is re-evaluated.

Changes to the file system
Files for implementing the persistent cache are created.