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

发布于 2024-07-05 00:45:23 字数 307 浏览 10 评论 0原文

我正在将 SQL Server 2000 数据库加载到我的新 SQL Server 2005 实例中正如预期的那样,全文目录没有附带。 我如何重建它们?

对- 单击我的全文目录并点击“重建索引”只会挂起几个小时而不执行任何操作,所以它看起来并不那么简单......

I'm loading a SQL Server 2000 database into my new SQL Server 2005 instance. 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...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梓梦 2024-07-12 00:45:23

谢谢,这很有帮助,因为它显示了问题所在:我的文件路径不同。 以下是我修复它的方法:

1) 从 SQL 2000 备份加载数据库

2) 将兼容模式设置为 SQL 2005

USE mydb
GO

ALTER DATABASE mydb SET COMPATIBILITY_LEVEL = 90
GO

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) 然后对于每个名称(我在一个小脚本中完成此操作)

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

5) 然后收集所有“可读的”目录名称:

SELECT name FROM sys.sysfulltextcatalogs

6) 最后,现在您可以重建每个目录:

ALTER FULLTEXT CATALOG {full text catalog name} REBUILD

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

2) Set compatibility mode to SQL 2005

USE mydb
GO

ALTER DATABASE mydb SET COMPATIBILITY_LEVEL = 90
GO

3) Get the filegroup names

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)

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:

SELECT name FROM sys.sysfulltextcatalogs

6) Finally, now you can rebuild each one:

ALTER FULLTEXT CATALOG {full text catalog name} REBUILD
丑疤怪 2024-07-12 00:45:23

使用 SQL 尝试一下。

以下是 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.

Try it using 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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文