oracle:rman恢复----通过时间set until time
试验计划:先做一个0级备份,再创建一个表,插入几条数据,最后删除表,然后通过rman把该表的数据恢复。
试验环境:在归档模式,oracle10.2.0.1
开始试验:
1.rman level 0备份
RMAN> backup incremental level 0 database; Starting backup at -DEC-
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid= devtype=DISK
channel ORA_DISK_1: starting incremental level datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno= name=/u01/app/oracle/product/10.2./db_2/oradata/orcl/system01.dbf
input datafile fno= name=/u01/app/oracle/product/10.2./db_2/oradata/orcl/sysaux01.dbf
input datafile fno= name=/u01/app/oracle/product/10.2./db_2/oradata/orcl/undotbs01.dbf
input datafile fno= name=/u01/app/oracle/product/10.2./db_2/oradata/orcl/yn.dbf
input datafile fno= name=/u01/app/oracle/product/10.2./db_2/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece at -DEC-
channel ORA_DISK_1: finished piece at -DEC-
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2013_12_02/o1_mf_nnnd0_TAG20131202T211658_99s22c7o_.bkp tag=TAG20131202T211658 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: ::
channel ORA_DISK_1: starting incremental level datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece at -DEC-
channel ORA_DISK_1: finished piece at -DEC-
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2013_12_02/o1_mf_ncsn0_TAG20131202T211658_99s252by_.bkp tag=TAG20131202T211658 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: ::
Finished backup at -DEC-
2.创建表
SQL> create table t1(id int,name varchar2()); Table created. SQL> insert into t1 values(,'first'); row created. SQL> commit; SQL> insert into t1 values(,'second'); row created. SQL> commit; Commit complete. SQL> alter system switch logfile; System altered. SQL> select * from t1; ID NAME
---------- --------------------
first
second
3.查询当前系统时间
SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; TO_CHAR(SYSDATE,'YY
-------------------
-- ::
4.删除表,关闭数据库,重启数据库
SQL> drop table t1; Table dropped. SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started. Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes
Database mounted.
SQL> select status from v$instance; STATUS
------------
MOUNTED
5.rman恢复
RMAN> run{
2> allocate channel c1 type disk;
3> set until time "to_date('2013-12-02 21:41:55','yyyy-mm-dd hh24:mi:ss')";
4> restore database;
5> recover database;
6> sql 'alter database open resetlogs';
> } allocated channel: c1
channel c1: sid= devtype=DISK executing command: SET until clause Starting restore at -DEC- channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile to /u01/app/oracle/product/10.2./db_2/oradata/orcl/system01.dbf
restoring datafile to /u01/app/oracle/product/10.2./db_2/oradata/orcl/undotbs01.dbf
restoring datafile to /u01/app/oracle/product/10.2./db_2/oradata/orcl/sysaux01.dbf
restoring datafile to /u01/app/oracle/product/10.2./db_2/oradata/orcl/users01.dbf
restoring datafile to /u01/app/oracle/product/10.2./db_2/oradata/orcl/yn.dbf
channel c1: reading from backup piece /u01/app/oracle/flash_recovery_area/ORCL/backupset/2013_12_02/o1_mf_nnnd0_TAG20131202T211658_99s22c7o_.bkp
channel c1: restored backup piece
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2013_12_02/o1_mf_nnnd0_TAG20131202T211658_99s22c7o_.bkp tag=TAG20131202T211658
channel c1: restore complete, elapsed time: ::
Finished restore at -DEC- Starting recover at -DEC- starting media recovery archive log thread sequence is already on disk as file /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_12_02/o1_mf_1_56_99s2jvny_.arc
archive log thread sequence is already on disk as file /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_12_02/o1_mf_1_57_99s2lpbk_.arc
archive log thread sequence is already on disk as file /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_12_02/o1_mf_1_58_99s3d5ph_.arc
archive log thread sequence is already on disk as file /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_12_02/o1_mf_1_1_99s3j6fg_.arc
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_12_02/o1_mf_1_56_99s2jvny_.arc thread= sequence=
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_12_02/o1_mf_1_57_99s2lpbk_.arc thread= sequence=
archive log filename=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2013_12_02/o1_mf_1_58_99s3d5ph_.arc thread= sequence=
media recovery complete, elapsed time: ::
Finished recover at -DEC- sql statement: alter database open resetlogs
released channel: c1 RMAN>
6.查询被删除的数据
SQL> select * from t1; ID NAME
---------- --------------------
first
second SQL>
7.重新备份数据库
在生产环境中,不完全恢复后,是要用rman重新备份的。因为该备份是以后数据恢复的一个起点。
oracle:rman恢复----通过时间set until time的更多相关文章
- Oracle RMAN 恢复数据库到不同主机(二)
我们在recover database时报一个错误: RMAN-06054: media recovery requesting unknown archived log for thread 1 w ...
- Oracle Rman恢复
(转自:http://blog.chinaunix.net/uid-14779297-id-1988309.html) RMAN的基本概念 Target Database:就是需要RMAN对其进行备份 ...
- oracle rman恢复数据库 方式恢复到异地数据库
目的:从某个环境中,获取相关文件,放到异地机器使用rman 恢复. 情况说明:XX系统使用的是oracle数据库,现已从服务器拉下来相关文件,依靠这些文件来早本地的测试机上恢复数据库,方便进行数据 ...
- Oracle RMAN 恢复控制文件到指定的路径
Oracle 数据库通过RMAN恢复控制文件到指定的路径 --------------------------------------------------------- 先查询备份集信息,再指定备 ...
- Oracle RMAN 恢复数据库到不同主机(一)
一.RMAN 备份的内容 RMAN做数据库全备时包含了 数据文件.归档日志.控制文件和参数文件和备份日志,如下: arch_20160223_08qukp2t_1_1 arch_20160223_0 ...
- Oracle DB 使用RMAN恢复目录
• 对恢复目录和RMAN 资料档案库控制文件的使用进行比较• 创建和配置恢复目录• 在恢复目录中注册数据库• 同步恢复目录• 使用RMAN 存储脚本• 备份恢复目录• 创建虚拟专用目录 RMAN 资料 ...
- rman恢复方案和oracle异机恢复
这篇文章主要介绍了rman恢复方案和oracle异机恢复,需要的朋友可以参考下 注:①恢复的前提是已经做好备份②完全恢复数据库是数据库遇到故障,在恢复时候没有丢失任何已经提交事物数据的恢复不完全恢复数 ...
- Oracle RMAN 学习:恢复
Oracle RMAN 学习:恢复 6 rman恢复 Rman中的恢复对应restore,recover Restore,数据修复,利用备份集的数据文件来替换已损坏的数据文件或将其恢复到另外一个位置, ...
- Oracle RMAN 异机恢复一例
背景介绍:本例需求是将NBU备份的oracle数据库恢复到另一主机上. NBU环境配置.异机上的Oracle软件安装配置忽略,下面只介绍OracleDB恢复的过程. ----------------- ...
随机推荐
- ado:SqlDataAdapter的两种不同写法,以及SqlCommand的两种不同写法
原文发布时间为:2008-08-01 -- 来源于本人的百度文章 [由搬家工具导入] SqlDataAdapter:(它是自动打开连接且自动关闭的,所以可以不必显示打开关闭连接) SqlConnect ...
- 在echars上发布的半圆环形图
http://gallery.echartsjs.com/editor.html?c=xBJvoMcPfz&v=1
- CodeForces 438D 线段树 剪枝
D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input st ...
- Lucene 6.5.0 入门Demo
Lucene 6.5.0 要求jdk 1.8 1.目录结构: 2.数据库环境: private int id; private String name; private float price; pr ...
- 解决三星 BIOS 模式没有 Fast Bios Mode选项 U盘动项问题
今天想分下盘,进入biso竟然没有网上说 Fast Bios Mode选项,最后自己误打误撞竟然设置成功了,太不可思议了官方这么说:开机按F2进入BIOS设置,找到Boot选项下Boot Device ...
- code forces 1051 d
看的这个题解:http://www.cnblogs.com/tobyw/p/9685639.html 写的比较清楚. 矩阵类型的计数题 比赛时感觉就像是个dp,然后就跳过了. 现在看着题解写一下,感觉 ...
- 2017-10-29-morning-清北模拟赛
T1 遭遇 #include <algorithm> #include <cstdio> #include <cmath> inline void read(int ...
- http状态码的分类
状态码分类 转自http://www.cnblogs.com/TankXiao/archive/2013/01/08/2818542.html HTTP状态码被分为五大类, 目前我们使用的HTTP协议 ...
- 深入GCD(五):资源竞争
概述我将分四步来带大家研究研究程序的并发计算.第一步是基本的串行程序,然后使用GCD把它并行计算化.如果你想顺着步骤来尝试这些程序的话,可以下载源码.注意,别运行imagegcd2.m,这是个反面教材 ...
- iphone 消息推送 实现
IPhone 消息推送实现 参考 资料 http://blog.csdn.net/victormokai/article/details/39501277 对生成pem 的补充 拿到mac 上生成导出 ...