How To Restore Rman Backups On A Different Node When The Directory Structures Are Different (Doc ID 419137.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Information in this document applies to any platform.
***Checked for relevance on 20-July-2015***

GOAL

Restoring Rman backup on a different node with different backup directory structures and different database directory structures .
在具有不同备份目录结构和不同数据库目录结构的不同节点上还原Rman备份

++ Rman backup of database is done on NODE 1.  数据库的RMAN备份是节点1进行
++ The database has to be has to be restored from the Rman backup on NODE 2.  该数据库必须是已经被从RMAN备份中恢复节点2
++ The directory structures for the backups and the database files are different on NODE 2.  用于备份的目录结构和数据库文件在节点2不同
++ The Rman backups have to put in new directory structure on NODE 2 unlike as they were on NODE 1.  Rman备份必须在NODE 2上放入新的目录结构,这与在NODE 1上不同。
++ Also the database has to be restored to a different directory structure on NODE 2.  同样,数据库也必须还原到NODE 2上的其他目录结构

SOLUTION

ASSUMPTIONS  假设
-----------------------

++ The backups on NODE 1 are done to '/<node1 path>/backup'  NODE 1上的备份完成到 '/<node1 path>/backup' 
++ The database files on NODE 1 are in '/<node1 path>/data'  NODE 1上的数据库文件位于'/<node1 path>/data'
++ The backups on NODE 2 will be in location '/<node2 path>/backup'  NODE 2上的备份将位于'/<node2 path>/backup'
++ The database files on NODE 2 will be restored to '/<node2 path>/data'  NODE 2上的数据库文件将还原到'/<node2 path>/data'

Steps to acheive the goal:  实现目标的步骤

1) Connect to the target database using rman and backup the database ---> ON NODE 1

$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Feb 13 00:29:33 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: <DB_NAME> (DBID=3932056136) RMAN> backup database plus archivelog; Starting backup at 13-FEB-07
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=143 recid=109 stamp=614392105
channel ORA_DISK_1: starting piece 1 at 13-FEB-07
channel ORA_DISK_1: finished piece 1 at 13-FEB-07
piece handle=/<node1 path>/backup/o1_mf_annnn_TAG20070213T002825_2x21kbds
_.bkp tag=TAG20070213T002825 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 13-FEB-07 Starting backup at 13-FEB-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00003 name=/<node1 path>/data/sysaux01.dbf
input datafile fno=00001 name=/<node1 path>/data/system01.dbf
input datafile fno=00002 name=/<node1 path>/data/undotbs01.dbf
input datafile fno=00004 name=/<node1 path>/data/users01.dbf
input datafile fno=00005 name=/<node1 path>/data/1.dbf
input datafile fno=00006 name=/<node1 path>/data/sysaux02.dbf
input datafile fno=00007 name=/<node1 path>/data/undotbs02.dbf
channel ORA_DISK_1: starting piece 1 at 13-FEB-07
channel ORA_DISK_1: finished piece 1 at 13-FEB-07
piece handle=/<node1 path>/backup/o1_mf_nnndf_TAG20070213T002827_2x21kd12
_.bkp tag=TAG20070213T002827 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 13-FEB-07 Starting backup at 13-FEB-07
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=144 recid=110 stamp=614392165
channel ORA_DISK_1: starting piece 1 at 13-FEB-07
channel ORA_DISK_1: finished piece 1 at 13-FEB-07
piece handle=/<node1 path>/backup/o1_mf_annnn_TAG20070213T002925_2x21m6ty
_.bkp tag=TAG20070213T002925 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 13-FEB-07 Starting Control File and SPFILE Autobackup at 13-FEB-07
piece handle=/<oracle_home>/dbs/c-3932056136-20070213-02 comment=NONE
Finished Control File and SPFILE Autobackup at 13-FEB-07 RMAN> exit

2) Move the following files to the NODE 2:  将以下文件移至NODE 2

+ The database backup pieces to location '/<node2 path>/backup'
+ Controlfile backup piece to the location '/<node2 path/backup'
+ The parameter file i.e init.ora file to the default location i.e $ORACLE_HOME/dbs

3) Edit the PFILE on NODE 2 to change the environment specific parameters like .

user_dump_dest =
background_dump_dest =
control_files =

4) Once the PFILE is suitably modified invoke Rman on the NODE 2 after setting the Oracle environment variables and start the database in nomount mode:  

