Oracle Version:11gR2 System:IBM AIX 5L
Target Database:orcl Auxiliary Database:orcl
(1)RMAN 异机恢复的时候,。如果说要想改成其他的实例名,。实例名的信息会记录到控制文件里,所以如果在恢复的时候,如果实例名不一致,恢复的时候会报错。
(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.
$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 11 19:56:08 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
idle> conn /as sysdba
Connected.
sys@ORCL>
NAME DBID
-------------------------------------------------- ----------
$
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Apr 11 19:59:34 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1275959622)
RMAN>
2>
3>
4>
5>
6>
7>
8>
9>
10>
11>
allocated channel: c1
channel c1: SID=198 device type=DISK
allocated channel: c2
channel c2: SID=10 device type=DISK
Starting backup at 11-APR-11
channel c1: starting incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
channel c1: starting piece 1 at 11-APR-11
channel c2: starting incremental level 0 datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel c2: starting piece 1 at 11-APR-11
channel c1: finished piece 1 at 11-APR-11
channel c1: backup set complete, elapsed time: 00:00:03
channel c2: finished piece 1 at 11-APR-11
channel c2: backup set complete, elapsed time: 00:00:03
Finished backup at 11-APR-11
Starting Control File and SPFILE Autobackup at 11-APR-11
Finished Control File and SPFILE Autobackup at 11-APR-11
sql statement: alter system archive log current
Starting backup at 11-APR-11
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=11 RECID=6 STAMP=748188047
channel c1: starting piece 1 at 11-APR-11
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=12 RECID=7 STAMP=748210223
input archived log thread=1 sequence=13 RECID=8 STAMP=748210223
channel c2: starting piece 1 at 11-APR-11
channel c1: finished piece 1 at 11-APR-11
channel c1: backup set complete, elapsed time: 00:00:01
channel 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=748188047
channel c2: finished piece 1 at 11-APR-11
channel c2: backup set complete, elapsed time: 00:00:01
channel 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=748210223
archived log file name=/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2011_04_11/o1_mf_1_13_6t79mzg7_.arc RECID=8 STAMP=748210223
Finished backup at 11-APR-11
Starting backup at 11-APR-11
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 11-APR-11
channel c1: finished piece 1 at 11-APR-11
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 11-APR-11
Starting backup at 11-APR-11
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 11-APR-11
channel c1: finished piece 1 at 11-APR-11
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-APR-11
Starting Control File and SPFILE Autobackup at 11-APR-11
Finished Control File and SPFILE Autobackup at 11-APR-11
released channel: c2
released channel: c1
RMAN>
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Incr 0 444.11M DISK 00:00:02 11-APR-11
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: ORCL_LEV0
Piece Name:
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.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Incr 0 595.57M DISK 00:00:02 11-APR-11
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: ORCL_LEV0
Piece Name:
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.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full 7.42M DISK 00:00:00 11-APR-11
BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20110411T201022
Piece Name:
SPFILE Included: Modification time: 10-APR-11
SPFILE db_unique_name: ORCL
Control File Included: Ckp SCN: 1108671 Ckp time: 11-APR-11
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7.23M DISK 00:00:00 11-APR-11
BP Key: 16 Status: AVAILABLE Compressed: NO Tag: ARC_BAK
Piece Name:
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-11
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
29.52M DISK 00:00:00 11-APR-11
BP Key: 17 Status: AVAILABLE Compressed: NO Tag: ARC_BAK
Piece Name:
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-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full 7.39M DISK 00:00:03 11-APR-11
BP Key: 18 Status: AVAILABLE Compressed: NO Tag: BAK_CTLFILE
Piece Name:
Control File Included: Ckp SCN: 1108711 Ckp time: 11-APR-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
Full 80.00K DISK 00:00:00 11-APR-11
BP Key: 19 Status: AVAILABLE Compressed: NO Tag: SPFILE
Piece Name:
SPFILE Included: Modification time: 10-APR-11
SPFILE db_unique_name: ORCL
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------