Applies ToDynamics CRM 4.0

症状

使用部署管理器导入组织后,导入的组织中 FullTextCatalogIndex 的系统作业将停止工作并保持等待状态。 如果您应用了 KB977867,您将不会遇到此问题。

原因

导入组织不会重命名全文目录,并且导入的组织数据库存储了包含已备份组织的 GUID 的完整文本目录。 系统作业尝试执行包含当前组织 id 的全文目录更新 ftcat_documentindex_<OrganizationIdGuidValue>,然后更改为 "等待" 状态。

解决方案

为了解决此问题,请在你的组织数据库上运行以下 SQL 脚本:

DECLARE @ID AS NVARCHAR(128),   @OLDNAME AS NVARCHAR(128),   @NEWNAME AS NVARCHAR(128),  @LINES AS INTSELECT @OLDNAME = name FROM  SYS.FULLTEXT_CATALOGS WHERE name LIKE 'ftcat_documentindex_%'SELECT @ID = OrganizationId FROM OrganizationSET @ID = REPLACE(@ID,'-','')SET @ID = LOWER(@ID)SET @NEWNAME = 'ftcat_documentindex_' + @IDPRINT 'GUID IS : '+@IDPRINT '---------------------'PRINT 'OLDNAME IS : '+@OLDNAMEPRINT '---------------------'PRINT 'NEWNAME IS : '+@NEWNAMEPRINT '---------------------'IF @OLDNAME!=@NEWNAMEBEGIN EXEC sp_fulltext_database 'enable'  -- Drop exsiting full text catalog PRINT 'START DROPPING EXSITING FULL TEXT CATALOG ..' PRINT '---------------------' IF  EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'[dbo].[DocumentIndex]')) BEGIN  ALTER FULLTEXT INDEX ON [dbo].[DocumentIndex] DISABLE END IF  EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'[dbo].[DocumentIndex]')) BEGIN  DROP FULLTEXT INDEX ON [dbo].[DocumentIndex] END SELECT @LINES = COUNT(*) FROM sysfulltextcatalogs ftc WHERE ftc.name = @OLDNAME IF  @LINES > 0 BEGIN  EXEC sp_fulltext_catalog @OLDNAME,'drop'  END PRINT 'DROPPING COMPLETE ..' PRINT '---------------------' -- Add new full text catalog PRINT 'START ADDING EXSITING FULL TEXT CATALOG ..' PRINT '---------------------' EXEC sp_fulltext_catalog @NEWNAME,'create' EXEC sp_fulltext_table 'documentindex', 'create', @NEWNAME, 'cndx_PrimaryKey_DocumentIndex'  EXEC sp_fulltext_column 'documentindex', 'Title', 'add'    EXEC sp_fulltext_column 'documentindex', 'KeyWords', 'add'    EXEC sp_fulltext_column 'documentindex', 'SearchText', 'add'    EXEC sp_fulltext_table 'documentindex', 'activate'    EXEC sp_fulltext_catalog @NEWNAME, 'start_full'  PRINT 'ADDING COMPLETE ..'ENDELSEPRINT 'THE FULL TEXT CATALOG HAS BEEN UPDATED ..'

需要更多帮助?

需要更多选项?

了解订阅权益、浏览培训课程、了解如何保护设备等。

社区可帮助你提出和回答问题、提供反馈,并听取经验丰富专家的意见。