标签:完成 ber 命令 span eps option seq with sed
How To Restore Rman Backups On A Different Node When The Directory Structures Are Different (Doc ID 419137.1)
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***
Restoring Rman backup on a different node with different backup directory structures and different database directory structures .
在具有不同备份目录结构和不同数据库目录结构的不同节点上还原Rman备份
ASSUMPTIONS 假设
-----------------------
$ 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
+ 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
user_dump_dest = background_dump_dest = control_files =
$ 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
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
RMAN > alter database mount
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‘;
使用以下命令了解archivelog备份中的最后一个可用sequence,这将有助于我们恢复数据库直到该archivelog
RMAN > list backup of archivelog all; Let us assume the last sequence of last archivelog in the backup is 50.
重命名Redolog,以便在resetlogs打开数据库时可以在新位置创建它们
SQL> alter database rename file ‘/<node1 path>/data/redo01.log‘ to ‘/<node2 path>/data/redo01.log‘; ...... ...... ......
现在将数据文件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; }
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;
NOTE:228257.1 - RMAN ‘Duplicate Database‘ Feature in Oracle9i / 10G and 11G
NOTE:73974.1 - RMAN: Restoring an RMAN Backup to Another Node
标签:完成 ber 命令 span eps option seq with sed
原文地址:https://www.cnblogs.com/zylong-sys/p/11990436.html