恢复有问题的 SQL Server 版本?

发布于 2024-09-07 14:18:34 字数 1605 浏览 6 评论 0 原文

我收到以下错误。

服务器还原失败

我最近将 SQL Server 2005 Express 升级到 SQL Server 2008 Express。

  • 我在生产服务器上进行了备份,SQL Server 2008
  • 备份效果很好,并且我尝试在生产服务器上恢复备份,效果很好。
  • 我用 FileZila 软件下载了 .Zip 格式的备份文件(这也很好)。
  • 但是当我尝试恢复该文件时,出现以下错误。

服务器还原失败

执行 Transact-SQL 语句或批处理时发生异常。 (Microsoft.SqlServer.ConnectionInfo)

------------------------------------------ 附加信息:

设备 'C:\go4sharepoint_1384_8481 上的媒体系列.bak' 的格式不正确。 SQL Server 无法处理该媒体系列。 RESTORE HEADERONLY 异常终止。 (Microsoft SQL Server,错误:3241)

如需帮助,请单击:http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4053&EvtSrc=MSSQLServer&EvtID=3241&LinkId= 20476

我尝试过但不起作用的事情

尝试 1 尝试使用以下命令进行备份

BACKUP DATABASE go4sharepoint_1384_8481 TO DISK='C:\HostingSpaces\dbname_jun14_2010_new.bak' 并使用 FORMAT

并尝试恢复该文件。

尝试2 有人写信来测试我的 SQL Server 版本。 当我尝试在 SQL Server 2008 中运行以下命令时,

Select @@Version

它给出以下输出 Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) 2009 年 5 月 26 日 14:24:20 版权所有 (c) 1988-2005 Windows NT 6.0 上的 Microsoft Corporation Express Edition(内部版本 6002:Service Pack 2)

我的生产数据库位于 SQL Server 中2008,我试图在 SQL Server 2008 中恢复数据库,但以上版本显示好像我正在使用 SQL Server 2005。

知道如何恢复 SQL Server 2008 DB。

非常感谢。

I am getting following error.

Restore failed for Server

I have recently upgraded SQL Server 2005 Express to SQL Server 2008 Express.

  • I have taken a Backup on Production Server, having SQL Server 2008
  • Backup was good and I tried restoring Backup on Production Server, that works great.
  • Than I downloaded that backup file in .Zip format with FileZila Software (And that is good too).
  • But when I tried to restore that file I am getting following error.

Restore failed for Server

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------ ADDITIONAL INFORMATION:

The media family on device 'C:\go4sharepoint_1384_8481.bak' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4053&EvtSrc=MSSQLServer&EvtID=3241&LinkId=20476

Things I tried which didn't worked

Attempt 1
Try to take backup using following command

BACKUP DATABASE go4sharepoint_1384_8481
TO DISK='C:\HostingSpaces\dbname_jun14_2010_new.bak' with FORMAT

And tried restore that file.

Attempt 2
Somebody wrote to test Version of my SQL Server.
When I tried to run following command in SQL Server 2008

Select @@Version

It is giving following output
Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) May 26 2009 14:24:20 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.0 (Build 6002: Service Pack 2)

My Production Database is in SQL Server 2008, and I am trying to restore DB in SQL Server 2008 but above version is showing as if i am using SQL Server 2005.

Any idea how can I restore SQL Server 2008 DB.

Many Thanks.

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

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

发布评论

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

评论(5

寄与心 2024-09-14 14:18:35

无法在较低版本上从较高的 SQL Server 版本恢复备份 - 这在 SQL Server 中从未实现过。

如果您有 SQL Server 2008 备份,则只能在 SQL Server 2008(或更高版本)计算机上恢复该备份,但不能在 2005 机器上恢复。没有技巧,没有解决方法,没有办法做到这一点。

You cannot restore a backup from a higher SQL Server version on a lower version - this has never been able in SQL Server.

If you have a SQL Server 2008 backup, you can only restore that on a SQL Server 2008 (or later) machine - but not on a 2005 box. No trick, no workaround, no way to do it.

怀念你的温柔 2024-09-14 14:18:35

这里你有两个选择。

使用 RESTORE 命令时使用WITH REPLACE。这将覆盖现有数据库并恢复备份文件所代表的数据库状态。

删除您尝试恢复到的数据库,然后使用 RESTORE 命令再次恢复。这将创建一个新数据库,其状态由备份文件表示。

请注意,在这两个选项中,您都将丢失尝试恢复到的数据库的现有数据。

You have 2 options here.

Use WITH REPLACE while using the RESTORE command. This will overwrite the existing database and restore the database state represented by the backup files.

Delete the database to which you are trying to restore to and restore again using RESTORE command. This will create a new database with the state represented by the backup files.

Please note that in both these options you will lose the existing data of the database you are trying to restore to.

许久 2024-09-14 14:18:35

确保它安装正确 - 在您的program files\microsoft sql server 目录中应该有一个 100/150 文件夹。在 setup bootstrap\log 中查看安装日志。

Make sure it is installed correctly - in your program files\microsoft sql server directory there whould be a 100/150 folder. Check out the install log in setup bootstrap\log.

早乙女 2024-09-14 14:18:35

如上所述,出现此行为的原因是,默认情况下 SQL Server 不允许将数据库备份还原到旧版本的 SQL Server,无论备份来源的数据库的兼容性级别如何。

您可以尝试:

  1. 启动 SQL Server Management Studio 并连接到数据库所在的实例
  2. 在数据库上下文菜单中导航到“任务”|“数据库”生成脚本....这将调用“生成和发布脚本”向导
  3. 在向导的“简介”步骤中,单击“下一步”
  4. 在向导的“选择对象”步骤中,确保选择“为整个数据库和所有数据库对象编写脚本”选项,然后单击“下一步”
  5. 在“设置脚本选项”步骤中向导:
  6. 选择“将脚本保存到特定位置”选项
  7. 指定是否将数据库对象和数据编写为单个文件、多个文件以及生成脚本的路径和编码
  8. 单击“高级”
  9. 在“高级脚本选项”对话框中 出现:
  10. 在“服务器版本脚本”选项中指定需要将数据库还原到的 SQL Server 版本
  11. 在“服务器版本脚本”选项中指定架构和数据
  12. 将以下选项设置为 True:
    脚本登录
    脚本全文索引
    脚本触发器
    单击“确定”
    单击“下一步”
  13. 在向导的“摘要”步骤中单击“下一步”
  14. 在向导的“保存或发布脚本”步骤中单击“完成
  15. ” 针对旧 SQL 实例执行生成的 SQL 脚本

尽管上面列出的过程应该有效:
1.它不会迁移所有数据库对象(例如序列或队列)
2. 如果您的数据库包含 SQL Server 无法识别的依赖项(例如对驻留在链接服务器上的数据库的依赖项),则可能会失败。

您可以查看 解决方案中心。您还可以考虑使用第三方工具。

As described above the reason for this behaviour is that by default SQL Server doesn't allow restoring a database backup to an older version of SQL Server, regardless of the compatibility level of the database the backup was taken from.

You can try to:

  1. Start SQL Server Management Studio and connect to the instance where the database resides
  2. In the database context menu navigate to Tasks | Generate Scripts…. This will invoke the Generate and Publish Scripts wizard
  3. In the Introduction step of the wizard click Next
  4. In the Choose Objects step of the wizard make sure that the Script entire database and all database objects option is selected and click Next
  5. In the Set Scripting options step of the wizard:
  6. Select the Save scripts to a specific location option
  7. Specify whether the database objects and data will be scripted to a single file multiple files, as well as the path and encoding of the generated scripts
  8. Click Advanced
  9. In the Advanced Scripting Options dialog that will appear:
  10. Specify the version of the SQL Server you need the database restored to in the Script for Server Version option
  11. In the Script for Server Version option specify Schema and data
  12. Set the following options to True:
    Script Logins
    Script Full-Text Indexes
    Script Triggers
    Click OK
    Click Next
  13. In the Summary step of the wizard click Next
  14. In the Save or Publish Scripts step of the wizard click Finish
  15. Execute the generated SQL script(s) against the older SQL instance

Although the procedure listed above should work:
1. It doesn’t migrate all of the database objects (e.g. sequences or queues)
2. It might fail if your database contains dependencies which SQL Server fails to recognize (e.g. dependencies to databases residing on linked servers)

You can take a look at the rest of the article on Solution center. There is also third party tools you can take in consideration.

机场等船 2024-09-14 14:18:34

您是否有可能没有将 2005 实例升级到 2008,而是将 2008 与 2005 并排安装,并且连接到现有的 2005 实例?查找您计算机上的其他实例。

Is it possible that, instead of upgrading your 2005 instance to 2008, you instead installed 2008 side-by-side with 2005, and you're connecting to your existing 2005 instance? Look for other instances on your machine.

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