禁用全文日志记录 (SQL Server)

jit*_*bit 8 sql-server full-text-search

有什么方法可以完全禁用 FT 日志?我花了几个小时谷歌搜索 - 没有运气。

每秒钟都会收到大量的“信息”消息。

2020-01-01 10:43:16.48 spid33s     Informational: Full-text Auto population initialized for table or indexed view xxx
2020-01-01 10:43:23.48 spid34s     Informational: Full-text Auto population completed for table or indexed view zzz
2020-01-01 10:43:23.48 spid36s     Informational: Full-text Auto population completed for table or indexed view xxx
2020-01-01 10:43:24.64 spid12s     Informational: Full-text Auto population initialized for table or indexed view xxx
2020-01-01 10:43:25.64 spid12s     Informational: Full-text Auto population completed for table or indexed view xxx
2020-01-01 10:43:26.58 spid36s     Informational: Full-text Auto population initialized for table or indexed view xxx
2020-01-01 10:43:26.98 spid17s     Informational: Full-text Auto population initialized for table or indexed view xxx
Run Code Online (Sandbox Code Playgroud)

PS 我的云托管提供商向我收取“每秒 i/o 操作数”的费用,所以这是我想要禁用的。此外,这些日志增长得非常快,每周都有几 GB,所以我不得不写一个日志维护脚本(滚动 + 存档等)

Han*_*non 2

我建议配置全文索引以进行手动填充;这将大大减少写入日志的“全文自动填充”消息的数量。

Microsoft Docs页面显示如何配置手动填充的全文索引。

本质上,您可以像这样显式定义索引:

CREATE UNIQUE INDEX ui_ukDoc ON Production.Document(DocumentID);  
CREATE FULLTEXT CATALOG AW_Production_FTCat;  
CREATE FULLTEXT INDEX ON Production.Document  
(  
    Document                         --Full-text index column name   
        TYPE COLUMN FileExtension    --Name of column that contains file type information  
        Language 1033                 --1033 is LCID for the English language  
)  
    KEY INDEX ui_ukDoc  
    ON AW_Production_FTCat  
    WITH CHANGE_TRACKING OFF, NO POPULATION;  
GO  
Run Code Online (Sandbox Code Playgroud)

然后,您需要使用以下命令通过 SQL Server 代理作业来安排填充:

ALTER FULLTEXT INDEX ON Production.Document  
   START FULL POPULATION;  
Run Code Online (Sandbox Code Playgroud)

完成全部填充后,您可以通过以下方式安排全文索引的部分增量更新:

ALTER FULLTEXT INDEX ON Production.Document  
   START INCREMENTAL POPULATION;  
Run Code Online (Sandbox Code Playgroud)

INCRMENTAL
指定仅检索自上次填充以来修改的行以进行全文索引。仅当表具有时间戳类型的列时才能应用 INCRMENTAL。如果全文目录中的表不包含时间戳类型的列,则该表将进行 FULL 填充。

或者

ALTER FULLTEXT INDEX ON Production.Document  
   START UPDATE POPULATION;  
Run Code Online (Sandbox Code Playgroud)

UPDATE
指定自上次更新更改跟踪索引以来所有插入、更新或删除的处理。必须在表上启用更改跟踪填充,但不应打开后台更新索引或自动更改跟踪。

在最初创建全文索引后,您只需执行一次完整填充。此页面包含有关增量或更新群体以及要求的详细信息。