backup database db to disk=='c:\vb\dbin.dat' with init
backup database db to disk='c:\vb\dbdiff.dat' with differential
备份完后直接执行恢复语句:
restore database db from disk='c:\vb\dbin.dat'
restore database db from disk='c:\vb\dbdiff.dat' WITH NORECOVERY
第一句恢复语句可以正常执行,第二句就报错了.这是为什么呢?哪里错了.
5 个解决方案
#1
1.db库不能有连接到这个数据库中..
2.
restore database db from disk='c:\vb\dbin.dat' WITH REPLACE,NORECOVERY
restore database db from disk='c:\vb\dbdiff.dat' WITH RECOVERY
2.
restore database db from disk='c:\vb\dbin.dat' WITH REPLACE,NORECOVERY
restore database db from disk='c:\vb\dbdiff.dat' WITH RECOVERY
#2
--2、从备份中还原
-------------------------------------------------------------------------
restore headeronly from bak1
restore database d1 from bak1 with file=2 --从完全备份中恢复
----------------------------------------------------------------------
restore headeronly from bak2 --从差异备份中恢复
restore database d2 from bak2 with file=1,norecovery
restore database d2 from bak2 with file=5,recovery
----------------------------------------------------------------------
restore headeronly from bak3 --从日志备份中恢复
restore database d3 from bak3 with file=1,norecovery
restore log d3 from bak3 with file=2,norecovery
restore log d3 from bak3 with file=3,norecovery
restore log d3 from bak3 with file=4,norecovery
restore log d3 from bak3 with file=5,recovery
----------------------------------------------------------------------
#3
在图形界面恢复的时候也一样 还原第一个备份的时候要 选项--》 with norecovery
#4
在图形界面恢复的时候也一样 还原第一个备份的时候要 选项--》 with norecovery
#5
restore database db from disk='c:\vb\dbin.dat' WITH REPLACE,NORECOVERY
restore database db from disk='c:\vb\dbdiff.dat' WITH RECOVERY
第一次还原完全备份的时候需要WITH REPLACE,NORECOVERY
restore database db from disk='c:\vb\dbdiff.dat' WITH RECOVERY
第一次还原完全备份的时候需要WITH REPLACE,NORECOVERY
#1
1.db库不能有连接到这个数据库中..
2.
restore database db from disk='c:\vb\dbin.dat' WITH REPLACE,NORECOVERY
restore database db from disk='c:\vb\dbdiff.dat' WITH RECOVERY
2.
restore database db from disk='c:\vb\dbin.dat' WITH REPLACE,NORECOVERY
restore database db from disk='c:\vb\dbdiff.dat' WITH RECOVERY
#2
--2、从备份中还原
-------------------------------------------------------------------------
restore headeronly from bak1
restore database d1 from bak1 with file=2 --从完全备份中恢复
----------------------------------------------------------------------
restore headeronly from bak2 --从差异备份中恢复
restore database d2 from bak2 with file=1,norecovery
restore database d2 from bak2 with file=5,recovery
----------------------------------------------------------------------
restore headeronly from bak3 --从日志备份中恢复
restore database d3 from bak3 with file=1,norecovery
restore log d3 from bak3 with file=2,norecovery
restore log d3 from bak3 with file=3,norecovery
restore log d3 from bak3 with file=4,norecovery
restore log d3 from bak3 with file=5,recovery
----------------------------------------------------------------------
#3
在图形界面恢复的时候也一样 还原第一个备份的时候要 选项--》 with norecovery
#4
在图形界面恢复的时候也一样 还原第一个备份的时候要 选项--》 with norecovery
#5
restore database db from disk='c:\vb\dbin.dat' WITH REPLACE,NORECOVERY
restore database db from disk='c:\vb\dbdiff.dat' WITH RECOVERY
第一次还原完全备份的时候需要WITH REPLACE,NORECOVERY
restore database db from disk='c:\vb\dbdiff.dat' WITH RECOVERY
第一次还原完全备份的时候需要WITH REPLACE,NORECOVERY