1、Oracle 10g RAC环境Rman备份恢复至单机oracle10g方案阐明:使用于oracle 10g ,备份环境是RAC,但是恢复目环境是单机。l 创立与rac主机相似目录如/backup/rmanbak/level0/4都是在压缩包所在目录下tar -cvf oracle0208.tar oracle tar -xvf oracle0113.tarl 传播rac上备份集到单机上节点2上备份包括数据文献及归档 备份集scp dblv0_731_1_ :/backup/rmanbak/level0/4scp dblv0_732_1_ :/backup/rmanbak/level0/4sc
2、p dblv0_733_1_ :/backup/rmanbak/level0/4过程如下: 文献大体需要传播6分钟节点1上传播控制文献备份在(注意不是节点2上 控制文献备份)测试机上接受到备份集注意更改这些文献属性 chown -R oracle:dba *l 测试机上创立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/con
3、trolfile1.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=/
4、archive/orcl*.log_archive_format=%t_%s_%r.dbf*.open_cursors=1000*.pga_aggregate_target=*.processes=1500*.remote_login_passwordfile=EXCLUSIVE*.sessions=1655*.sga_target=*.undo_management=AUTO*.undo_tablespace=UNDOTBS*.user_dump_dest=/app/oracle/admin/orcl/udump l 测试机上启动实例orcl,并开始恢复数据文献修改profile 改正ORA
5、CLE_SID=orcl;export ORACLE_SID使ORACLE_SID=orcl进入到该orcl实例,以pfile启动进入到rman中注意应当是restore controlfile from /backup/rmanbak/level0/4/controlfile_c-0209-01;使其进入mount状态查看数据文献某些命令查看 设立export NLS_DATE_FORMAT=yyyy-mm-dd hh24:mi:ss list backup summary; RMAN list backup of archivelog all summary;RMAN list backu
6、p of archivelog all; 注意只有516和518备份集中有2月9日备份归档 注意恢复时候 可以用 RMAN restore database preview summary; 这个命令速度不久!Restore过程,为了加迅速度,因此使用了4个通道。本次开始时间是11:37分。耗时约2小时runallocate channel c1 device type disk;allocate channel c2 device type disk;allocate channel c3 device type disk;allocate channel c4 device type di
7、sk;set newname for datafile 1 to /oradata/orcl/system01.dbf;set newname for datafile 2 to /oradata/orcl/user02.dbf;set newname for datafile 3 to /oradata/orcl/sysaux01.dbf;set newname for datafile 4 to /oradata/orcl/users01.dbf;set newname for datafile 5 to /oradata/orcl/geostk_detail01.dbf;set newn
8、ame for datafile 6 to /oradata/orcl/geo01.dbf;set newname for datafile 7 to /oradata/orcl/databxstkmdtl02.dbf;set newname for datafile 8 to /oradata/orcl/geoindex03.dbf;set newname for datafile 9 to /oradata/orcl/geo05.dbf;set newname for datafile 10 to /oradata/orcl/databxsp01.dbf;set newname for d
9、atafile 11 to /oradata/orcl/databxbatch01.dbf;set newname for datafile 12 to /oradata/orcl/databxrob01.dbf;set newname for datafile 13 to /oradata/orcl/databxstkdtl01.dbf;set newname for datafile 14 to /oradata/orcl/databxaccdtl01.dbf;set newname for datafile 15 to /oradata/orcl/databxstkmdtl01.dbf;
10、set newname for datafile 16 to /oradata/orcl/bxbb01.dbf;set newname for datafile 17 to /oradata/orcl/bxbb02.dbf;set newname for datafile 18 to /oradata/orcl/geo02.dbf;set newname for datafile 19 to /oradata/orcl/geo03.dbf;set newname for datafile 20 to /oradata/orcl/geoindex01.dbf;set newname for da
11、tafile 21 to /oradata/orcl/geoindex02.dbf;set newname for datafile 22 to /oradata/orcl/undotbs02.dbf;set newname for datafile 24 to /oradata/orcl/geo04.dbf;set newname for datafile 25 to /oradata/orcl/benetz_todo01.dbf;set newname for datafile 29 to /oradata/orcl/undotbs1.dbf;set newname for datafil
12、e 30 to /oradata/orcl/undotbs2.dbf;restore database;switch datafile all;release channel c1;release channel c2;release channel c3;release channel c4; 关于归档在list backup of archivelog all ;中可以看到BS Key 518中有2月9日备份归档- 这是1机归档备份1 1430 -02-09 01:24:13 -02-09 02:48:24 1 1431 -02-09 02:48:24 -02-09 02:48:48BS
13、Key 516中有2月9日备份归档-这是2机归档备份 2 744 -02-09 02:47:01 -02-09 02:47:23依照上面可以看到(1,1431,);(2,744,) 因此选取2恢复RMAN runset until sequence 745 thread 2;recover database;在SQL select THREAD#,SEQUENCE#,NEXT_CHANGE#,name from v$archived_log 中查到为了完全恢复,则不使用上面until了。看节点1下归档为了最大限度恢复 scp 1_143*.dbf :/archive/orcl scp 1_14
14、4*.dbf :/archive/orcl 将2.9日备份时间后所有归档都考过了恢复完后,我建议先备份恢复出来数据文献夹然后用 sqlplus recover 进行恢复此时不能打开!alter database rename file +DG_DATA/orcl/onlinelog/redo06.logto /oradata/chunjierac/redo06.log;alter database rename file +DG_DATA/orcl/onlinelog/redo07.logto /oradata/chunjierac/redo07.log;alter database rena
15、me file +DG_DATA/orcl/onlinelog/redo01.logto /oradata/chunjierac/redo01.log;alter database rename file +DG_DATA/orcl/onlinelog/redo02.logto /oradata/chunjierac/redo02.log;alter database rename file +DG_DATA/orcl/onlinelog/redo03.logto /oradata/chunjierac/redo03.log;alter database rename file +DG_DAT
16、A/orcl/onlinelog/redo04.logto /oradata/chunjierac/redo04.log;alter database rename file +DG_DATA/orcl/onlinelog/redo05.logto /oradata/chunjierac/redo05.log;alter database rename file +DG_DATA/orcl/onlinelog/redo8.log to /oradata/chunjierac/redo8.log;alter database rename file +DG_DATA/orcl/onlinelog
17、/redo9.log to /oradata/chunjierac/redo9.log;alter database rename file +DG_DATA/orcl/onlinelog/redo10.logto /oradata/chunjierac/redo10.log;alter database rename file +DG_DATA/orcl/onlinelog/redo11.logto /oradata/chunjierac/redo11.log;alter database rename file +DG_DATA/orcl/onlinelog/redo12.logto /o
18、radata/chunjierac/redo12.log;alter database rename file +DG_DATA/orcl/onlinelog/redo13.logto /oradata/chunjierac/redo13.log;alter database rename file +DG_DATA/orcl/onlinelog/redo14.logto /oradata/chunjierac/redo14.log;查看下SELECT a.group#,a.member,b.bytes FROM v$logfile a,v$log b WHERE a.group# = b.g
19、roup#;后续操作SQL select THREAD#,STATUS,ENABLED from v$thread; SQL alter database disable thread 2;SQL select group# from v$log where THREAD#=2; 使用SQL alter database drop logfile group * 或者 SQL alter database clear unarchived logfile group 9;SQL select group#,member from v$logfile;对undo 解决: 它redo比较特别,普通
20、都是UNDOTBS2 和UNDOTBS1 SQL drop tablespace UNDOTBS2 including contents and datafiles;SQLselect tablespace_name from dba_tablespaces where contents=UNDO;对temp解决:SQL select name from v$tempfile;NAME-+DG_DATA/orcl/tempfile/temp02.dbfSQL select tablespace_name from dba_tablespaces where contents=TEMPORARY
21、;TABLESPACE_NAME-TEMPSQL create temporary tablespace TEMP1 tempfile /oradata/*/temp01.dbf size 100M autoextend off;Tablespace created.SQL alter database default temporary tablespace TEMP1;Database altered.SQL drop tablespace TEMP including contents and datafiles;Tablespace dropped.SQL select name from v$tempfile;NAME-/oradata/chunjierac/temp01.dbf监听配备orcl = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dg02)(PORT = 1521) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )