实验环境:Oracle Version:11gR2 System:IBM AIX 5LTarget Database:orcl Auxiliary Database:orclNOTE:(1)RMAN 异机恢复的时候,db_name必须相同。如果说要想改成其他的实例名,可以在恢复成功后,用nid 命令修改。实例名的信息会记录到控制文件里,所以如果在恢复的时候,如果实例名不一致,恢复的时候会报错。 (2)如果恢复的路径和源库不一致,就需要在restore时用set 命令指定新位置。并且使用switch datafile all将信息更新到控制文件中。在做duplicate的时候,RMAN 会自动根据pfile中的log_file_name_convert和db_file_name_convert来进行set 的转换。手工restore时,只能使用set 命令转换。(3)异机恢复对相同目录和不同目录都做了说明。(4)最后测试了NID 修改DBID 和DBNAME. 实验步骤:一. Target库准备工作:1. 查询DBID$ sqlplus /nologSQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 11 19:56:08 2011Copyright (c) 1982, 2009, Oracle. All rights reserved.idle> conn /as sysdbaConnected.sys@ORCL> select name,dbid from v$database;NAME DBID-------------------------------------------------- ----------ORCL 12759596222. 备份Target Database$ rman target sys/oracle@orclRecovery Manager: Release 11.2.0.1.0 - Production on Mon Apr 11 19:59:34 2011Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.connected to target database: ORCL (DBID=1275959622)准备一个0级和1级备份:RMAN> RUN {2> allocate channel c1 type disk;3> allocate channel c2 type disk;4> backup incremental level=0 skip inaccessible filesperset 5 database format="/u02/backup/orcl_lev0_%U_%T" tag="orcl_lev0";5> sql "alter system archive log current";6> backup archivelog all tag="arc_bak" format="/u02/backup/arch_%U_%T" skip inaccessible filesperset 5 not backed up 1 times delete input;7> backup current controlfile tag="bak_ctlfile" format="/u02/backup/ctl_file_%U_%T";8> backup spfile tag="spfile" format="/u02/backup/ORCL_spfile_%U_%T";9> release channel c2;10> release channel c1;11> }allocated channel: c1channel c1: SID=198 device type=DISKallocated channel: c2channel c2: SID=10 device type=DISKStarting backup at 11-APR-11channel c1: starting incremental level 0 datafile backup setchannel c1: specifying datafile(s) in backup setinput datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbfinput datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbfinput datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbfchannel c1: starting piece 1 at 11-APR-11channel c2: starting incremental level 0 datafile backup setchannel c2: specifying datafile(s) in backup setinput datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbfinput datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbfchannel c2: starting piece 1 at 11-APR-11channel c1: finished piece 1 at 11-APR-11piece handle=/u02/backup/orcl_lev0_0km9hi1b_1_1_20110411 tag=ORCL_LEV0 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:03channel c2: finished piece 1 at 11-APR-11piece handle=/u02/backup/orcl_lev0_0lm9hi1b_1_1_20110411 tag=ORCL_LEV0 comment=NONEchannel c2: backup set complete, elapsed time: 00:00:03Finished backup at 11-APR-11Starting Control File and SPFILE Autobackup at 11-APR-11piece handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup/2011_04_11/o1_mf_s_748210222_6t79my7k_.bkp comment=NONEFinished Control File and SPFILE Autobackup at 11-APR-11sql statement: alter system archive log currentStarting backup at 11-APR-11current log archivedchannel c1: starting archived log backup setchannel c1: specifying archived log(s) in backup setinput archived log thread=1 sequence=11 RECID=6 STAMP=748188047channel c1: starting piece 1 at 11-APR-11channel c2: starting archived log backup setchannel c2: specifying archived log(s) in backup setinput archived log thread=1 sequence=12 RECID=7 STAMP=748210223input archived log thread=1 sequence=13 RECID=8 STAMP=748210223channel c2: starting piece 1 at 11-APR-11channel c1: finished piece 1 at 11-APR-11piece handle=/u02/backup/arch_0nm9hi1f_1_1_20110411 tag=ARC_BAK comment=NONEchannel c1: backup set complete, elapsed time: 00:00:01channel c1: deleting archived log(s)archived log file name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_04_11/o1_mf_1_11_6t6myz6m_.arc RECID=6 STAMP=748188047channel c2: finished piece 1 at 11-APR-11piece handle=/u02/backup/arch_0om9hi1f_1_1_20110411 tag=ARC_BAK comment=NONEchannel c2: backup set complete, elapsed time: 00:00:01channel c2: deleting archived log(s)archived log file name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_04_11/o1_mf_1_12_6t79mzb6_.arc RECID=7 STAMP=748210223archived log file name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_04_11/o1_mf_1_13_6t79mzg7_.arc RECID=8 STAMP=748210223Finished backup at 11-APR-11Starting backup at 11-APR-11channel c1: starting full datafile backup setchannel c1: specifying datafile(s) in backup setincluding current control file in backup setchannel c1: starting piece 1 at 11-APR-11channel c1: finished piece 1 at 11-APR-11piece handle=/u02/backup/ctl_file_0pm9hi1h_1_1_20110411 tag=BAK_CTLFILE comment=NONEchannel c1: backup set complete, elapsed time: 00:00:03Finished backup at 11-APR-11Starting backup at 11-APR-11channel c1: starting full datafile backup setchannel c1: specifying datafile(s) in backup setincluding current SPFILE in backup setchannel c1: starting piece 1 at 11-APR-11channel c1: finished piece 1 at 11-APR-11piece handle=/u02/backup/ORCL_spfile_0qm9hi1l_1_1_20110411 tag=SPFILE comment=NONEchannel c1: backup set complete, elapsed time: 00:00:01Finished backup at 11-APR-11Starting Control File and SPFILE Autobackup at 11-APR-11piece handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup/2011_04_11/o1_mf_s_748210230_6t79n67d_.bkp comment=NONEFinished Control File and SPFILE Autobackup at 11-APR-11released channel: c2released channel: c1RMAN> list backup;List of Backup Sets===================BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------13 Incr 0 444.11M DISK 00:00:02 11-APR-11 BP Key: 13 Status: AVAILABLE Compressed: NO Tag: ORCL_LEV0 Piece Name: /u02/backup/orcl_lev0_0km9hi1b_1_1_20110411 List of Datafiles in backup set 13 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 0 Incr 1108663 11-APR-11 /u01/app/oracle/oradata/orcl/sysaux01.dbf 3 0 Incr 1108663 11-APR-11 /u01/app/oracle/oradata/orcl/undotbs01.dbf 5 0 Incr 1108663 11-APR-11 /u01/app/oracle/oradata/orcl/example01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------14 Incr 0 595.57M DISK 00:00:02 11-APR-11 BP Key: 14 Status: AVAILABLE Compressed: NO Tag: ORCL_LEV0 Piece Name: /u02/backup/orcl_lev0_0lm9hi1b_1_1_20110411 List of Datafiles in backup set 14 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 0 Incr 1108664 11-APR-11 /u01/app/oracle/oradata/orcl/system01.dbf 4 0 Incr 1108664 11-APR-11 /u01/app/oracle/oradata/orcl/users01.dbfBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------15 Full 7.42M DISK 00:00:00 11-APR-11 BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20110411T201022 Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2011_04_11/o1_mf_s_748210222_6t79my7k_.bkp SPFILE Included: Modification time: 10-APR-11 SPFILE db_unique_name: ORCL Control File Included: Ckp SCN: 1108671 Ckp time: 11-APR-11BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------16 7.23M DISK 00:00:00 11-APR-11 BP Key: 16 Status: AVAILABLE Compressed: NO Tag: ARC_BAK Piece Name: /u02/backup/arch_0om9hi1f_1_1_20110411 List of Archived Logs in backup set 16 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 1 12 1098341 11-APR-11 1108687 11-APR-11 1 13 1108687 11-APR-11 1108695 11-APR-11BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------17 29.52M DISK 00:00:00 11-APR-11 BP Key: 17 Status: AVAILABLE Compressed: NO Tag: ARC_BAK Piece Name: /u02/backup/arch_0nm9hi1f_1_1_20110411 List of Archived Logs in backup set 17 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 1 11 1081833 11-APR-11 1098341 11-APR-11BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------18 Full 7.39M DISK 00:00:03 11-APR-11 BP Key: 18 Status: AVAILABLE Compressed: NO Tag: BAK_CTLFILE Piece Name: /u02/backup/ctl_file_0pm9hi1h_1_1_20110411 Control File Included: Ckp SCN: 1108711 Ckp time: 11-APR-11BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------19 Full 80.00K DISK 00:00:00 11-APR-11 BP Key: 19 Status: AVAILABLE Compressed: NO Tag: SPFILE Piece Name: /u02/backup/ORCL_spfile_0qm9hi1l_1_1_20110411 SPFILE Included: Modification time: 10-APR-11 SPFILE db_unique_name: ORCLBS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------
Oracle 10g R2 RAC for Redhat Linux AS 4 update4安装操作手册Oracle 11g RMAN 异机duplicate数据库相关资讯 Oracle教程
- Oracle中纯数字的varchar2类型和 (07/29/2015 07:20:43)
- Oracle教程:Oracle中查看DBLink密 (07/29/2015 07:16:55)
- [Oracle] SQL*Loader 详细使用教程 (08/11/2013 21:30:36)
| - Oracle教程:Oracle中kill死锁进程 (07/29/2015 07:18:28)
- Oracle教程:ORA-25153 临时表空间 (07/29/2015 07:13:37)
- Oracle教程之管理安全和资源 (04/08/2013 11:39:32)
|
本文评论 查看全部评论 (0)