Backing up and restoring text search indexes

Procedure

  • To back up a database with Db2® Text Search indexes:
    1. Get a current list of text index locations for Db2 Text Search indexes.
      db2 "select indschema, indname, collectiondirectory, collectionnameprefix 
      from sysibmts.tsindexes"
      If a value for collectiondirectory is not specified, then locations are set using the defaultDataDir parameter.
    2. Ensure that no Db2 Text Search administrative command is running.
    3. Stop the Db2 Text Search services.
      db2ts stop for text
    4. Back up the database.
      Issue the following command:
      db2 backup database db_name
    5. Back up the text search configurations, index directories and subdirectories.
    6. Restart Db2 Text Search services.
  • To restore a database with Db2 Text Search indexes:
    1. Make sure that no Db2 Text Search administrative command is running.
    2. Stop the Db2 Text Search services.
      db2ts stop for text
    3. Restore the database.
      Issue the following command:
      db2 restore database db_name
    4. Restore the backup of text search configuration and index locations to the same path as before.
    5. Restart Db2 Text Search services.
      db2ts start for text