注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 IB客座主编(四)美国西蒙公..
 帮助

SQL Server log备份SQL语句


2007-05-29 10:35:00
 标签:SQL Server SQL语句   [推送到技术圈]

--完全备份
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  --相当于第二项(选项)
       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
 
 
 
 
 

 




    文章评论
 
2007-05-29 21:58:42
踩一脚,马上离开

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: