试验计划:先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恢复----通过增量备份来恢复的更多相关文章

  1. ORACLE RMAN备份及还原 RMAN能够进行增量备份:数据库,表空间,数据文件

    ORACLE RMAN备份及还原   RMAN能够进行增量备份:数据库.表空间.数据文件 仅仅有使用过的block能够被备份成backup set 表空间与数据文件相应关系:dba_data_file ...

  2. xtrabakcup基本用法 安装、全量备份恢复、增量备份恢复

    xtrabackup备份原理以及工作流程 备份流程日志分析:1.##读取mysql配置文件2.## 扫描innodb日志lsn并复制inndodb系统表空间3.## 缓冲写出到数据文件并锁表4.## ...

  3. xtrabackup之Innobackupex增量备份及恢复

    演示增量备份 #启动一个全备 innobackupex \ > --defaults-/my.cnf \ > --host=127.0.0.1 \ > --user=xtrabk \ ...

  4. ceph中rbd的增量备份和恢复

    ceph中rbd的增量备份和恢复 ceph的文档地址:Ceph Documentation ​ 在调研OpenStack中虚机的备份和恢复时,发现OpenStack和ceph紧密结合,使用ceph做O ...

  5. Oracle通过SCN做增量备份修复DG

    DG由于网络原因或者bug原因经常不同步,有时隔得时间久了,就会丢失归档日志,或者长时间的归档恢复较慢,有一种可以基于scn的方式来恢复DG库,使用基于scn的增量备份来恢复standby库可以节省大 ...

  6. mysql全备和增量备份以及恢复过程(percona工具)

    实验环境 系统环境,内核版本和xtrabackup工具版本 [root@linux-node1 mysql]# cat /etc/redhat-release CentOS Linux release ...

  7. 【mysql】使用xtrabackup在线增量备份及恢复数据库

    一.Percona Xtrabackup 简介 1.Xtrabackup  bin目录文件 介绍 1)innobackupex innobackupex 是xtrabackup的一个符号链接 . in ...

  8. innobackupex做MySQL增量备份及恢复【转】

    创建备份用户 mysql> grant process,reload,lock tables,replication client on *.* to 'backup'@'localhost' ...

  9. 16、xtrabackup 增量备份及恢复

    备份命令如下 备份命令如下 全量备份 #  innobackupex -p123123 /backup # ls /backup 2017-04-08_13-36-11 增量备份或差量备份 # inn ...

随机推荐

  1. [MFC] CString小用例

    在实际项目中需要对数字转成的字符串进行格式处理, 如: 50.500000,需要转化成50.5; 1.00000,需要转化成1, 对于编号而言要求都是4位,不足前面补0. 如1转成0001,222转成 ...

  2. python 之递归及冒泡排序

    一.递归函数 在函数内部,可以调用其他函数,如果一个函数在内部调用本身,这个函数就是递归函数 1.递归的基本原理: 每一次函数调用都会有一次返回.当程序流执行到某一级递归的结尾处时,它会转移到前一级递 ...

  3. HUNAN 11560 Yangyang loves AC(二分+贪心)

    http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11560&courseid=0 题意:总共有n天,每天 ...

  4. python学习笔记——递归算法

    阶乘 #递归计算阶乘 def factorial(n): if n == 1: return 1 return n*factorial(n-1) result = factorial(6) print ...

  5. iOS开发 浅见runloop

    Runloop是线程相关的的基础框架的一部分.一个 run loop 就是一个事件处理 的循环,用来不停的调度工作以及处理输入事件. 使用Runloop的目的是让线程有任务时去处理,没任务就让它处于休 ...

  6. BUPT复试专题—图像识别(2014-2)

    题目描述 在图像识别中,我们经常需要分析特定图像中的一些特征,而其中很重要的一点就是识别出图像的多个区域.在这个问题中,我们将给定一幅N xM的图像,其中毎个1 x 1的点都用一个[0, 255]的值 ...

  7. POJ 1151 HDU 1542 Atlantis(扫描线)

    题目大意就是:去一个地方探险,然后给你一些地图描写叙述这个地方,每一个描写叙述是一个矩形的右下角和左上角.地图有些地方是重叠的.所以让你求出被描写叙述的地方的总面积. 扫描线的第一道题,想了又想,啸爷 ...

  8. 一套扁平化界面风格的flex 皮肤

    意外在git上发现这个项目.似乎刚開始不久.部分控件的新皮肤似乎还没完毕.只是个人感觉挺不错的.大家认为呢? =>git地址:https://github.com/akamud/FlatSpar ...

  9. effctive C++ 读书笔记 条款 16

    条款16 成对使用new和delete时要採取同样形式 #include <iostream> #include <string> using namespace std; / ...

  10. Do not use the <section> element as a generic container; this is what <div> is for, especially when the sectioning is only for styling purposes.

    Do not use the <section> element as a generic container; this is what <div> is for, espe ...