东瑜

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

rman基于时间点恢复

场景:

由于某研究的误操作,导致财务模块的数据丢失,如何使用rman基于时间点恢复数据。

思路

1.克隆数据库的虚拟机,直接对数据库的数据进行恢复

RMAN> shutdown immediate;
RMAN> startup nomount;
RMAN> alter database mount;

RMAN> run{
set until time "to_date('20190918 22:00:00','yyyymmdd hh24:mi:ss')";
restore database;
recover database;
}

RMAN> ALTER DATABASE OPEN RESETLOGS;

2.需要延后5分钟之后的数据,操作如下:

RMAN> shutdown immediate;

RMAN> startup nomount;

####需要恢复,最近最新的control file才能恢复数据。
RMAN> restore CONTROLFILE  FROM '/u01/backup/rman/CTL__oradb_t1019358193_s718_p1_c1_20190919';


RMAN> alter database mount;

RMAN> run{
set until time "to_date('20190918 22:10:00','yyyymmdd hh24:mi:ss')";
restore datafile 12;
recover tablespace fin;
}

SYS@oradb> ALTER DATABASE OPEN RESETLOGS;
posted on 2019-10-23 10:52  东瑜  阅读(1230)  评论(0编辑  收藏  举报
\\页脚html代码