$ export ORACLE_HOME=/<oracle_home>
$ export ORACLE_SID=<oracle_sid>
$ export PATH=$ORACLE_HOME/bin:$PATH
$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Feb 13 00:36:55 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount
Oracle instance started
Total System Global Area 205520896 bytes
Fixed Size 1218508 bytes
Variable Size 75499572 bytes
Database Buffers 121634816 bytes
Redo Buffers 7168000 bytes

5) Restore the controlfile from the backup piece.

RMAN> restore controlfile from  '/<node2 path/backup/c-3932056136-20070213-02';
Starting restore at 13-FEB-07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete,
elapsed time: 00:00:02
output filename=/<node2 path/data/control01.ctl
Finished restore at 13-FEB-07

6) Mount the database

RMAN > alter database mount

7) Now catalog the backup pieces that were shipped from NODE 1

RMAN> catalog backuppiece '/<node2 path/backup/o1_mf_annnn_TAG20070213T002925_2x21m6ty_.bkp';
RMAN> catalog backuppiece '/<node2 path/backup/o1_mf_annnn_TAG20070213T002825_2x21kbds_.bkp';
RMAN> catalog backuppiece '/<node2 path/backup/o1_mf_nnndf_TAG20070213T002827_2x21kd12_.bkp';
This feature of cataloging backup pieces is available from ORACLE 10g versions. Prior to Oracle 10g we were not able to catalog the backup pieces. For more information on cataloging options refer the metalink note 470463.1   
从ORACLE 10g版本可以使用对备份件进行catalog。在Oracle 10g之前,我们无法对备份文件进行catalog。有关catalog选项的更多信息,请参阅 metalink note 470463.1 

8) Get to know the last sequence available in the archivelog backup using the following command.This will help us in recovering the database till that archivelog.

使用以下命令了解archivelog备份中的最后一个可用sequence,这将有助于我们恢复数据库直到该archivelog

RMAN > list backup of archivelog all;
Let us assume the last sequence of last archivelog in the backup is 50.

9) Rename the Redolog files,so that they can be created in new locations when opened the database is opened in resetlogs

重命名Redolog,以便在resetlogs打开数据库时可以在新位置创建它们

SQL> alter database rename file '/<node1 path>/data/redo01.log' to '/<node2 path>/data/redo01.log';
......
......
......

10) Now restore the datafiles to new locations and recover. Since we are recovering the database here till the archivelog sequence 50 the sequence number in the SET UNTIL SEQUENCE clause

现在将数据文件restore到新位置并recover。由于我们在此处recover数据库,直到存档日志序列50为止,SET UNTIL SEQUENCE 子句中的序列号

RMAN> run
{
set until sequence 51;
set newname for datafile 1 to '/<node2 path>/data/sys01.dbf';
set newname for datafile 2 to '/<node2 path>/data/undotbs01.dbf';
set newname for datafile 3 to '/<node2 path>/data/sysaux01.dbf';
set newname for datafile 4 to '/<node2 path>/data/users01.dbf';
set newname for datafile 5 to '/<node2 path>/data/1.dbf';
set newname for datafile 6 to '/<node2 path>/data/sysaux02.dbf';
set newname for datafile 7 to '/<node2 path>/data/undotbs02.dbf';
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
}
If we are restoring the Rman backups  from tapes,then we should ensure the same media manager variables that were used during backups are maintained during restore too. 
如果我们要从磁带还原Rman备份,那么我们应该确保在还原过程中也保持与备份期间使用的介质管理器变量相同的方式。
The below article gives the information of various media manager Environment Variables. 
下面的文章提供了各种媒体管理器环境变量的信息
NOTE.312737.1 RMAN and Specific Media Managers Environment Variables.

11) Confirm your tempfiles 

Confirm the location of your tempfiles, recreate them at the new location if required:

确认tempfiles的位置,如果需要,请在新位置重新创建它们

SQL> select * from v$tempfile;
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE 'new tempfile path filename' REUSE;

REFERENCES

NOTE:228257.1 - RMAN 'Duplicate Database' Feature in Oracle9i / 10G and 11G
NOTE:73974.1 - RMAN: Restoring an RMAN Backup to Another Node

