Changing the location of a Db2 Text Search collection

You might need to change the location of a collection, for example, for computer and disk administration or maintenance purposes.

Before you begin

You can change the location of a text search collection for collections that have their location in the SYSIBMTS.TSINDEXES table empty.

Procedure

  1. Perform these steps to verify the collections and to stop the text search.
    1. Verify that the collection location is empty.
      db2 "select indschema, indname, collectiondirectory, collectionnameprefix from sysibmts.tsindexes"
    2. Take note of the collectionnameprefixes that do not have directory information.
    3. Stop text search by running the following command:
      db2ts stop for text

Changing the default location for collections

  1. This change affects all existing collections that do not show an explicit collection location. These collections must therefore be moved to the new location.
    1. Go to <sqllib-directory> and run the following command, filling in your information where appropriate:
      <sqllib-directory>/db2tss/config /configTool.sh configureParams -defaultDataDirectory <location of choice> -configPath <sqllib-directory>/db2tss/config/
    2. Verify the success of the previous command by running the following command:
      <sqllib-directory>/db2tss/config/configTool.sh printAll -configPath <sqllib-directory>/db2tss/config>

      The defaultDataDirectory parameter will contain the updated value.

    3. Based on the list of collectionnameprefixes obtained earlier, move the collections to the new location.
    4. Start the text search by running the following command:
      db2ts start for text

Setting a location while creating a new index

  1. Follow these steps to set a new location while creating a new index
    Note: This does not affect the location of any other index.
    1. Create the new index using the following command, filling in your information where appropriate:
      db2ts "CREATE INDEX <indexname> FOR TEXT ON <table-name>(<column-name>) collection directory <custom-collection-directory>"
    2. Run the following command to list the custom collection-directory:
      db2 "select indschema, indname, collectiondirectory, collectionnameprefix from sysibmts.tsindexes"