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
- Perform these steps to verify the collections and to stop the text search.
- Verify that the collection location is empty.
db2 "select indschema, indname, collectiondirectory, collectionnameprefix from sysibmts.tsindexes"
- Take note of the
collectionnameprefixes
that do not have directory
information.
- Stop text search by running the following command:
Changing the default location for collections
- This change affects all existing collections that do not show an explicit collection
location. These collections must therefore be moved to the new location.
- 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/
- 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.
- Based on the list of
collectionnameprefixes
obtained earlier, move
the collections to the new location.
- Start the text search by running the following command:
Setting a location while creating a new index
- Follow these steps to set a new location while creating a new index
Note: This does not affect the location of any other index.
- 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>"
- Run the following command to list the custom collection-directory:
db2 "select indschema, indname, collectiondirectory, collectionnameprefix from sysibmts.tsindexes"