这里记录一下流程,有我和同事问心进行测试

dataguard主库和物理备库主要是controlfile文件有区别,用restore可以查看含有primary,standby关键字
RMAN> restore ;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "archivelog, channel, check, controlfile, database, datafile, device, force, from, high, preview, primary, skip readonly, spfile, standby, tablespace, to restore point, until restore point, until, validate, ("
RMAN-01007: at line 1 column 9 file: standard input

RMAN> restore primary;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "controlfile"
RMAN-01007: at line 1 column 16 file: standard input

利用物理备库rman备份文件恢复过程:

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1043886080 bytes
Fixed Size                  2259840 bytes
Variable Size             775947392 bytes
Database Buffers          260046848 bytes
Redo Buffers                5632000 bytes

[oracle@std]$ rman target/

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Sep 26 15:09:14 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DG (not mounted)

RMAN> restore primary controlfile from '/u01/app/oracle/product/11.2.0/dbhome1/dbs/c-1832575162-20160926-01';

Starting restore at 26-SEP-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/dg/control01.ctl
output file name=/u01/app/oracle/oradata/dg/control02.ctl
Finished restore at 26-SEP-16

RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

SQL> select open_mode,database_role from v$database;

OPEN_MODE                                                    DATABASE_ROLE
------------------------------------------------------------ ------------------------------------------------
MOUNTED                                                      PRIMARY

RMAN> restore database;

Starting restore at 26-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/dg/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/dg/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/dg/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/dg/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/dg/example01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/dg/lieb01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/19rgpgsu_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/19rgpgsu_1_1 tag=TAG20160926T145629
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:56
Finished restore at 26-SEP-16

RMAN> recover database;

Starting recover at 26-SEP-16
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 0 is already on disk as file /u01/app/oracle/oradata/dg/redo03.log
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=19
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/18rgpgss_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/18rgpgss_1_1 tag=TAG20160926T145628
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/home/oracle/archivelog/DG/1_19_922121441.dbf thread=1 sequence=19
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=20
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome1/dbs/1argph09_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome1/dbs/1argph09_1_1 tag=TAG20160926T145817
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/home/oracle/archivelog/DG/1_20_922121441.dbf thread=1 sequence=20
unable to find archived log
archived log thread=1 sequence=21
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/26/2016 15:20:49
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 21 and starting SCN of 1402274

SQL> alter database open resetlogs;

Database altered.

SQL> select open_mode,database_role from v$database;

OPEN_MODE            DATABASE_ROLE
-------------------- ----------------
READ WRITE           PRIMARY

作者微信:


ORACLE利用STANDBY端RMAN备份进行数据恢复相关推荐

  1. oracle 9i故障恢复,Oracle9i rman备份恢复总结

    Recovery Manager(RMAN)是一种用于备份(backup).还原(restore)和恢复(recover)数据库的Oracle 工.RMAN只能用于ORACLE8或更高的版本中.它能够 ...

  2. oracle mseq,一次RMAN备份报错的诊断过程(一)

    今天检查数据库中的备份输出脚本时,发现RMAN备份出现了错误. 这一篇主要描述问题的现象. 错误信息如下: bash-3.00$ more /data/backup/backup_tradedb_09 ...

  3. Oracle数据库 之 删除RMAN备份

    #su – oracle 切换至存放备份的目录,删除不需要的备份文件. $export ORACLE_SID=orcl $rman RMAN>connect target / RMAN>c ...

  4. oracle backup arch,ORCLE RMAN备份脚本

    1.Linux下oracle备份脚本 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/11. ...

  5. oracle数据泵和rman备份区别,IMP/EXP,数据泵,SQL*Loader ,rman,oracle数据库备份

    数据库的逻辑备份和恢复:exp和imp 1.导库:导出和导入整个数据库 2.导表空间:导出和导入表空间 3.导表用户:导出和导入用户中所有对象 4.导表:导出和导入表或表分区 (1)commit=y ...

  6. 一图秒懂:打开oracle归档模式,rman备份的前提条件

  7. oracle10默认备份路径,oracle 10g RMAN备份及恢复

    Oracle  10G数据库 使用rman备份(裸设备管理) 1检查数据库模式: oracle@yangzai ~]$uniread sqlplus / as sysdba [uniread] Loa ...

  8. Oracle DataGuard standby库日常管理(zt)

    一.日常管理 1.1 备用服务器的管理模式与只读模式 1.启动到管理模式 SQL>shutdown immediate SQL>startup nomount pfile=?/dbs/in ...

  9. oracle standby同步,ORACLE 利用rman增量备份同步standby库

    standby库归档日志断档,故standby库不能利用恢复归档日志和生产库保持同步,因生产库有1T多,重拉数据将非常耗时,遂利用RMAN对生产库进行增量备份,将增量备份集合成到standby库,利用 ...

最新文章

  1. gulp打包js/css时合并成一个文件时的顺序解决
  2. java对象交互_Java 2 对象交互
  3. RESTful Web 服务 - 介绍
  4. 剑桥毕业之后创业的可能的在商学院的出路
  5. 关于kafka中的timestamp与offset的对应关系
  6. 《天天数学》连载09:一月九日
  7. php memcached 例子,php下Memcached入门实例解析
  8. Java基础学习总结(127)——Java方法应该返回空对象还是null
  9. Sql Server 2005“该用户与可信的SQL SERVER 连接无关联”解决方法
  10. [网络安全自学篇] 九十四.《Windows黑客编程技术详解》之提权技术(令牌权限提升和Bypass UAC)
  11. Linux获取电信超级密码,电信光猫-华为HG8245C获取超级管理员密码
  12. 怎么改自己手机的ip地址
  13. HYPERLEDGER FABRIC-CA学习
  14. 基于XBee3 zigbee Micropython编程指南
  15. web前端作业--响应式美食菜谱网页设计(HTML+CSS+JavaScript+)实现
  16. Python脚本操作Excel实现批量替换
  17. riak mysql_[Translate] 从SQL数据库迁移到Riak
  18. 价值投资私募基金三人谈
  19. 基于诱捕的软件异常检测综述
  20. Node.js中exports、module.exports、require之间的关系

热门文章

  1. window程序设计学会_是时候我们学会设计合适的饼图了
  2. 面试官是怎样高效面试的(面试官的“套路”
  3. 给3月要跳槽的前端提个醒!不了解微前端就别去面试了,不然……
  4. 听说你对 ES6 class 类还不是很了解
  5. 回答知乎问题:你写过什么自认为惊艳的诗?
  6. 非对称加密算法RSA加密传输数据python3源代码实现
  7. Java 9进入第一轮问题修复阶段
  8. 如何快速编写并运行Tiny模板语言?
  9. Xcode4.5编译ffmpeg成功,过程说明
  10. Master DNS服务的搭建