A simple script for checking Full Text Index population

The following script will check if the full text index has changed in the last 15 minutes and send and email to warn you if it is not populating. Where ftc_default is your full text catalog in your user database.

if (dateadd(ss,FULLTEXTCATALOGPROPERTY(‘ftc_default’,’PopulateCompletionAge’), ‘1/1/1990’) <= dateadd(minute,-15,getdate()))
begin

DECLARE @sub varchar(100), @Comp varchar(1000)

SELECT @sub=cast( dateadd(ss,FULLTEXTCATALOGPROPERTY(‘ftc_default’,’PopulateCompletionAge’), ‘1/1/1990’) as varchar(100));

USE [msdb]

    select @Comp= concat(‘Check to see if full text index is ok, Last update = ‘, @sub,’  ‘, @@servername);
    EXEC sp_send_dbmail
      @profile_name = ‘databasemail’,
      @recipients = ‘dba@lojack.com’,
      @subject = ‘Full Text Index IM1PRODAGL.IM1.LOCAL’,
      @body = @Comp

end

This script was written because in my case I have an index that I knew should be changing in less than a 15 minute interval  due to updates on the underlying indexed view.

This entry was posted in Sql Server. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s