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