sqlserver 日志恢复方法(搞定drop和truncate)
--1
use master
backup database logTest
to disk='D:\\Program Files\\Microsoft SQL Server\\MSSQL10.MSSQLSERVER\\MSSQL\\Backup\\logTest.bak'
with format
--2
use logTest
create table table_1(Id int, test varchar(max))
insert table_1(Id,test) values (1,'3333');
insert table_1(Id,test) values (2,'4333');
insert table_1(Id,test) values (3,'5333');
use master
--2.1
WAITFOR DELAY '00:00:05'
GO
use logTest
truncate table table_1
select GETDATE()
use master
--3
use master
backup log logTest
to disk='D:\\Program Files\\Microsoft SQL Server\\MSSQL10.MSSQLSERVER\\MSSQL\\Backup\\logTest_log.bak'
with format
--4
--DECLARE @dt datetime
--SELECT @dt=DATEADD(ms,-1800,GETDATE())
--select @dt
restore database logtest
from disk = 'D:\\Program Files\\Microsoft SQL Server\\MSSQL10.MSSQLSERVER\\MSSQL\\Backup\\logTest.bak'
WITH REPLACE
RESTORE LOG logTest
FROM DISK='D:\\Program Files\\Microsoft SQL Server\\MSSQL10.MSSQLSERVER\\MSSQL\\Backup\\logTest_log.bak'
with STOPAT= '2009-10-26 12:38:57.133'
GO
您可能感兴趣的文章:- SQL Server误区30日谈 第7天 一个实例多个镜像和日志传送延迟
- SQL Server高可用的常见问题分析
- SQL Server 数据库清除日志的方法
- SQL Server 2008 清空删除日志文件(瞬间日志变几M)
- SQL Server 2005删除日志文件的几种方法小结
- sqlserver 数据库日志备份和恢复步骤
- sql server数据库高可用日志传送的方法