简体   繁体   English

将数据库从SQL Server 2000升级到2005 —并重建全文索引?

[英]Upgrade database from SQL Server 2000 to 2005 — and rebuild full-text indexes?

I'm loading a SQL Server 2000 database into my new SQL Server 2005 instance . 我正在将SQL Server 2000数据库加载到新的SQL Server 2005 实例中 As expected, the full-text catalogs don't come with it. 不出所料,全文目录没有随附。 How can I rebuild them? 我该如何重建它们?

Right-clicking my full text catalogs and hitting " rebuild indexes " just hangs for hours and hours without doing anything, so it doesn't appear to be that simple... 右键单击我的全文目录,然后单击“ 重建索引 ”,它挂了好几个小时,却无所事事,所以看起来似乎并不那么简单...

Try it using SQL. 使用SQL尝试一下。

Here's an example from Microsoft. 这是微软的一个例子。

--Change to accent insensitive
USE AdventureWorks;
GO
ALTER FULLTEXT CATALOG ftCatalog 
REBUILD WITH ACCENT_SENSITIVITY=OFF;
GO
-- Check Accentsensitivity
SELECT FULLTEXTCATALOGPROPERTY('ftCatalog', 'accentsensitivity');
GO
--Returned 0, which means the catalog is not accent sensitive.

Thanks, that helped because it showed what was wrong: My file paths were different. 谢谢,这很有帮助,因为它表明了问题所在:我的文件路径不同。 Here's how I fixed it: 这是我的解决方法:

1) Load database from SQL 2000 backup 1)从SQL 2000备份加载数据库

2) Set compatibility mode to SQL 2005 2)将兼容模式设置为SQL 2005

USE mydb
GO

ALTER DATABASE mydb SET COMPATIBILITY_LEVEL = 90
GO

3) Get the filegroup names 3)获取文件组名称

SELECT name 
  FROM sys.master_files mf 
 WHERE type = 4 
   AND EXISTS( SELECT * 
                 FROM sys.databases db 
                WHERE db.database_id = mf.database_id 
                  AND name           = 'mydb')

4) Then for each name (I did this in a little script) 4)然后为每个名称(我在一个小脚本中做到了这一点)

ALTER DATABASE mydb 
MODIFY FILE( NAME = {full text catalog name}, FILENAME="N:\ew\path\to\wherever")

5) Then collect all the "readable" names of the catalogs: 5)然后收集目录的所有“可读”名称:

SELECT name FROM sys.sysfulltextcatalogs

6) Finally, now you can rebuild each one: 6)最后,现在您可以重建每个:

ALTER FULLTEXT CATALOG {full text catalog name} REBUILD

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将数据库从 SQL Server 2005 升级到 2008 — 并重建全文索引? - Upgrade database from SQL Server 2005 to 2008 — and rebuild full-text indexes? 我应该在SQL Server 2000到2005数据库迁移后重建表索引 - Should I rebuild table indexes after a SQL Server 2000 to 2005 database migration SQL Server 2005数据库大小属性是否包含全文本索引? - Does the SQL Server 2005 database size property include the full-text index? SQL Server 2005上的简单全文搜索问题 - Problem with simple full-text search on SQL Server 2005 SQL Server 2005 Express中的全文本索引比较 - Full-Text Index Comparisons in SQL Server 2005 Express 如何在SQL Server 2005 Express中启用全文索引? - How to enable Full-text Indexing in SQL Server 2005 Express? 是否可以在不知情的情况下将 SQL Server 2000 数据库升级到 2005? - Is it possible to upgrade a SQL Server 2000 database to 2005 without knowing it? 控制nvarchar列中SQL Server全文引擎索引的文本 - Controlling what text SQL Server's Full-text Engine indexes in a nvarchar column 在SQL Server 2005中跨多个表,列使用全文本搜索 - Using Full-Text Search in SQL Server 2005 across multiple tables, columns SQL Server 2005全文搜索 - 我可以搜索正斜杠字符吗? - SQL Server 2005 Full-Text Search - can I search for forward-slash characters?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM