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 ...
随机推荐
- NGUI中以添加摄像机的方式实现SCROLL LIST
1.添加多一个UI ROOT对象 2.把CAMERAER对象移至ROOT对象成为其直接子对象, 3.为CAMERAER对象添加UIVIEWPORT组件,并把其SOURCE CAMERA设置为主相机,设 ...
- UIApplicationDelegate详解
每 个iPhone应用程序都有一个UIApplication,UIApplication是iPhone应用程序的开始并且负责初始化并显示 UIWindow,并负责加载应用程序的第一个UIView到U ...
- (12)centos之stmp服务器
yum remove sendmail #卸载sendmail
- CentOS6、CentOS7配置Base源和epel源
1.用yum安装软件报错 Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&a ...
- PHP实现INT型,SHORT型,STRING转换成BYTE数组
实现PHP实现INT型,SHORT型,STRING转换成BYTE数组的转化: class Bytes { public static function integerToBytes($val) { $ ...
- 微信小程序 项目实战(二)board 首页
1.项目结构 2.页面 (1)数据(逻辑) board.js // pages/board/board.js Page({ /** * 页面的初始数据 */ data: { imgWrap: [] } ...
- 封装算法: 模板方法(Template Method)模式
template method(模板方法)模式是一种行为型设计模式.它在一个方法中定义了算法的骨架(这种方法被称为template method.模板方法),并将算法的详细步骤放到子类中去实现.tem ...
- [LeetCode][Java] Longest Common Prefix
题目: Write a function to find the longest common prefix string amongst an array of strings. 题意: 写出一个函 ...
- 数据存储 --《高性能JavaScript》
1.数据存储的方式 1.字面量 2.变量 3.数组项 4.对象成员 2.各自的性能特点 1.访问字面量和局部变量的速度最快,访问数组项和对象成员相对较慢 2.由于局部变量在作用域链的起始位置,因此访问 ...
- 加载和执行 --《高性能JavaScript》
1.起因: 每次遇到<script> 标签时,页面必须停下来等待代码下载并执行完,然后再继续处理其他部分. 2.减少JavaScript对性能的影响 1.将所有的JavaScript文件放 ...