sql数据库准备还原时却出了错,提示是:"设备激活错误……请使用WITH MOVE…

一台机器上备份了一个数据库,把备份后的文件打击拷到另一台机器上准备还原时却出了错,提示是:"设备激活错误,物理文件名:d:\program files\microsoft sqlserver\MSSQL\finance_data.mdf"可能有误.文件finance_DATA无法还原为d:\program files\microsoft sqlserver\MSSQL\finance_data.mdf.请使用WITH MOVE 选项来标识该文件的有效位置…"

解决方法:

目录不对

–解决第一个问题的详细步骤:

1.企业管理器中的方法:

–右键"数据库"

–所有任务

–还原数据库

–"还原为数据库库"中输入还原后的数据库名

–还原选择"从设备"–选择设备–添加–添加你的备份文件–确定,回到数据库还原的界面

–备份号–选择内容–选择你要恢复那次备份的内容

–选项–将"移至物理文件名"中的物理文件名修改为你的数据文件要存放的文件名

–如果要还原的数据库已经存在,选择"在现有数据库上强制还原"-

-确定

2.用SQL语句的方法(假设你的备份文件名为: c:\xx.bak

–列出备份文件中的逻辑文件名

restore filelistonly from disk='c:\xx.bak'

–用语句恢复,根据上面列出的逻辑文件名使用move选项

restore database 恢复后的数据库名
from disk='c:\xx.bak'
with move '逻辑数据文件名1' to 'c:\物理数据文件名1'
,move '逻辑数据文件名2' to 'c:\物理数据文件名2'
...
,move '逻辑数据文件名n' to 'c:\物理数据文件名n'

 

例如:

 

restore database automis
from disk='d:\autoback'
with move 'autoshool_Data' to 'D:\Program Files\Microsoft SQL Server\MSSQL\data\automis_Data.MDF'
,move 'autoshool_Log' to 'D:\Program Files\Microsoft SQL Server\MSSQL\data\automis_Log.LDF'
此条目发表在 乱七八糟 分类目录,贴了 , 标签。将固定链接加入收藏夹。

sql数据库准备还原时却出了错,提示是:"设备激活错误……请使用WITH MOVE…》有 12 条评论

  1. Numerous folks feel this really is a subject that is entirely primarily based on private opinion, I’ve to disagree. I want to personally i appreciate you for making the effort to write down the way you experience concerning this matter, and creating it public to any or all people searching at your web page.

  2. Oh my goodness! an remarkable write-up dude. Numerous thanks Even so My business is experiencing trouble with ur rss . Do not know why Struggle to sign up to it. Can there be every person acquiring identical rss dilemma? Anyone who knows kindly respond. Thnkx

  3. log factory 说:

    hi there and many thanks for your information – I had unquestionably discovered everything new from in this article. I did so nonetheless competence some practical details by using this web site, while i expert to reload the internet website lots of days former to I could possibly obtain it to fill properly. If your web host is OK, i had been wondering? Not that Im complaining, but sluggish loading instances times will often affect your placement in google and can damage your high quality score if marketing and ads with Adwords. Regardless I’m putting this Really simply syndication to my e-snail mail and can look for far more within your individual exciting information. Ensure you revise this yet again quickly..

  4. A really terrific post, nice tips, many thanks sharing.

  5. Habibi 说:

    I saw a lot of website but I believe this one holds something extra in it. “Culture is the arts elevated to a set of beliefs.” by Thomas Wolfe.

  6. Habibi 说:

    Hi! Great post! Please do tell us when I will see a follow up!

  7. Habibi 说:

    I like this post, enjoyed this one thanks for posting.

  8. Pingback 引用通告: best photoshop resources

  9. Pingback 引用通告: This is why this video will make you like Indie Euro Rock again!

  10. Pingback 引用通告: ingray band music videos live

  11. Pingback 引用通告: best wordpress theme

  12. Pingback 引用通告: image hover zoom effect * in css file

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>