이 쿼리를 사용하여 전체 텍스트 인덱스의 상태를 모니터링합니다. 첫 번째 쿼리에서 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
"* stopped working *"을 정의하십시오. – scsimon
내 스토어드 프로 시저가 예상 데이터를 리턴하지 않았습니다. 그래서 DEV 데이터베이스에서 우리는 매일 새로 고침하여 예상되는 데이터를 반환했습니다. – Dwight
데이터를 새로 고치는 중이라면 전체 텍스트 검색 인덱스를 다시 실행 하시겠습니까? 귀하의 질문은 매우 모호하고 세부 사항이 부족합니다. –