Oracle10gRAC环境Rman备份恢复至单机oracle10g方案说明:使用于oracle10g,备份环境是RAC,但是恢复目的环境是单机。创建与rac主机相同的目录如/backup/rmanbak/level0/20120209010001/4都是在压缩包所在的目录下tar-cvforacle0208.taroracletar-xvforacle0113.tar传输rac上的备份集到单机上节点2上的备份包含数据文件及归档的备份集scpdblv0_731_1_774752412root@10.0.2.16:/backup/rmanbak/level0/20120209010001/4scpdblv0_732_1_774752412root@10.0.2.16:/backup/rmanbak/level0/20120209010001/4scpdblv0_733_1_774755639root@10.0.2.16:/backup/rmanbak/level0/20120209010001/4过程如下:文件大致需要传输6分钟节点1上传输控制文件的备份在(注意不是节点2上的控制文件的备份)测试机上接收到的备份集注意更改这些文件的属性chown-Roracle:dba*测试机上创建pfile及相关目录*.audit_file_dest='/app/oracle/admin/orcl/adump'*.background_dump_dest='/app/oracle/admin/orcl/bdump'*.compatible='10.2.0.1.0'*.control_files='/oradata/orcl/controlfile1.ctl','/oradata/orcl/controlfile2.ctl','/oradata/orcl/controlfile3.ctl'*.core_dump_dest='/app/oracle/admin/orcl/cdump'*.db_block_size=8192*.db_domain=''*.db_file_multiblock_read_count=16*.db_name='orcl'*.dispatchers='(PROTOCOL=TCP)(SERVICE=ORCLDB)'*.job_queue_processes=10*.log_archive_dest_1='LOCATION=/archive/orcl'*.log_archive_format='%t_%s_%r.dbf'*.open_cursors=1000*.pga_aggregate_target=2205838336*.processes=1500*.remote_login_passwordfile='EXCLUSIVE'*.sessions=1655*.sga_target=5617515008*.undo_management='AUTO'*.undo_tablespace='UNDOTBS'*.user_dump_dest='/app/oracle/admin/orcl/udump'测试机上启动实例orcl,并开始恢复数据文件修改profile改正ORACLE_SID=orcl;exportORACLE_SID使ORACLE_SID=orcl进入到该orcl的实例,以pfile启动的进入到rman中注意应该是restorecontrolfilefrom'/backup/rmanbak/level0/20120209010001/4/controlfile_c-1129995432-20120209-01';使其进入mount状态查看数据文件一些命令的查看设置exportNLS_DATE_FORMAT='yyyy-mm-ddhh24:mi:ss'listbackupsummary;RMANlistbackupofarchivelogallsummary;RMANlistbackupofarchivelogall;注意只有516和518备份集中有2月9日备份的归档注意恢复的时候可以用RMANrestoredatabasepreviewsummary;这个命令的速度很快!Restore过程,为了加快速度,所以使用了4个通道。本次开始的时间是11:37分。耗时约2小时run{allocatechannelc1devicetypedisk;allocatechannelc2devicetypedisk;allocatechannelc3devicetypedisk;allocatechannelc4devicetypedisk;setnewnamefordatafile1to'/oradata/orcl/system01.dbf';setnewnamefordatafile2to'/oradata/orcl/user02.dbf';setnewnamefordatafile3to'/oradata/orcl/sysaux01.dbf';setnewnamefordatafile4to'/oradata/orcl/users01.dbf';setnewnamefordatafile5to'/oradata/orcl/geostk_detail01.dbf';setnewnamefordatafile6to'/oradata/orcl/geo200801.dbf';setnewnamefordatafile7to'/oradata/orcl/databxstkmdtl02.dbf';setnewnamefordatafile8to'/oradata/orcl/geo2008index03.dbf';setnewnamefordatafile9to'/oradata/orcl/geo200805.dbf';setnewnamefordatafile10to'/oradata/orcl/databxsp01.dbf';setnewnamefordatafile11to'/oradata/orcl/databxbatch01.dbf';setnewnamefordatafile12to'/oradata/orcl/databxrob01.dbf';setnewnamefordatafile13to'/oradata/orcl/databxstkdtl01.dbf';setnewnamefordatafile14to'/oradata/orcl/databxaccdtl01.dbf';setnewnamefordatafile15to'/oradata/orcl/databxstkmdtl01.dbf';setnewnamefordatafile16to'/oradata/orcl/bxbb01.dbf';setnewnamefordatafile17to'/oradata/orcl/bxbb02.dbf';setnewnamefordatafile18to'/oradata/orcl/geo200802.dbf';setnewnamefordatafile19to'/oradata/orcl/geo200803.dbf';setnewnamefordatafile20to'/oradata/orcl/geo2008index01.dbf';setnewnamefordatafile21to'/oradata/orcl/geo2008index02.dbf';setnewnamefordatafile22to'/oradata/orcl/undotbs02.dbf';setnewnamefordatafile24to'/oradata/orcl/geo200804.dbf';setnewnamefordatafile25to'/oradata/orcl/benetz_todo01.dbf';setnewnamefordatafile29to'/oradata/orcl/undotbs1.dbf';setnewnamefordatafile30to'/oradata/orcl/undotbs2.dbf';restoredatabase;switchdatafileall;releasechannelc1;releasechannelc2;releasechannelc3;releasechannelc4;}关于归档在listbackupofarchivelogall;中可以看到BSKey518中有2月9日备份的归档----这是1机的归档备份11430930279869172012-02-0901:24:13930280967812012-02-0902:48:2411431930280967812012-02-0902:48:24930280971472012-02-0902:48:48BSKey516中有2月9日备份的归档----这是2机的归档备份2744930280967832012-02-0902:47:01930280971082012-02-0902:47:23根据上面的可以看到(1,1431,93028097147);(2,744,93028097108)所以选择2恢复RMANrun{setuntilsequence745thread2;recoverdatabase;}在SQLselectTHREAD#,SEQUENCE#,NEXT_CHANGE#,namefromv$archived_log中查到为了完全恢复,则不使用上面的until了。看节点1下的归档为了最大限度的恢复scp1_143*.dbfroot@10.0.2.16:/archive/orclscp1_144*.dbfroot@10.0.2.16:/archive/orcl将2.9日备份时间后的所有归档都考过了恢复完后,我建议先备份恢复出来的数据文件夹然后用sqlplus的recover进行恢复此时不能打开的!alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo06.log'to'/oradata/chunjierac/redo06.log';alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo07.log'to'/oradata/chunjierac/redo07.log';alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo01.log'to'/oradata/chunjierac/redo01.log';alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo02.log'to'/oradata/chunjierac/redo02.log';alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo03.log'to'/oradata/chunjierac/redo03.log';alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo04.log'to'/oradata/chunjierac/redo04.log';alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo05.log'to'/oradata/chunjierac/redo05.log';alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo8.log'to'/oradata/chunjierac/redo8.log';alterdatabaserenamefile'+DG_DATA/orcl/onlinelog/redo9.log'to'/oradata/chun