我使用這些查詢來監視我的全文索引的狀態。 在第一個查詢中,PopulateStatus應該是「0 - 空閒」。 在第二個查詢中,CrawlCompleted列應該爲「1」。
-- FullText Catalog Info
SELECT @@SERVERNAME ServerName
, DB_NAME() DB
, C.fulltext_catalog_id CatalogID
, C.name CatalogName
, C.path CatalogPath
, CONVERT(NVARCHAR(10), FULLTEXTCATALOGPROPERTY(C.name, 'PopulateStatus')) + ' - '
+ CASE FULLTEXTCATALOGPROPERTY(C.name, 'PopulateStatus')
WHEN 0 THEN 'Idle'
WHEN 1 THEN 'Full population in progress'
WHEN 2 THEN 'Paused'
WHEN 3 THEN 'Throttled'
WHEN 4 THEN 'Recovering'
WHEN 5 THEN 'Shutdown'
WHEN 6 THEN 'Incremental population in progress'
WHEN 7 THEN 'Building index'
WHEN 8 THEN 'Disk is full, paused'
WHEN 9 THEN 'Change tracking'
ELSE '** Unknown PopulateStatus Code **'
END PopulateStatus
, FULLTEXTCATALOGPROPERTY(C.name, 'IndexSize') CatalogSizeMB
, FULLTEXTCATALOGPROPERTY(C.name, 'ItemCount') ItemCount
, FULLTEXTCATALOGPROPERTY(C.name, 'UniqueKeyCount') UniqueKeyCount
, c.is_default IsDefaultCatalog
, c.is_accent_sensitivity_on IsAccentSensitive
, c.data_space_id DataSpaceID
, c.file_id FileID
, c.principal_id PrincipalID
FROM sys.fulltext_catalogs C
ORDER BY C.name;
-- FullText Indexed Table/View info
SELECT C.name CatalogName
, S.name FTItemSchema
, O.name FTItemName
, O.type_desc FTItemType
--, I.object_id
--, I.unique_index_id
, SI.name UniqueIndexName
--, I.fulltext_catalog_id
, I.is_enabled IsEnabled
, I.change_tracking_state_desc ChangeTracking
, I.has_crawl_completed CrawlCompleted
, I.crawl_type_desc CrawlType
, I.crawl_start_date CrawlStart
, I.crawl_end_date CrawlEnd
FROM sys.fulltext_indexes I
INNER JOIN sys.fulltext_catalogs C ON C.fulltext_catalog_id = I.fulltext_catalog_id
INNER JOIN sys.objects O ON O.object_id = I.object_id
INNER JOIN sys.schemas S ON S.schema_id = O.schema_id
INNER JOIN sys.indexes SI ON SI.object_id = I.object_id AND SI.index_id = I.unique_index_id
ORDER BY C.name, S.name, O.name
-- FullText Indexed Column info
SELECT C.name CatalogName
, S.name FTItemSchema
, O.name FTItemName
-- , IC.object_id
, IC.language_id
, FIC.name IndexedColumnName
, FIT.name + '(' + CASE FIC.max_length WHEN -1 THEN 'max' ELSE CONVERT(NVARCHAR(20), FIC.max_length/(CASE WHEN FIT.name IN ('nchar', 'nvarchar') THEN 2 ELSE 1 END)) END + ')' IndexedColumnType
, FIC.is_nullable IndexedColumnNullable
, TIC.name TypeColumnName
, TIT.name + '(' + CASE TIC.max_length WHEN -1 THEN 'max' ELSE CONVERT(NVARCHAR(20), TIC.max_length/(CASE WHEN TIT.name IN ('nchar', 'nvarchar') THEN 2 ELSE 1 END)) END + ')' TypeColumnType
, TIC.is_nullable TypeColumnNullable
FROM sys.fulltext_index_columns IC
INNER JOIN sys.fulltext_indexes I ON I.object_id = IC.object_id
INNER JOIN sys.fulltext_catalogs C ON C.fulltext_catalog_id = I.fulltext_catalog_id
INNER JOIN sys.objects O ON O.object_id = IC.object_id
INNER JOIN sys.schemas S ON S.schema_id = O.schema_id
INNER JOIN sys.columns FIC ON FIC.object_id = IC.object_id AND FIC.column_id = IC.column_id
INNER JOIN sys.types FIT ON FIT.user_type_id = FIC.user_type_id
LEFT JOIN sys.columns TIC ON TIC.object_id = IC.object_id AND TIC.column_id = IC.type_column_id
LEFT JOIN sys.types TIT ON TIT.user_type_id = TIC.user_type_id
ORDER BY C.name, S.name, O.name, IC.column_id
定義「*停止工作*」 – scsimon
我的存儲過程停止返回預期的數據。所以在我們每天刷新的DEV db上它返回了預期的數據。 – Dwight
如果您正在刷新數據,您是否還在重新運行全文搜索索引?你的問題非常模糊,缺乏細節。 –