基于时间点恢复数据库stopat
create database newtestdb
use newtestdb
go
drop table t1
go
create table t1 (
id int not null identity(1,1) primary key
,vdate datetime default (getdate())
,name varchar(32)
)
backup database newtestdb to disk='c:\newtestdb_ful.bak'
insert into t1 (name) values ('aa')
insert into t1 (name) values ('bb')
backup log newtestdb to disk='c:\newtestdb_1.trn' --2016-05-18 13:42:30.767
select getdate()
insert into t1 (name) values ('cc')
backup log newtestdb to disk='c:\newtestdb_2.trn' --2016-05-18 13:43:59.707
select getdate()
insert into t1 (name) values ('dd')
backup log newtestdb to disk='c:\newtestdb_3.trn' --2016-05-18 13:45:05.310
select getdate()
insert into t1 (name) values ('ee')
backup log newtestdb to disk='c:\newtestdb_4.trn' --2016-05-18 13:46:29.783
select getdate()
insert into t1 (name) values ('ff')
backup log newtestdb to disk='c:\newtestdb_5.trn' --2016-05-18 13:47:21.833
select getdate()
--恢复到dd
use master
go
restore database newtestdb from disk='c:\newtestdb_ful.bak' with replace,norecovery;
/*
Processed 344 pages for database 'newtestdb', file 'newtestdb' on file 1.
Processed 6 pages for database 'newtestdb', file 'newtestdb_log' on file 1.
RESTORE DATABASE successfully processed 350 pages in 0.025 seconds (109.179 MB/sec).
*/
restore log newtestdb from disk='c:\newtestdb_1.trn' with replace,norecovery,stopat='2016-05-18 13:45:09.310';
/*
Processed 0 pages for database 'newtestdb', file 'newtestdb' on file 1.
Processed 7 pages for database 'newtestdb', file 'newtestdb_log' on file 1.
This backup set contains records that were logged before the designated point in time. The database is being left in the restoring state so that more roll forward can be performed.
RESTORE LOG successfully processed 7 pages in 0.008 seconds (6.103 MB/sec).
*/
restore log newtestdb from disk='c:\newtestdb_2.trn' with replace,norecovery,stopat='2016-05-18 13:45:09.310';
/*
Processed 0 pages for database 'newtestdb', file 'newtestdb' on file 1.
Processed 1 pages for database 'newtestdb', file 'newtestdb_log' on file 1.
This backup set contains records that were logged before the designated point in time. The database is being left in the restoring state so that more roll forward can be performed.
RESTORE LOG successfully processed 1 pages in 0.006 seconds (0.325 MB/sec).
*/
restore log newtestdb from disk='c:\newtestdb_3.trn' with replace,norecovery,stopat='2016-05-18 13:45:09.310';
/*
Processed 0 pages for database 'newtestdb', file 'newtestdb' on file 1.
Processed 1 pages for database 'newtestdb', file 'newtestdb_log' on file 1.
This backup set contains records that were logged before the designated point in time. The database is being left in the restoring state so that more roll forward can be performed.
RESTORE LOG successfully processed 1 pages in 0.006 seconds (0.325 MB/sec).
*/
restore log newtestdb from disk='c:\newtestdb_4.trn' with replace,norecovery,stopat='2016-05-18 13:45:09.310';
/*
Processed 0 pages for database 'newtestdb', file 'newtestdb' on file 1.
Processed 1 pages for database 'newtestdb', file 'newtestdb_log' on file 1.
RESTORE LOG successfully processed 1 pages in 0.004 seconds (0.488 MB/sec).
*/
restore log newtestdb from disk='c:\newtestdb_5.trn' with replace,norecovery,stopat='2016-05-18 13:45:09.310';
/*
Msg 4305, Level 16, State 1, Line 57
The log in this backup set begins at LSN 34000000022700001, which is too recent to apply to the database. An earlier log backup that includes LSN 34000000022500002 can be restored.
Msg 3013, Level 16, State 1, Line 57
RESTORE LOG is terminating abnormally.
*/
restore database newtestdb with replace,recovery;
/*
RESTORE DATABASE successfully processed 0 pages in 0.086 seconds (0.000 MB/sec).
*/
--成功恢复至dd
select * from newtestdb.dbo.t1
id vdate name
1 2016-05-18 13:41:44.500 aa
2 2016-05-18 13:42:26.767 bb
3 2016-05-18 13:43:57.707 cc
4 2016-05-18 13:45:05.290 dd
基于时间点恢复数据库stopat的更多相关文章
- 7.5 Point-in-Time (Incremental) Recovery Using the Binary Log 使用binay log 基于时间点恢复
7.5 Point-in-Time (Incremental) Recovery Using the Binary Log 使用binay log 基于时间点恢复 7.5.1 Point-in-Tim ...
- 【Oracle】rman基于时间点恢复
rman基于时间点恢复 场景: 由于某研究的误操作,导致财务模块的数据丢失,如何使用rman基于时间点恢复数据. 思路 1.克隆数据库的虚拟机,直接对数据库的数据进行恢复 RMAN> shutd ...
- 7.5.1 Point-in-Time Recovery Using Event Times 使用Event Times 基于时间点恢复
7.5.1 Point-in-Time Recovery Using Event Times 使用Event Times 基于时间点恢复 表明开始和结束时间用于恢复, 指定 --start-datet ...
- mysqlbinlog基于时间点恢复
基于时间点恢复 /data/mysq/mysqlbin.000026 #mysqlbinlog文件,恢复如下内容: 注意:按照时间点恢复时,可能同一个时间点有其他的操作,要结合上下文的时间选取~ # ...
- 13. ClustrixDB 基于时间点恢复
在不太可能发生灾难的情况下,可以在特定数据库.表或整个集群上执行ClustrixDB集群的某个时间点恢复.应该非常小心地处理这一问题. 先决条件 在你可以使用时间点恢复之前,你的集群应该有几个先决条件 ...
- xtrabackup全量备份+binlog基于时间点恢复
1.通过xtrabackup的备份恢复数据库. 2.找到start-position和binlog名称 cat xtrabackup_info 3.导出mysqlbinlog为sql文件,并确定恢复的 ...
- 1.MongoDB 2.7主从复制(master –> slave)环境基于时间点的恢复
(一)MongoDB恢复概述 对于任何类型的数据库,如果要将数据库恢复到过去的任意时间点,否需要有过去某个时间点的全备+全备之后的重做日志,MongoDB也不例外.使用全备将数据库恢复到固定时刻,然后 ...
- mysql 开发进阶篇系列 43 逻辑备份与恢复(mysqldump 的基于时间和位置的不完全恢复)
一. 概述 在上篇讲到了逻辑备份,使用mysqldump工具来备份一个库,并使用完全恢复还原了数据库.在结尾也讲到了误操作是不能用完全恢复的.解决办法是:我们需要恢复到误操作之前的状态,然后跳过误操作 ...
- Oracle 基于用户管理恢复的处理
================================ -- Oracle 基于用户管理恢复的处理 --================================ Oracle支持多种 ...
随机推荐
- ASP.NET MVC 利用ActionFilterAttribute来做权限等
ActionFilterAttribute是Action过滤类,该属于会在执行一个action之前先执行.而ActionFilterAttribute是 MVC的一个专门处理action过滤的类.基于 ...
- Vim-Vundle-plugins-scripts
配置文件.vimrc set tabstop= set softtabstop= set shiftwidth= set noexpandtab set autoindent set cindent ...
- TermServDevices错误
来源TermServDevices的错误日志,日志内容 事类型: 错误 事件来源: TermServDevices 描述 打印机 XXXX 所需的驱动程序 XXX 未知.登录之前,请与 ...
- [RVM is not a function] Interating RVM with gnome-terminal
Ubuntu 12.04 64bit LTS, running the 'rvm use 1.9.3' brings the 'RVM is not a function' warning. Here ...
- emmc boot1 boot2 partition
使用mfg tool烧写android5.1的镜像之后,再使用旧版的mfg tool烧写linux或者android镜像,都不能正常启动,而且运行的uboot还是android5.1版本的uboot. ...
- SQL、LINQ、Lambda 三种用法(转)
SQL.LINQ.Lambda 三种用法颜色注释: SQL LinqToSql Lambda QA1. 查询Student表中的所有记录的Sname.Ssex和Class列.select sname, ...
- C#实现二叉查找树
简介 树是一种非线性结构.树的本质是将一些节点由边连接起来,形成层级的结构.而二叉树是一种特殊的树,使得树每个子节点必须小于等于2.而二叉查找树又是一类特殊的二叉树.使得每一个节点的左节点或左子树的所 ...
- Linux下获取公网IP地址
curl http://members.3322.org/dyndns/getipcurl http://ip.6655.com/ip.aspx
- ViewFlipper、ViewPager和Gallery
1.ViewFlipper 1)View切换的控件—ViewFlipper介绍 ViewFilpper类继承于ViewAnimator类.而ViewAnimator类继承于FrameLayout. 查 ...
- ios常见细节问题-删掉main.storyboard程序启动屏幕变黑-崩溃
删掉程序默认的main.storyboard文件后,程序启动崩溃 如图所示.原因是删掉main.storyboard文件后没有在info.plist文件里面设置 删掉main.storyboard后程 ...