[20140711] SQL Server page还原

时间:2014-07-16 20:02:16   收藏:0   阅读:234
create DATABASE T --数据库不能是简单模式
go
USE t
GO
CREATE TABLE t(id INT IDENTITY,value CHAR(8000))
GO
INSERT INTO dbo.t
        (  value )
VALUES  (
          REPLICATE(a,5000)
          )
go 5
BACKUP DATABASE t TO DISK = c:\t.bak WITH INIT
go
--停服务
--用ue打开数据文件 找 aaaa,修改 随便改
DBCC checkdb (t) --验证
go
RESTORE DATABASE t PAGE = 1:90 FROM DISK=c:\t.bak WITH NORECOVERY
go
BACKUP LOG t TO DISK=c:\t.log WITH INIT
go    
RESTORE LOG t FROM DISK =c:\t.log
go
DBCC checkdb (t) --验证

 

[20140711] SQL Server page还原,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!