DB2 10.5 for Linux, UNIX, and Windows

Sample: Scheduling a DB2 Text Search index update

Schedule a DB2® Text Search index update and verify execution result.

Before you begin

Complete the following tasks before you start any scheduler jobs:
  1. Set the ATS_ENABLE registry variable
  2. Check that the SYSTOOLSPACE table space exists
  3. Ensure that the database is activated
For details about the prerequisites for scheduling a DB2 Text Search index update, see the topic about setting up the administrative task scheduler.

About this task

Create a scheduler task using the DB2 Scheduler and execute the task in the specified frequency.

Procedure

  1. Create a text search index and specify the update frequency.
    db2ts "create index simix for text on simple(comment) 
    update frequency (D(*) H(*) M(30))"
  2. Connect to your database.
    db2 connect to testdb
  3. Find the scheduler task name
    db2 "select indexidentifier from sysibmts.tsindexes"
    For the following steps, lets assume the numeric part of the index identifier is 12345. So, the scheduler name is TSSCH_12345.
  4. Find the scheduler task in the SYSTOOLS.ADMIN_TASK_LIST administrative view.
    db2 "select * from systools.admin_task_list"
  5. Verify text index update status.
    db2 "select * from sysibmts.tsevent_123456"
  6. If no message is shown, but data was available for an update, verify that the scheduler task was started.
    db2 "select * from systools.admin_task_status"
    Otherwise, use the scheduler task name to restrict the SELECT operation to the data belonging to the new scheduler task for the example shown previously:
    db2 "select * from systools.admin_task_status 
    where name = 'TSSCH_12345'"