Performing Investigation and Clean-up Tasks for Full-Text Catalogs
SQL Server 2005
In this example, you perform typical investigation and clean-up tasks. Assume that you are connected to the AdventureWorks database, the full-text service has been started, you are working with the Document table, and that AdvDocFTCat is the full-text catalog associated with the Document table.
-
Obtain a list of all the full-text catalogs linked to the AdventureWorks database by running this query:
Because the AdventureWorks database is the current database, this returns metadata for all the full-text catalogs linked to the AdventureWorks database.SELECT name FROM sys.fulltext_catalogs; GO
For details on the metadata returned, see sys.fulltext_catalogs (Transact-SQL).
-
Obtain a list of all the tables in the database that have been enabled for full-text processing by executing this stored procedure:
This stored procedure returns the following metadata for each table:sp_help_fulltext_tables; GO
-
The schema associated with the table
-
The name of the table
-
The name of the index that is used to impose a unique constraint on the full-text key column
-
The integer identifier of the column used as the table's full-text key
-
The full-text status of the table
-
The name of the full-text catalog of the table
For more information, see sp_help_fulltext_tables (Transact-SQL)
-
The schema associated with the table
-
Obtain a list of all the columns in the database that have been enabled for full-text processing by executing this stored procedure:
This stored procedure returns the following metadata about each column:sp_help_fulltext_columns; GO
-
The schema associated with the table
-
The name and integer identifier of the table
-
The name and integer identifier of the column that is full-text enabled
-
The name and integer identifier of the column in a full-text indexed table that specifies the document type of the full-text indexed column
-
The language used for the full-text search of the column.
For more information, see sp_help_fulltext_columns (Transact-SQL).
-
The schema associated with the table
-
Unregister the Document table for full-text processing by running the following statement:
For more information, see DROP FULLTEXT INDEX (Transact-SQL).DROP FULLTEXT INDEX ON Production.Document; GO
This drops the metadata about full-text indexing for the Document table. The existing full-text index remains in place until the next full population or until the full-text catalog is dropped. However, it remains unused.
-
Drop the AdvDocFTCat full-text catalog from the file system and its metadata from the catalog views by running the following statement:
For more information, see DROP FULLTEXT CATALOG (Transact-SQL).DROP FULLTEXT CATALOG AdvDocFTCat; GO
You must complete Step 4 before a full-text catalog can be dropped because its full-text catalog metadata must be updated to remove all full-text indexes.
There is at least one full-text catalog in the file system that no longer has corresponding Microsoft SQL Server metadata. The usual cause of this is the removal of a database.
-
Rebuild, but do not repopulate, the AdvDocFTCat full-text catalog by executing this stored procedure:
For more information, see sp_fulltext_catalog (Transact-SQL).EXECUTE sp_fulltext_catalog 'AdvDocFTCat', 'Rebuild'; GO
The sp_fulltext_database stored procedure with the ENABLE option may be used to rebuild all known full-text catalogs.
-
Start a full population of the AdvDocFTCat full-text catalog by executing this stored procedure:
EXECUTE sp_fulltext_catalog 'AdvDocFTCat', 'start_full'; GO
Note: Full-text catalogs can be created, dropped, and modified as needed; however, avoid making schema changes on multiple catalogs at the same time.
Other Resources
sp_help_fulltext_catalogs (Transact-SQL)sp_help_fulltext_tables (Transact-SQL)
