Home > Database > Mysql Tutorial > 差异备份的恢复问题_MySQL

差异备份的恢复问题_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:53:17
Original
962 people have browsed it

A : 情况是这样的 

create  database  test 

create  table  t(a  int) 

insert  into  test..t  select  1 

然后进行一次完整备份 

backup  database  test  to  disk='c: est.bak' 

insert  into  test..t  select  2 

再进行一次完整备份 

backup  database  test  to  disk='c: est.bak' 

insert  into  test..t  select  3 

此时用  restore  database  test  from  disk='c: est.bak'  with  file=1 

结果为  1,  此为正确 

用  restore  database  test  from  disk='c: est.bak'  with  file=2 

结果为  1, 

2  此也为正确 

当表t中为1,2,3的时候,在插入一条纪录结果为1,2,3,4然后进行一次差异备份 

backup  database  test  to  disk='c: est.bak'  with  differential 

然后往执行delete  from  t  删除所有纪录 

我现在想恢复最后的那次差异备份(结果为1,2,3,4),用语句改如何实现呢? 

---------------------------------------------------------------   

下面的是详细的过程,在我的电脑上测试成功:   

--清除环境,防止现有的数据影响测试结果 

exec  master..xp_cmdshell  'del  c: ext.bak' 

if  exists(select  *  from  master..sysdatabases  where  name='test') 

drop  database  test 

go   

Related labels:
yes
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template