从 SQL Server 2005 到 2008 Express 版本的备份和恢复?

发布于 2024-08-16 09:02:13 字数 630 浏览 6 评论 0原文

我和一位客户之间有一个很大的问题。

他们的基础设施崩溃了,大部分开发工作最终都出现了神秘的错误(这只发生在他们的环境中)。

我想做的是创建一个单独的环境(VPS)并将应用程序服务器和数据库推送到这个新环境中,这样他们就可以真正看到问题出在他们的基础设施中。

我尝试过手动重新创建数据库,但这是不可能的,太多的约束、索引等...

如何将数据库备份(SQL Serve 2005)恢复到SQL Server 2008 Express版本(我的测试环境)中?

我使用此命令生成备份...

BACKUP DATABASE [databasename] TO  
    DISK = 'c:\database_backup_20091228_1500.bak' 
    WITH NOFORMAT, NOINIT,  NAME = N'Database-Full Backup', 
    SKIP, NOREWIND, NOUNLOAD,  STATS = 10

这似乎正在工作(刚刚运行它,服务器正在生成文件)..

现在进入我的 Sql Server 2008 Express 版本,如何恢复它?

是否可以?

还有其他选择吗?

谢谢!

I'm having a huge problem with a client.

Their infrastructure blows, and most of the development done end up with mysterious errors(which only happen in their environment).

What I'm trying to do is create a separate environment (a VPS) and push the application server and the database into this new environment, so they can actually see the problem lies within their infrastructure.

I've tried recreating the database manually, but its impossible, too much constraints, indexes etc...

How do I restore a database backup(SQL Serve 2005) into a SQL Server 2008 Express edition (my test environment)?

I used this command to generate the backup...

BACKUP DATABASE [databasename] TO  
    DISK = 'c:\database_backup_20091228_1500.bak' 
    WITH NOFORMAT, NOINIT,  NAME = N'Database-Full Backup', 
    SKIP, NOREWIND, NOUNLOAD,  STATS = 10

Which seems to be working (just ran it, server is generating the file)..

Now into my Sql Server 2008 express edition, how do I restore it?

Is it possible?

Any alternatives?

Thx!

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

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

发布评论

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

评论(4

羞稚 2024-08-23 09:02:13

试试这个代码

 RESTORE DATABASE [databasename]
       FROM DISK = 'c:\database_backup_20091228_1500.bak'
       WITH NOFORMAT, NOINIT;

try this code

 RESTORE DATABASE [databasename]
       FROM DISK = 'c:\database_backup_20091228_1500.bak'
       WITH NOFORMAT, NOINIT;
山田美奈子 2024-08-23 09:02:13

如果您的数据库大小不超过 4GB,则可以将 SQL Server 2005 数据库还原到 SQL Server 2008 Express 版本。

You can restore a SQL Server 2005 database to SQL Server 2008 Express edition provided your database is no greater than 4GB in size.

可可 2024-08-23 09:02:13

RESTORE 操作能够将数据库从 2005 格式即时升级到 2008 格式。当您通过恢复创建新数据库时,通常需要添加选项:

  • 需要REPLACE来禁用恢复期间发生的正常检查,这会阻止您用另一个数据库的内容替换数据库来自备份集。有关详细信息,请参阅使用 REPLACE 选项
  • 需要MOVE将备份集中的逻辑文件移动到新位置。 RESTORE 操作将尝试为数据库中的 MDF、LDF 和所有 NDF 文件创建相同的位置,这可能不适用于您的特定驱动器结构。有关详细信息,请参阅通过备份和还原复制数据库

如果您的客户使用的任何功能在 Express 中不起作用,那么您将必须升级到支持您所需功能的版本。到目前为止,最好的选择是购买开发者版许可证,只需 50 美元左右,即可获得全部权限。功能齐全。企业版的特点是它只能用于开发目的(您就是这样)。

The RESTORE operation iscapable of upgrading the database on the fly from the 2005 format to 2008 one. When you create a new database by means of restore you usually need to options added:

  • REPLACE is needed to disable a normal check that occurs during RESTORE and which prevents you from replacing a database with the content of another database from a backup set. For details see Using the REPLACE Option.
  • MOVE is needed to move logical files in the backup set to new locations. The RESTORE operation will attempt to create the same locations for the MDF, LDF and all NDF files in the database, and this may not work on your particular drive structure. For details see Copying Databases with Backup and Restore.

If your client is using any feature that does not work in Express then you're going to have to upgrade to an edition that supports the features you need. The best option by far is to buy a Developer edition license, that costs around $50 only and gives you all. fully functional. Enterprise features at the restriction that it can only be used for development purposes (which you are).

淡看悲欢离合 2024-08-23 09:02:13

步骤 1:备份数据库:

查询:

BACKUP DATABASE [databasename] TO 
DISK = 'c:\database_backup_20091228_1500.bak' WITH NOFORMAT, NOINIT, NAME = N'Database-Full Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10

步骤 2:恢复数据库:

如何恢复:

  • 步骤 1:打开 SQL Server Management Studio Express
  • 步骤 2:然后右键单击数据库
  • 步骤 3:然后选择“还原数据库”
  • 步骤 4:然后选择还原源
  • 步骤 5:选择从设备和浏览
  • 第6步:添加选择数据库.bak文件
  • 第7步:然后给出数据库名称并勾选数据库
  • 第8步:这就是数据库将被恢复

step1: Backup your database:

query:

BACKUP DATABASE [databasename] TO 
DISK = 'c:\database_backup_20091228_1500.bak' WITH NOFORMAT, NOINIT, NAME = N'Database-Full Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10

step2: Restore your database:

How to Restore:

  • step1: Open SQL Server Management Studio Express
  • step2: Then Right click the database
  • step3: And select Restore Databse
  • step4: Then select the source for restore
  • step5: Select from device and Browse
  • step6: Add to select the database .bak files
  • step7: Then Give database name and tick to the database
  • step8: That's is the databse will be restored
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文