可以还原使用旧版本RMAN所创建的备份,最旧版本为9.2.0.8。在创建备份的数据库版本与还原备份的数据库版本之间必须有支持的升级路径存在。比如,源数据库的版本为11gr2并且配置使用spfile参数文件。数据库启用了归档与快速闪回区。控制文件也被配置为自动备份。对源数据库创建了RMAN备份,并且包含了归档重做日志。要还原这些备份的主机上运行的是Oracle 12cr2的数据库版本。
还原使用旧版本RMAN所创建备份到当前目标数据库版本(12.2)的操作步骤如下:
1.验证创建备份的数据库版本与还原备份的数据库版本之间是否存在升级路径。例如,将Oracle 11.2.0.4所创建的RMAN备份还原到Oracle 12.2,那么必须支持从11.2.0.4升级到12.2,根据Oracle的升级指南,11.2.0.3及以后版本可以直接升级到Oracle 12.2。
2.对源数据库(jyrac为rac数据库)创建RMAN备份
RMAN> backup as compressed backupset database format '/acfs1/rman_back/jyrac_%u_%d_%t_%s_%p' plus archivelog format '/acfs1/rman_back/arch_%d_%T_%U';
Starting backup at 29-DEC-17
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=497 RECID=1044 STAMP=964006170
input archived log thread=2 sequence=540 RECID=1045 STAMP=964006171
channel ORA_DISK_1: starting piece 1 at 29-DEC-17
channel ORA_DISK_1: finished piece 1 at 29-DEC-17
piece handle=/acfs1/rman_back/arch_JYRAC_20171229_0isnb48r_1_1 tag=TAG20171229T112931 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-DEC-17
Starting backup at 29-DEC-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00012 name=+DATADG/jyrac/datafile/ldjc01
input datafile file number=00002 name=+DATADG/jyrac/datafile/sysaux.258.930413055
input datafile file number=00011 name=+DATADG/jyrac/datafile/cdzj01
input datafile file number=00001 name=+DATADG/jyrac/datafile/system.259.930413057
input datafile file number=00003 name=+DATADG/jyrac/datafile/undotbs1.262.930413057
input datafile file number=00008 name=+DATADG/jyrac/datafile/sales_test_01.dbf
input datafile file number=00005 name=+DATADG/jyrac/datafile/example.260.930413057
input datafile file number=00006 name=+DATADG/jyrac/datafile/undotbs2.261.930413057
input datafile file number=00007 name=+DATADG/jyrac/datafile/test01.dbf
input datafile file number=00009 name=+DATADG/jyrac/datafile/emp_test_01.dbf
input datafile file number=00010 name=+DATADG/jyrac/datafile/orders_test_01.dbf
input datafile file number=00004 name=+DATADG/jyrac/datafile/users.263.930413057
channel ORA_DISK_1: starting piece 1 at 29-DEC-17
channel ORA_DISK_1: finished piece 1 at 29-DEC-17
piece handle=/acfs1/rman_back/jyrac_0jsnb48u_JYRAC_964006174_19_1 tag=TAG20171229T112933 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:09:06
Finished backup at 29-DEC-17
Starting backup at 29-DEC-17
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=498 RECID=1046 STAMP=964006723
input archived log thread=2 sequence=541 RECID=1047 STAMP=964006720
channel ORA_DISK_1: starting piece 1 at 29-DEC-17
channel ORA_DISK_1: finished piece 1 at 29-DEC-17
piece handle=/acfs1/rman_back/arch_JYRAC_20171229_0ksnb4q5_1_1 tag=TAG20171229T113845 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-DEC-17
Starting Control File and SPFILE Autobackup at 29-DEC-17
piece handle=/acfs1/rman_back/c-2655496871-20171229-00 comment=NONE
Finished Control File and SPFILE Autobackup at 29-DEC-17
RMAN> list backup;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
9 24.50K DISK 00:00:01 29-DEC-17
BP Key: 9 Status: AVAILABLE Compressed: YES Tag: TAG20171229T112931
Piece Name: /acfs1/rman_back/arch_JYRAC_20171229_0isnb48r_1_1
List of Archived Logs in backup set 9
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 497 14690299647719 29-DEC-17 14690299647943 29-DEC-17
2 540 14690299647723 29-DEC-17 14690299647960 29-DEC-17