[英]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.