oracle:rman恢复----通过增量备份来恢复
试验计划:先rman进行一个0级备份,插入表相关数据,再进行level 1级增量备份,进行rman恢复
实验环境:归档模式下,oracle10.2.0.1
开始试验:
1. rman level 0级备份
RMAN> backup incremental level 0 database; Starting backup at -DEC-
using channel ORA_DISK_1
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_TAG20131202T222739_99s66wc3_.bkp tag=TAG20131202T222739 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_TAG20131202T222739_99s6bvm4_.bkp tag=TAG20131202T222739 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: ::
Finished backup at -DEC-
2.插入相关表数据
SQL> select * from t1; ID NAME
---------- --------------------
first
second SQL> insert into t1 values(,'rman3'); row created. SQL> commit; Commit complete. SQL> insert into t1 values(,'rman4'); row created. SQL> commit; Commit complete. SQL> alter system switch logfile; System altered. SQL> alter system checkpoint; System altered. SQL>
3.rman level 0级备份
RMAN> backup incremental level 1 database; Starting backup at -DEC-
using channel ORA_DISK_1
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_nnnd1_TAG20131202T223244_99s6jfdz_.bkp tag=TAG20131202T223244 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_ncsn1_TAG20131202T223244_99s6k6o1_.bkp tag=TAG20131202T223244 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: ::
Finished backup at -DEC- RMAN>
4.查看此时的备份文件、关闭数据库、重启数据库
[root@app 2013_12_02]# ll
?昏.
-rw-r----- oracle oinstall - : o1_mf_ncsn0_TAG20131202T222739_99s6bvm4_.bkp
-rw-r----- oracle oinstall - : o1_mf_ncsn1_TAG20131202T223244_99s6k6o1_.bkp
-rw-r----- oracle oinstall - : o1_mf_nnnd0_TAG20131202T222739_99s66wc3_.bkp
-rw-r----- oracle oinstall - : o1_mf_nnnd1_TAG20131202T223244_99s6jfdz_.bkp
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.
5.rman恢复
RMAN> run {
> allocate channel c1 type disk;
> restore database;
> recover database;
> sql 'alter database open';
> } allocated channel: c1
channel c1: sid= devtype=DISK 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_TAG20131202T222739_99s66wc3_.bkp
channel c1: restored backup piece
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2013_12_02/o1_mf_nnnd0_TAG20131202T222739_99s66wc3_.bkp tag=TAG20131202T222739
channel c1: restore complete, elapsed time: ::
Finished restore at -DEC- Starting recover at -DEC-
channel c1: starting incremental datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
destination for restore of datafile : /u01/app/oracle/product/10.2./db_2/oradata/orcl/system01.dbf
destination for restore of datafile : /u01/app/oracle/product/10.2./db_2/oradata/orcl/undotbs01.dbf
destination for restore of datafile : /u01/app/oracle/product/10.2./db_2/oradata/orcl/sysaux01.dbf
destination for restore of datafile : /u01/app/oracle/product/10.2./db_2/oradata/orcl/users01.dbf
destination for restore of datafile : /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_nnnd1_TAG20131202T223244_99s6jfdz_.bkp
channel c1: restored backup piece
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2013_12_02/o1_mf_nnnd1_TAG20131202T223244_99s6jfdz_.bkp tag=TAG20131202T223244
channel c1: restore complete, elapsed time: :: starting media recovery
media recovery complete, elapsed time: :: Finished recover at -DEC- sql statement: alter database open
released channel: c1 RMAN>
6.查询数据
[oracle@app ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1. - Production on Mon Dec :: Copyright (c) , , Oracle. All rights reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1. - 64bit Production
With the Partitioning, OLAP and Data Mining options SQL> select * from t1;
id name
---------------------
1 first
2 second
3 rman3
4 rman4
这里说一个我在进行此试验时,遇到的一个另外问题:
level 1级备份操作后,进行了drop table t1;我以为利用 level 0+level 1 恢复时,rman只恢复到我level 1备份处,t1表的4条数据还是存在的。
但,当我这样操作后,进行select × from t1 查询时,发现提示该表不存在。
后来仔细想了想,当我利用recover database时,数据库会自动读取redo或者归档文件来进行drop table t1操作的。
oracle:rman恢复----通过增量备份来恢复的更多相关文章
- ORACLE RMAN备份及还原 RMAN能够进行增量备份:数据库,表空间,数据文件
ORACLE RMAN备份及还原 RMAN能够进行增量备份:数据库.表空间.数据文件 仅仅有使用过的block能够被备份成backup set 表空间与数据文件相应关系:dba_data_file ...
- xtrabakcup基本用法 安装、全量备份恢复、增量备份恢复
xtrabackup备份原理以及工作流程 备份流程日志分析:1.##读取mysql配置文件2.## 扫描innodb日志lsn并复制inndodb系统表空间3.## 缓冲写出到数据文件并锁表4.## ...
- xtrabackup之Innobackupex增量备份及恢复
演示增量备份 #启动一个全备 innobackupex \ > --defaults-/my.cnf \ > --host=127.0.0.1 \ > --user=xtrabk \ ...
- ceph中rbd的增量备份和恢复
ceph中rbd的增量备份和恢复 ceph的文档地址:Ceph Documentation 在调研OpenStack中虚机的备份和恢复时,发现OpenStack和ceph紧密结合,使用ceph做O ...
- Oracle通过SCN做增量备份修复DG
DG由于网络原因或者bug原因经常不同步,有时隔得时间久了,就会丢失归档日志,或者长时间的归档恢复较慢,有一种可以基于scn的方式来恢复DG库,使用基于scn的增量备份来恢复standby库可以节省大 ...
- mysql全备和增量备份以及恢复过程(percona工具)
实验环境 系统环境,内核版本和xtrabackup工具版本 [root@linux-node1 mysql]# cat /etc/redhat-release CentOS Linux release ...
- 【mysql】使用xtrabackup在线增量备份及恢复数据库
一.Percona Xtrabackup 简介 1.Xtrabackup bin目录文件 介绍 1)innobackupex innobackupex 是xtrabackup的一个符号链接 . in ...
- innobackupex做MySQL增量备份及恢复【转】
创建备份用户 mysql> grant process,reload,lock tables,replication client on *.* to 'backup'@'localhost' ...
- 16、xtrabackup 增量备份及恢复
备份命令如下 备份命令如下 全量备份 # innobackupex -p123123 /backup # ls /backup 2017-04-08_13-36-11 增量备份或差量备份 # inn ...
随机推荐
- solr学习0
solr中文网,solr教程1,solr教程2,solr教程3 solr界面使用:文章1 windows安装solr:文章1,文章2 solr集群:文章1
- iOS推送的开启与关闭
开启: [[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationType ...
- C# 用this修饰符为原始类型扩展方法
特点:1.静态类 2.静态方法 3.第一个参数前加this 例如:public static List<T> ToList<T>(this string Json),就是为th ...
- hanzi 全拼音 qu de
Function pinyin(ByVal mystr As String, Optional types As Byte = 0) As StringDim temp As String, i ...
- [Bzoj3676][Apio2014]回文串(后缀自动机)(parent树)(倍增)
3676: [Apio2014]回文串 Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 3396 Solved: 1568[Submit][Statu ...
- Liunx 下Redis 的安装
一.Redis 的简介 Redis是一款开源的.高性能的键-值存储.它常被称作是一款数据结构服务器,它是一个key-value存储系统.和Memcache类似,Memecache只支持字符窜的数据类型 ...
- Java8期间及持续时间
原文:http://www.yiibai.com/java8/java8_periodduration.html 使用Java8,两个专门类引入来处理时间差. Period - 处理有关基于时间的日期 ...
- Thrift --- 支持双向通信
[问题] Thrift采用了C/S模型,不支持双向通信:client只能远程调用server端的RPC接口,但client端则没有RPC供server端调用,这意味着,client端能够主动与serv ...
- 【Todo】Java类面试题分析
Java 面试中的重要话题 多线程,并发及线程基础数据类型转换的基本原则垃圾回收(GC)Java 集合框架数组字符串GOF 设计模式SOLID (单一功能.开闭原则.里氏替换.接口隔离以及依赖反转)设 ...
- Codeforces Round #266 (Div. 2) C. Number of Ways
You've got array a[1], a[2], ..., a[n], consisting of n integers. Count the number of ways to split ...