标题:定点还原
只看楼主
棉花糖ONE
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:32
帖 子:2987
专家分:0
注 册:2006-7-13
 问题点数:0 回复次数:0 
定点还原

if object_id('shiyan') is not null
drop table shiyan
go
create table shiyan(id int)
insert into shiyan select 1
union all select 2
union all select 3
select count(*) as c from shiyan
c
-----------
3
backup database data to disk='c:\data.bak' with format --进行完全备份

select * from student

update student set name='cc' where id=1
select getdate() --记录时间标记为1
go
drop table shiyan --删除表
go
select getdate() --记录时间标记为2
select count(*) as c from shiyan --说明表被删除
服务器: 消息 208,级别 16,状态 1,行 1
对象名 'shiyan' 无效。

backup log data to disk='c:\data_log.bak' with format --备份日志

use master
go
restore database data from disk='c:\data.bak' with norecovery --对完全备份进行恢复

restore log data from disk='c:\data_log.bak' with recovery,stopat=' 时间点改成标志1和标志2之间'
--进行时间点恢复

select count(*) as c from shiyan

c
-----------
3

搜索更多相关主题的帖子: insert create database update count database create insert update count 
2007-03-24 15:57



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-126429-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.088558 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved