事实上,RMAN备份的时候,如果是使用control file 来作catalog,那么一定要把control file和spfile恢复到另外的机器上面。

否则,会出现类似如下的错误:

原来的实例:

[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Apr 6 15:54:41 2014

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

connected to target database: ORCL (DBID=1370687811)

RMAN> backup tablespace users;

Starting backup at 06-APR-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 06-APR-14
channel ORA_DISK_1: finished piece 1 at 06-APR-14
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_nnndf_TAG20140406T155529_9n223km6_.bkp tag=TAG20140406T155529 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-APR-14

RMAN> quit

Recovery Manager complete.
[oracle@localhost ~]$

然后,如果我另外再安装一套oracle,会发生什么状况呢?

[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Apr 6 16:00:00 2014

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

connected to target database: ORCL (DBID=1371965186, not open)

RMAN> list backup;

using target database control file instead of recovery catalog
specification does not match any backup in the repository

RMAN> restore tablespace users from '/u01/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_nnndf_TAG20140406T155529_9n223km6_.bkp';

Starting restore at 06-APR-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/06/2014 16:00:38
RMAN-06509: only SPFILE or control file can be restored from AUTOBACKUP

RMAN>

一开始,我对上述的RMAN-06509非常不理解,后来参考了如下的网站,明白了错误所在。

http://www.doc88.com/p-900857827054.html

由于RMAN要依赖于catalog,当catalog是controle file的形式的时候,需要先把control file和spfile拿到新的数据库实例的对应的目录下,那样才可以继续进行restore/recover的活动。

***********************************************

接着我又进行了试验,看看把control file 挪过来回如何:

旧实例上:

RMAN> backup current controlfile;

Starting backup at 06-APR-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 06-APR-14
channel ORA_DISK_1: finished piece 1 at 06-APR-14
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_ncnnf_TAG20140406T213831_9n2p6rw4_.bkp tag=TAG20140406T213831 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-APR-14

RMAN>

在旧实例上:

RMAN> backup current controlfile;

Starting backup at 06-APR-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 06-APR-14
channel ORA_DISK_1: finished piece 1 at 06-APR-14
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_ncnnf_TAG20140406T213831_9n2p6rw4_.bkp tag=TAG20140406T213831 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-APR-14

RMAN>

[oracle@localhost ~]$ cd /u01/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/

[oracle@localhost 2014_04_06]$ cp o1_mf_ncnnf_TAG20140406T213831_9n2p6rw4_.bkp /u02/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/

然后,启动新实例

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 814227456 bytes
Fixed Size 2257640 bytes
Variable Size 528485656 bytes
Database Buffers 281018368 bytes
Redo Buffers 2465792 bytes
SQL>

[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Apr 6 21:45:09 2014

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

connected to target database: ORCL (not mounted)

RMAN>

开始恢复control file,进而得到备份集的信息:

RMAN> restore controlfile from '/u02/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_ncnnf_TAG20140406T213831_9n2p6rw4_.bkp';

Starting restore at 06-APR-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u02/app/oracle/oradata/orcl/control01.ctl
output file name=/u02/app/oracle/fast_recovery_area/orcl/control02.ctl
Finished restore at 06-APR-14

RMAN> list backup;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of list command at 04/06/2014 21:46:06
ORA-01507: database not mounted

RMAN> quit

********************************************************

SQL> alter database mount;

Database altered.

SQL>

[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Apr 6 21:46:42 2014

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

connected to target database: ORCL (DBID=1370687811, not open)

RMAN> list backup;

using target database control file instead of recovery catalog

List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 1.43M DISK 00:00:00 06-APR-14
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20140406T155529
Piece Name: /u01/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_nnndf_TAG20140406T155529_9n223km6_.bkp
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 Full 988907 06-APR-14 /u01/app/oracle/oradata/orcl/users01.dbf

RMAN>

这些个信息里面记的都是旧实例所拥有的位置信息。

再试验看:

RMAN> list backup;

using target database control file instead of recovery catalog

List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 1.43M DISK 00:00:00 06-APR-14
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20140406T155529
Piece Name: /u01/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_nnndf_TAG20140406T155529_9n223km6_.bkp
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 Full 988907 06-APR-14 /u01/app/oracle/oradata/orcl/users01.dbf

RMAN> restore tablespace users from '/u01/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_nnndf_TAG20140406T155529_9n223km6_.bkp';

Starting restore at 06-APR-14
Starting implicit crosscheck backup at 06-APR-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 06-APR-14

Starting implicit crosscheck copy at 06-APR-14
using channel ORA_DISK_1
Finished implicit crosscheck copy at 06-APR-14

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u02/app/oracle/fast_recovery_area/ORCL/backupset/2014_04_06/o1_mf_ncnnf_TAG20140406T213831_9n2p6rw4_.bkp
File Name: /u02/app/oracle/fast_recovery_area/ORCL/archivelog/2014_04_06/o1_mf_1_3_9n22917q_.arc

using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/06/2014 21:56:09
RMAN-06509: only SPFILE or control file can be restored from AUTOBACKUP

RMAN>

因为新旧实例不同,所以会出问题。

不成功的RMAN恢复到其他机器的例子的更多相关文章

  1. oracle rman恢复数据库 方式恢复到异地数据库

    目的:从某个环境中,获取相关文件,放到异地机器使用rman 恢复.   情况说明:XX系统使用的是oracle数据库,现已从服务器拉下来相关文件,依靠这些文件来早本地的测试机上恢复数据库,方便进行数据 ...

  2. 利用RMAN恢复整个数据库

    利用RMAN恢复整个数据库案例一 适合场合:恢复的目录一致,同时备份的过程中有归档日志 恢复的数据库目录和down机的数据库一致,还有一个就是RMAN备份的时候已经备份了归档日志. 备份脚本: run ...

  3. RAC+asm通过rman恢复到单实例+asm

    1.恢复参数文件,并修改参数文件 参数文件指名几个最简单的就行,我的参数文件如下: 2.恢复控制文件,并启动数据库到mount 如果是把备份集从别的服务器拷贝到本地恢复的服务器的目录,使用下面的语句指 ...

  4. rman catalog (rman 恢复目录)

    受控制文件大小的限制,一般rman需要用rman catalog来管理及存放备份信息: 这里介绍一下创建rman catalog的步骤: C:\Documents andSettings\Admini ...

  5. Oracle DB 使用RMAN恢复目录

    • 对恢复目录和RMAN 资料档案库控制文件的使用进行比较• 创建和配置恢复目录• 在恢复目录中注册数据库• 同步恢复目录• 使用RMAN 存储脚本• 备份恢复目录• 创建虚拟专用目录 RMAN 资料 ...

  6. rman恢复方案和oracle异机恢复

    这篇文章主要介绍了rman恢复方案和oracle异机恢复,需要的朋友可以参考下 注:①恢复的前提是已经做好备份②完全恢复数据库是数据库遇到故障,在恢复时候没有丢失任何已经提交事物数据的恢复不完全恢复数 ...

  7. Oracle Rman恢复

    (转自:http://blog.chinaunix.net/uid-14779297-id-1988309.html) RMAN的基本概念 Target Database:就是需要RMAN对其进行备份 ...

  8. 在rman恢复中incarnation的概念

    摘要 本文主要介绍incarnation的由来,在rman恢复中的作用,以及相关rman恢复的注意事项. 概念说明 从10g开始,incarnation被引入,用于跨越resetlogs进行恢复,由此 ...

  9. Oracle RMAN 恢复控制文件到指定的路径

    Oracle 数据库通过RMAN恢复控制文件到指定的路径 --------------------------------------------------------- 先查询备份集信息,再指定备 ...

随机推荐

  1. node socket :10106无法加载或初始化请求的服务提供程序

    node socket :10106无法加载或初始化请求的服务提供程序 无端端的,不知道怎么回事,node突然就坏掉 了,应该是某些配置无意中改动了,问题如下: 目前能想到的解决办法就是:重置配置,用 ...

  2. RecyclerView-- 侧滑删除和拖动排序

    实现这么个功能我们不需要再去继承RecyclerView,只需要去了解ItemTouchHelper这个类即可,接下来我们就去看看都有些什么 ItemTouchHelper.Callback 默认需要 ...

  3. Android网络编程系列之Volley总结

    前言 Volley的中文翻译为“齐射.并发”,是在2013年的Google大会上发布的一款Android平台网络通信库,具有网络请求的处理.小图片的异步加载和缓存等功能,能够帮助 Android AP ...

  4. SQL Server 合并复制遇到identity range check报错的解决 (转载)

    最近帮一个客户搭建跨洋的合并复制,由于数据库非常大,跨洋网络条件不稳定,因此只能通过备份初始化,在初始化完成后向海外订阅端插入数据时发现报出如下错误: Msg 548, Level 16, State ...

  5. 表的垂直拆分和水平拆分-zz

    https://www.kancloud.cn/thinkphp/mysql-design-optimalize/39326 http://www.cnblogs.com/nixi8/tag/mysq ...

  6. Oracle 密码失灵

    java.sql.SQLException: ORA-28001: 密碼已經屆滿 at oracle.jdbc.driver.DatabaseError.throwSqlException(Datab ...

  7. python下以api形式调用tesseract识别图片验证码

    一.背景 之前在博文中介绍在python中如何调用tesseract ocr引擎,当时主要介绍了shell模式,shell模式需要安装tesseract程序,并且效率相对略低. 今天介绍api形式的调 ...

  8. [Spark Core] Spark 使用第三方 Jar 包的方式

    0. 说明 Spark 下运行job,使用第三方 Jar 包的 3 种方式. 1. 方式一 将第三方 Jar 包分发到所有的 spark/jars 目录下 2. 方式二 将第三方 Jar 打散,和我们 ...

  9. [IDEA_2] IDEA 问题合集

    1. IDEA 通过 Maven 导入的依赖包下面存在红色波浪线 问题描述: 创建的 Maven Project 在添加相关依赖后自动下载,自动添加的依赖包的下面存在红色波浪线,在使用过程中存在问题, ...

  10. 【转】Java学习---Java核心数据结构(List,Map,Set)使用技巧与优化

    [原文]https://www.toutiao.com/i6594587397101453827/ Java核心数据结构(List,Map,Set)使用技巧与优化 JDK提供了一组主要的数据结构实现, ...