How To Restore Rman Backups On A Different Node When The Directory Structures Are Different (Doc ID 419137.1)的更多相关文章

  1. How to restore and recover a database from an RMAN backup. (Doc ID 881395.1)

    APPLIES TO: Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.2 [Release 10.1 to 11. ...

  2. 如何将RAC数据库的 RMAN Disk 备份 Restore 到另一个节点上的单个实例 (Doc ID 415579.1)

    HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node (Doc ID 415579.1) ...

  3. Checklist for an RMAN Restore (Doc ID 1554636.1)

    Checklist for an RMAN Restore (Doc ID 1554636.1) APPLIES TO: Oracle Database - Enterprise Edition - ...

  4. RMAN RECOVER TABLE 功能是 Oracle Database 12c 的新增功能 (Doc ID 1521524.1)

    RMAN RECOVER TABLE Feature New to Oracle Database 12c (Doc ID 1521524.1) APPLIES TO: Oracle Database ...

  5. Rman Enhancements(增强) In Oracle 11g. (Doc ID 1115423.1)

    Rman Enhancements In Oracle 11g. (Doc ID 1115423.1) APPLIES TO: Oracle Database - Enterprise Edition ...

  6. ORA-4031 During Startup Nomount using RMAN without parameter file (PFILE) (Doc ID 1176443.1)

    ORA-4031 During Startup Nomount using RMAN without parameter file (PFILE) (Doc ID 1176443.1) APPLIES ...

  7. 如何使用块更改跟踪文件估算RMAN增量备份大小 (Doc ID 1938079.1)

    How to estimate RMAN incremental backup size using block change tracking file (Doc ID 1938079.1) APP ...

  8. RMAN DUPLICATE DATABASE with SET NEWNAME failed: RMAN-05501 RMAN-05517 (Doc ID 387093.1)

    RMAN DUPLICATE DATABASE with SET NEWNAME failed: RMAN-05501 RMAN-05517 (Doc ID 387093.1) APPLIES TO: ...

  9. RMAN 'Duplicate From Active Database' Feature in Oracle11g (Doc ID 452868.1)

    RMAN 'Duplicate From Active Database' Feature in Oracle11g (Doc ID 452868.1) APPLIES TO: Oracle Data ...

随机推荐

  1. axios解决跨域问题(vue-cli3.0)

    一.什么是跨域 1.跨域 指的是浏览器不能执行其他网站的脚本.它是由浏览器的同源策略造成的,是浏览器对javascript施加的安全限制. 2.同源策略 是指协议,域名,端口都要相同,其中有一个不同都 ...

  2. JS---part2课程介绍+part1复习

    part1复习 JavaScript分三个部分: 1. ECMAScript标准----JS基本的语法 2. DOM:Document Object Model 文档对象模型 3. BOM:浏览器对象 ...

  3. Dynamics 365 Customer Engagement导入解决方案时出错:Microsoft.Crm.CrmException: Plug-in assembly does not contain the required types or assembly content cannot be updated.

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  4. Windows下Kafka 2.3.0的下载和安装

    Kafka是由Apache软件基金会开发的一个开源流处理平台,是一种高吞吐量的分布式发布订阅消息系统,它可以处理消费者在网站中的所有动作流数据. 特性:(1)通过O(1)的磁盘数据结构提供消息的持久化 ...

  5. How to use special characters in XML?

    https://dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.html Because X ...

  6. CODING 2.0 服务升级:一站式服务体系助力企业研发上云

    近日,CODING 在 KubeCon 2019 上海站上正式推出了 DevOps 的一站式解决方案: CODING 2.0,除了进行 产品 及 产品理念 的升级,还对用户服务进行了整体升级,主要涵盖 ...

  7. MySQL 学习笔记 (一)

    1.InnoDB and Online DDL ALTER TABLE tbl_name ADD PRIMARY KEY (column), ALGORITHM=INPLACE, LOCK=NONE; ...

  8. OS X 下 OpenGL 4.x 环境配置

    配置: OS X 10.10 + CMake 3.2.2 + GLFW 3.1.1 + OpenGL 4.1 + Xcode 6.0 本文主要介绍如何在 OS X 系统下进行环境配置,使得 Xcode ...

  9. js中自执行函数(function(){})()和(function(){}())区别

    方式一,调用函数,得到返回值.强制函数直接量执行再返回一个引用,引用在去调用执行方式二,调用函数,得到返回值.强制运算符使函数调用执行(function(){})(); 是 把函数当作表达式解析,然后 ...

  10. java之Objects类

    Objects类概述 在JDK7添加了一个Objects工具类,它提供了一些方法来操作对象,它由一些静态的实用方法组成,这些方法是null-save(空指针安全的)或null-tolerant(容忍空 ...