SQL Server log备份SQL语句
生活随笔
收集整理的這篇文章主要介紹了
SQL Server log备份SQL语句
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
--完全備份
backup database demo
to nwdevice02
with name = 'fullbak'
--日志備份
backup log demo
to nwdevice02
with name = 'log1' --restore full backup
restore database demo
from nwdevice02
with file=1,norecovery --restore log backup
restore log demo
from nwdevice02
with file=4,recovery
--完全備份
? backup database demo
? to nwdevice
? with name='完全備份' --差異備份
? backup database demo
? to nwdevice
? with differential,
?????? name = '差異備份1'
?
--日志備份 log1
? backup log demo
? to nwdevice
? with name='日志1' --日志備份 log2
? backup log demo
? to nwdevice
? with name='日志2' --還原完全備份
? restore database demo
? from nwdevice
? with norecovery? --相當(dāng)于第二項(xiàng)(選項(xiàng))
?????? file = 1
--還原差異
? restore database demo
? from nwdevice
? with recovery,
?????? file= 2
?/* 第一完全備,第二次差異備份*/ --還原日志
? restore log demo
? from nwdevice
? with file= 2,
?????? norecovery restore log demo
from nwdevice
with file= 3,
recovery
?
backup database demo
to nwdevice02
with name = 'fullbak'
--日志備份
backup log demo
to nwdevice02
with name = 'log1' --restore full backup
restore database demo
from nwdevice02
with file=1,norecovery --restore log backup
restore log demo
from nwdevice02
with file=4,recovery
--完全備份
? backup database demo
? to nwdevice
? with name='完全備份' --差異備份
? backup database demo
? to nwdevice
? with differential,
?????? name = '差異備份1'
?
--日志備份 log1
? backup log demo
? to nwdevice
? with name='日志1' --日志備份 log2
? backup log demo
? to nwdevice
? with name='日志2' --還原完全備份
? restore database demo
? from nwdevice
? with norecovery? --相當(dāng)于第二項(xiàng)(選項(xiàng))
?????? file = 1
--還原差異
? restore database demo
? from nwdevice
? with recovery,
?????? file= 2
?/* 第一完全備,第二次差異備份*/ --還原日志
? restore log demo
? from nwdevice
? with file= 2,
?????? norecovery restore log demo
from nwdevice
with file= 3,
recovery
?
轉(zhuǎn)載于:https://blog.51cto.com/jankie/28365
總結(jié)
以上是生活随笔為你收集整理的SQL Server log备份SQL语句的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关于网络线与电话线共用之体会
- 下一篇: 业务工作流平台设计(七)