从 SQL Server 2005 到 2008 Express 版本的备份和恢复?
我和一位客户之间有一个很大的问题。
他们的基础设施崩溃了,大部分开发工作最终都出现了神秘的错误(这只发生在他们的环境中)。
我想做的是创建一个单独的环境(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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
试试这个代码
try this code
如果您的数据库大小不超过 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.
RESTORE 操作能够将数据库从 2005 格式即时升级到 2008 格式。当您通过恢复创建新数据库时,通常需要添加选项:
如果您的客户使用的任何功能在 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:
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).
步骤 1:备份数据库:
查询:
步骤 2:恢复数据库:
如何恢复:
step1: Backup your database:
query:
step2: Restore your database:
How to Restore: