简体   繁体   English

从sql server 2000迁移到2008 r2 - 如何

[英]Migrate from sql server 2000 to 2008 r2 - how to

I have a database working on SQL Server 2000. We are now migrating to a new server with SQL Server 2008 r2. 我有一个数据库在SQL Server 2000上工作。我们现在正在迁移到SQL Server 2008 r2的新服务器。 Can anyone please point me to some resource or howto? 谁能指点我一些资源或怎么样? I'm not really finding my way around SQL 2000. 我并没有真正找到适合SQL 2000的方法。

Thank you! 谢谢!

Basically, what you need to do is: 基本上,您需要做的是:

  • backup your database in SQL Server 2000 to a .bak file 将SQL Server 2000中的数据库备份到.bak文件
  • move that *.bak file to your new server 将* .bak文件移动到新服务器
  • restore that database onto your new server 将该数据库还原到新服务器上

You're done! 你完成了! There's really nothing more to it..... just backup (on your old system) and restore (on your new system). 真的没什么了.....只需备份(在旧系统上)并恢复(在新系统上)。

So where exactly is your problem ?? 那你的问题究竟在哪里?

Update: as @Péter correctly mentions: this leaves your database in the SQL Server 2000 compatibility mode. 更新:正如@Péter正确提到:这使您的数据库处于SQL Server 2000兼容模式。 This means: even though you've "migrated" to SQL Server 2008 R2, you can still only use the 2000 features. 这意味着:即使您已“迁移”到SQL Server 2008 R2,您仍然只能使用2000个功能。

In order to see what compatibility mode your database is in, check the sys.databases catalog view: 要查看数据库所处的兼容模式,请检查sys.databases目录视图:

SELECT * FROM sys.databases WHERE name = 'YourDatabaseName'

One column is called compatibility_level and contains an INT ; 一列称为compatibility_level并包含INT ; 80 = SQL Server 2000, 90 = SQL Server 2005, 100 = SQL Server 2008 / 2008 R2 and 110 = SQL Server 2012 80 = SQL Server 2000,90 = SQL Server 2005,100 = SQL Server 2008/2008 R2和110 = SQL Server 2012

In order to change your database to a different compatibility level, use this command: 要将数据库更改为其他兼容级别,请使用以下命令:

ALTER DATABASE YourDatabaseNameHere
SET COMPATIBILITY_LEVEL = 100;

This will put your database into the "native" SQL Server 2008 (and 2008 R2) mode and now your migration is complete, you can use all the new SQL Server 2008 R2 features. 这将使您的数据库进入“本机”SQL Server 2008(和2008 R2)模式,现在您的迁移已完成,您可以使用所有新的SQL Server 2008 R2功能。

I would start by running the Upgrade Advisor against the 2000 server (during low utilization or off hours) to see what recommendations it makes and fully address each: http://msdn.microsoft.com/en-us/library/ms144256.aspx 我将首先针对2000服务器运行升级顾问(在低利用率或非工作时间内),以查看它提出的建议并完全解决每个问题: http//msdn.microsoft.com/en-us/library/ms144256.aspx

Here too is a white paper from MS on the topic: http://download.microsoft.com/download/2/0/B/20B90384-F3FE-4331-AA12-FD58E6AB66C2/SQL%20Server%202000%20to%202008%20Upgrade%20White%20Paper.docx 这里也有一篇来自MS的白皮书主题: http//download.microsoft.com/download/2/0/B/20B90384-F3FE-4331-AA12-FD58E6AB66C2/SQL%20Server%202000%20to%202008% 20Upgrade%20White%20Paper.docx

A lot could go wrong...too much to cover in a forum setting. 很多可能会出错...在论坛设置中覆盖太多。 But then again nothing could go wrong...the best plan, test, and then test some more. 但是,再没有什么可能出错......最好的计划,测试,然后测试更多。

I am currently doing the same thing. 我目前正在做同样的事情。

Creating your SQL 2008 database from a 2000 restore bak is a good first step. 从2000恢复bak创建SQL 2008数据库是一个很好的第一步。 Most of the work for me was dealing with the user permissions, and making sure that the users were in sync with the database login, and that we didn't have a database schema generated by the backup tied to that user that would cause problems if we tried to recreate that database user. 我的大多数工作是处理用户权限,并确保用户与数据库登录同步,并且我们没有由与该用户相关联的备份生成的数据库架构,如果该问题导致问题我们试图重新创建该数据库用户。

What we ended up doing was: 我们最终做的是:

1) Create a script. 1)创建一个脚本。 We had a script that would dynamically write a script to do the following: drop login, drop db user, drop schema, recreate login, recreate user, grant user permissions. 我们有一个脚本可动态编写脚本来执行以下操作:drop login,drop db user,drop schema,recreate login,recreate user,grant user permissions。

2) Restore database. 2)恢复数据库。

4) Run the generated script 4)运行生成的脚本

另一个选择是尝试直接将sql2k的数据库(文件)连接到sql2k8。

The simpliest way is to back up your database in SQL 2000 to a .bak file and move it. 最简单的方法是将SQL 2000中的数据库备份到.bak文件并移动它。 Do a restore and everything should be fine. 恢复,一切都应该没问题。 Run a sp_Users_Loging to identify the users in the orphan server. 运行sp_Users_Loging以标识孤立服务器中的用户。

Edited Apr 2012 because original link changed to latest version, SQL Server 2012 2012年4月编辑,因为原始链接已更改为最新版本,SQL Server 2012

For an "in-situ" upgrade (MSDN links): 对于“原位”升级(MSDN链接):

... to SQL Server 2008 R2 ...到SQL Server 2008 R2

You can upgrade instances of SQL Server 2000, SQL Server 2005 or SQL Server 2008 to SQL Server 2008 R2. 您可以将SQL Server 2000,SQL Server 2005或SQL Server 2008的实例升级到SQL Server 2008 R2。

... to SQL Server 1012 ...到SQL Server 1012

You can upgrade from SQL Server 2005, SQL Server 2008, and SQL Server 2008 R2 to SQL Server 2012. 您可以从SQL Server 2005,SQL Server 2008和SQL Server 2008 R2升级到SQL Server 2012。

The others answers are correct from a technical perspective but not from a support point of view. 其他答案从技术角度来看是正确的,但不是从支持的角度来看。

I don't think Microsoft support a direct upgrade from SQL Server 2000 to SQL Server 2008 R2. 我不认为Microsoft支持从SQL Server 2000直接升级到SQL Server 2008 R2。 That doesn't mean it is hard, just that it is not supported. 这并不意味着它很难,只是它不受支持。 (Which may or may not be significant for your scenario) (对于您的场景,这可能有用也可能不重要)

You can upgrade your SQL Server 2000 instance to SQL Server 2008 R1 and then perform a subsequent upgrade to SQL Server 2008 R2. 您可以将SQL Server 2000实例升级到SQL Server 2008 R1,然后执行后续升级到SQL Server 2008 R2。 (Or even SQL Server 2012 if you are so inclined) (如果你这么倾向,甚至是SQL Server 2012)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM