【实验】Oracle 10g RAC生产数据库RMAN方式恢复到异地单机数据库全程记录

网友投稿 426 2023-11-27

【前言】这是一个RMAN备份有效性验证的过程。源端环境介绍:

生产数据库是包含两个节点的Oracle 10g 10.2.0.3 RAC数据库:

【实验】Oracle 10g RAC生产数据库RMAN方式恢复到异地单机数据库全程记录

ASM管理+裸设备

数据库名:racdb第一节点的sid:racdb1第一节点的sid:racdb2异地单机数据库(恢复Server)介绍:

单机

实例

低配

下面将详细记录整个从RAC到单机的详细恢复过程。【实验BEGIN】1.将源端的RMAN备份的所有文件拷贝到恢复Server上脚本如下,注意这里使用了一个保证scp不会中断的小技巧(sleep)racdb1@testdb183 /orabak$ cat scp.shnohup scp -r oracle@172.193.192.26:/orabak/* /orabak &sleep 102.修改源端生成的pfile文件,去掉与RAC有关的内容。将ASM格式的文件路径统统的修改成为文件系统路径的格式。修改之前的pfile:racdb1@testdb183 /oracle$ cat initracdb1.ora_backup_originracdb2.__db_cache_size=6543114240racdb1.__db_cache_size=6056574976racdb1.__java_pool_size=16777216racdb2.__java_pool_size=16777216racdb1.__large_pool_size=16777216racdb2.__large_pool_size=16777216racdb2.__shared_pool_size=1795162112racdb1.__shared_pool_size=2281701376racdb1.__streams_pool_size=0racdb2.__streams_pool_size=0*.audit_file_dest=/oracle/app/oracle/admin/racdb/adump*.background_dump_dest=/oracle/app/oracle/admin/racdb/bdump*.cluster_database_instances=2*.cluster_database=true*.compatible=10.2.0.3.0*.control_files=+ORADATA/racdb/controlfile/current.256.668538019*.core_dump_dest=/oracle/app/oracle/admin/racdb/cdump*.db_block_size=8192*.db_create_file_dest=+ORADATA*.db_domain=*.db_file_multiblock_read_count=16*.db_name=racdbracdb2.instance_number=2racdb1.instance_number=1*.wbj_queue_processes=10*.local_listener=local_listener_rac*.log_archive_dest_1=LOCATION=+ORADATA/racdb/*.log_archive_format=%t_%s_%r.arch*.open_cursors=300*.pga_aggregate_target=2088763392*.processes=800*.remote_listener=LISTENERS_racdb*.remote_login_passwordfile=exclusive*.sessions=885*.sga_max_size=5242880000racdb1.sga_max_size=8388608000racdb2.sga_max_size=8388608000*.sga_target=1610612736racdb1.sga_target=8388608000racdb2.sga_target=8388608000racdb2.thread=2racdb1.thread=1*.undo_management=AUTOracdb2.undo_tablespace=UNDOTBS2racdb1.undo_tablespace=UNDOTBS1*.user_dump_dest=/oracle/app/oracle/admin/racdb/udump修改之后的pfile:racdb1@testdb183 /oracle$ cat initracdb1.ora*.audit_file_dest=/oracle/app/oracle/admin/racdb/adump*.background_dump_dest=/oracle/app/oracle/admin/racdb/bdump*.compatible=10.2.0.3.0*.control_files=/oracle/oradata/racdb/control01.ctl*.core_dump_dest=/oracle/app/oracle/admin/racdb/cdump*.db_block_size=8192*.db_domain=*.db_file_multiblock_read_count=16*.db_name=racdb*.wbj_queue_processes=10*.log_archive_format=%t_%s_%r.arch*.open_cursors=300*.pga_aggregate_target=2088763392*.processes=800*.remote_login_passwordfile=exclusive*.sessions=885*.sga_max_size=524288000*.sga_target=161061273*.undo_management=AUTO*.undo_tablespace=UNDOTBS1*.user_dump_dest=/oracle/app/oracle/admin/racdb/udump3.根据上面参数文件内容,在恢复Server上创建确实的目录$ mkdir -p /oracle/app/oracle/admin/racdb/cdump$ mkdir -p /oracle/app/oracle/admin/racdb/udump$ mkdir -p /oracle/app/oracle/admin/racdb/adump$ mkdir -p /oracle/app/oracle/admin/racdb/bdump4.登陆恢复端Server的RMAN命令行,设置成设置成生产RAC第一节点的dbid(这个需要提前确认好)racdb1@testdb183 /oracle$ rman target /Recovery Manager: Release 10.2.0.3.0 - Production on Mon Aug 24 20:32:13 2009Copyright (c) 1982, 2005, Oracle.  All rights reserved.connected to target database (not started)RMAN> set dbid 3914926878executing command: SET DBID5.使用新pfile启动实例到nomount状态RMAN> startup nomount pfile=/oracle/app/oracle/product/10.2.0/db_1/dbs/initracdb1.oraOracle instance startedTotal System Global Area     524288000 bytesFixed Size                     2074048 bytesVariable Size                478153280 bytesDatabase Buffers              37748736 bytesRedo Buffers                   6311936 bytes6.找到RMAN中控制文件的的备份,恢复控制文件      RMAN> restore controlfile from /orabak/week1/Saturday/c-3914926878-20090822-00;Starting restore at 2009-08-24 20:33:59using channel ORA_DISK_1channel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:02output filename=/oracle/oradata/racdb/control01.ctlFinished restore at 2009-08-24 20:34:017.恢复完控制文件之后,启动数据库到mount状态RMAN> alter database mount;database mountedreleased channel: ORA_DISK_18.根据生产数据库对应的文件目录,将其修改到恢复Server的文件路径需要到生产库确定各个数据文件的信息SQL> select name from v$datafile;run  {set newname for datafile+ORADATA/racdb/datafile/smms.321.668623735 to /oracle/oradata/racdb/smms.321.668623735;set newname for datafile+ORADATA/racdb/datafile/smmsdb.364.676804261 to /oracle/oradata/racdb/smmsdb.364.676804261;set newname for datafile+ORADATA/racdb/datafile/gosd.329.668687127 to /oracle/oradata/racdb/gosd.329.668687127;set newname for datafile+ORADATA/racdb/datafile/gosd.536.670002437 to /oracle/oradata/racdb/gosd.536.670002437;set newname for datafile+ORADATA/racdb/datafile/gosdidx.333.668687233 to /oracle/oradata/racdb/gosdidx.333.668687233;set newname for datafile+ORADATA/racdb/datafile/psdb_auib.283.676742737 to /oracle/oradata/racdb/psdb_auib.283.676742737;set newname for datafile+ORADATA/racdb/datafile/psdb_smob_d.718.670098771 to /oracle/oradata/racdb/psdb_smob_d.718.670098771;set newname for datafile+ORADATA/racdb/datafile/psdb_smob_d.284.670413675 to /oracle/oradata/racdb/psdb_smob_d.284.670413675;set newname for datafile+ORADATA/racdb/datafile/psdb_smob_i.375.670413705 to /oracle/oradata/racdb/psdb_smob_i.375.670413705;set newname for datafile+ORADATA/racdb/datafile/psdb_smob_i.666.670098753 to /oracle/oradata/racdb/psdb_smob_i.666.670098753;set newname for datafile+ORADATA/racdb/datafile/psdb_odes.538.676804437 to /oracle/oradata/racdb/psdb_odes.538.676804437;set newname for datafile+ORADATA/racdb/datafile/psdb_isn_d.409.676742365 to /oracle/oradata/racdb/psdb_isn_d.409.676742365;set newname for datafile+ORADATA/racdb/datafile/psdb_isn_i.410.676742405 to /oracle/oradata/racdb/psdb_isn_i.410.676742405;set newname for datafile+ORADATA/racdb/datafile/psdb_iise_d.301.668682663 to /oracle/oradata/racdb/psdb_iise_d.301.668682663;set newname for datafile+ORADATA/racdb/datafile/psdb_iise_i.303.668682685 to /oracle/oradata/racdb/psdb_iise_i.303.668682685;set newname for datafile+ORADATA/racdb/datafile/psdb_wbj_d.729.670098811 to /oracle/oradata/racdb/psdb_wbj_d.729.670098811;set newname for datafile+ORADATA/racdb/datafile/psdb_wbj_i.652.670098831 to /oracle/oradata/racdb/psdb_wbj_i.652.670098831;set newname for datafile+ORADATA/racdb/datafile/wbj.337.668615843 to /oracle/oradata/racdb/wbj.337.668615843;set newname for datafile+ORADATA/racdb/datafile/perfstat.340.668616315 to /oracle/oradata/racdb/perfstat.340.668616315;set newname for datafile+ORADATA/racdb/datafile/perfstat.626.670860931 to /oracle/oradata/racdb/perfstat.626.670860931;set newname for datafile+ORADATA/racdb/datafile/sec.365.670416195 to /oracle/oradata/racdb/sec.365.670416195;set newname for datafile+ORADATA/racdb/datafile/sec.280.668540851 to /oracle/oradata/racdb/sec.280.668540851;set newname for datafile+ORADATA/racdb/datafile/sec_idx.282.668540885 to /oracle/oradata/racdb/sec_idx.282.668540885;set newname for datafile+ORADATA/racdb/datafile/sysaux.263.668538117 to /oracle/oradata/racdb/sysaux.263.668538117;set newname for datafile+ORADATA/racdb/datafile/system.261.668538061 to /oracle/oradata/racdb/system.261.668538061;set newname for datafile+ORADATA/racdb/datafile/undotbs1.551.670001545 to /oracle/oradata/racdb/undotbs1.551.670001545;set newname for datafile+ORADATA/racdb/datafile/undotbs1.594.670001207 to /oracle/oradata/racdb/undotbs1.594.670001207;set newname for datafile+ORADATA/racdb/datafile/undotbs1.262.668538095 to /oracle/oradata/racdb/undotbs1.262.668538095;set newname for datafile+ORADATA/racdb/datafile/undotbs2.544.670001557 to /oracle/oradata/racdb/undotbs2.544.670001557;set newname for datafile+ORADATA/racdb/datafile/undotbs2.265.668538137 to /oracle/oradata/racdb/undotbs2.265.668538137;set newname for datafile+ORADATA/racdb/datafile/undotbs2.562.670001221 to /oracle/oradata/racdb/undotbs2.562.670001221;set newname for datafile+ORADATA/racdb/datafile/users.266.668538159 to /oracle/oradata/racdb/users.266.668538159;restore database ;switch datafile all;}executing command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 2009-08-24 20:40:25allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=872 devtype=DISKchannel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00004 to /oracle/oradata/racdb/undotbs2.265.668538137restoring datafile 00008 to /oracle/oradata/racdb/sec_idx.282.668540885restoring datafile 00021 to /oracle/oradata/racdb/smmsdb.364.676804261restoring datafile 00024 to /oracle/oradata/racdb/undotbs1.594.670001207channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e1kms2ce_1_1_4545.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Sunday/e1kms2ce_1_1_4545.bak tag=DB0channel ORA_DISK_1: restore complete, elapsed time: 00:01:06channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00001 to /oracle/oradata/racdb/system.261.668538061restoring datafile 00006 to /oracle/oradata/racdb/sec.280.668540851restoring datafile 00025 to /oracle/oradata/racdb/undotbs2.562.670001221restoring datafile 00032 to /oracle/oradata/racdb/psdb_wbj_d.729.670098811channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e2kms2ct_1_1_4546.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Sunday/e2kms2ct_1_1_4546.bak tag=DB0channel ORA_DISK_1: restore complete, elapsed time: 00:01:15channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00002 to /oracle/oradata/racdb/undotbs1.262.668538095restoring datafile 00014 to /oracle/oradata/racdb/smms.321.668623735restoring datafile 00018 to /oracle/oradata/racdb/gosdidx.333.668687233restoring datafile 00020 to /oracle/oradata/racdb/sec.365.670416195channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/dvkms2ce_1_1_4543.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Sunday/dvkms2ce_1_1_4543.bak tag=DB0channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/dvkms2ce_2_1_4543.bakchannel ORA_DISK_1: restored backup piece 2piece handle=/orabak/week1/Sunday/dvkms2ce_2_1_4543.bak tag=DB0channel ORA_DISK_1: restore complete, elapsed time: 00:01:40channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00007 to /oracle/oradata/racdb/psdb_isn_d.409.676742365restoring datafile 00011 to /oracle/oradata/racdb/psdb_smob_i.375.670413705restoring datafile 00019 to /oracle/oradata/racdb/psdb_auib.283.676742737restoring datafile 00030 to /oracle/oradata/racdb/psdb_smob_i.666.670098753channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e0kms2ce_1_1_4544.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Sunday/e0kms2ce_1_1_4544.bak tag=DB0channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e0kms2ce_2_1_4544.bakchannel ORA_DISK_1: restored backup piece 2piece handle=/orabak/week1/Sunday/e0kms2ce_2_1_4544.bak tag=DB0channel ORA_DISK_1: restore complete, elapsed time: 00:01:50channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00005 to /oracle/oradata/racdb/users.266.668538159restoring datafile 00013 to /oracle/oradata/racdb/perfstat.340.668616315restoring datafile 00026 to /oracle/oradata/racdb/undotbs1.551.670001545restoring datafile 00034 to /oracle/oradata/racdb/perfstat.626.670860931channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e5kms2ep_1_1_4549.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Sunday/e5kms2ep_1_1_4549.bak tag=DB0channel ORA_DISK_1: restore complete, elapsed time: 00:00:46channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00009 to /oracle/oradata/racdb/psdb_isn_i.410.676742405restoring datafile 00010 to /oracle/oradata/racdb/psdb_smob_d.284.670413675restoring datafile 00028 to /oracle/oradata/racdb/gosd.536.670002437restoring datafile 00033 to /oracle/oradata/racdb/psdb_wbj_i.652.670098831channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e3kms2e8_1_1_4547.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Sunday/e3kms2e8_1_1_4547.bak tag=DB0channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e3kms2e8_2_1_4547.bakchannel ORA_DISK_1: restored backup piece 2piece handle=/orabak/week1/Sunday/e3kms2e8_2_1_4547.bak tag=DB0channel ORA_DISK_1: restore complete, elapsed time: 00:01:23channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00003 to /oracle/oradata/racdb/sysaux.263.668538117restoring datafile 00016 to /oracle/oradata/racdb/psdb_iise_i.303.668682685restoring datafile 00017 to /oracle/oradata/racdb/gosd.329.668687127restoring datafile 00027 to /oracle/oradata/racdb/undotbs2.544.670001557channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e4kms2e9_1_1_4548.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Sunday/e4kms2e9_1_1_4548.bak tag=DB0channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e4kms2e9_2_1_4548.bakchannel ORA_DISK_1: restored backup piece 2piece handle=/orabak/week1/Sunday/e4kms2e9_2_1_4548.bak tag=DB0channel ORA_DISK_1: restore complete, elapsed time: 00:01:42channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00012 to /oracle/oradata/racdb/wbj.337.668615843restoring datafile 00015 to /oracle/oradata/racdb/psdb_iise_d.301.668682663restoring datafile 00022 to /oracle/oradata/racdb/psdb_odes.538.676804437restoring datafile 00031 to /oracle/oradata/racdb/psdb_smob_d.718.670098771channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e6kms2f9_1_1_4550.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Sunday/e6kms2f9_1_1_4550.bak tag=DB0channel ORA_DISK_1: reading from backup piece /orabak/week1/Sunday/e6kms2f9_2_1_4550.bakchannel ORA_DISK_1: restored backup piece 2piece handle=/orabak/week1/Sunday/e6kms2f9_2_1_4550.bak tag=DB0channel ORA_DISK_1: restore complete, elapsed time: 00:01:41Finished restore at 2009-08-24 20:51:50datafile 14 switched to datafile copyinput datafile copy recid=57 stamp=695767910 filename=/oracle/oradata/racdb/smms.321.668623735datafile 21 switched to datafile copyinput datafile copy recid=58 stamp=695767910 filename=/oracle/oradata/racdb/smmsdb.364.676804261datafile 17 switched to datafile copyinput datafile copy recid=59 stamp=695767910 filename=/oracle/oradata/racdb/gosd.329.668687127datafile 28 switched to datafile copyinput datafile copy recid=60 stamp=695767910 filename=/oracle/oradata/racdb/gosd.536.670002437datafile 18 switched to datafile copyinput datafile copy recid=61 stamp=695767910 filename=/oracle/oradata/racdb/gosdidx.333.668687233datafile 19 switched to datafile copyinput datafile copy recid=62 stamp=695767910 filename=/oracle/oradata/racdb/psdb_auib.283.676742737datafile 31 switched to datafile copyinput datafile copy recid=63 stamp=695767910 filename=/oracle/oradata/racdb/psdb_smob_d.718.670098771datafile 10 switched to datafile copyinput datafile copy recid=64 stamp=695767911 filename=/oracle/oradata/racdb/psdb_smob_d.284.670413675datafile 11 switched to datafile copyinput datafile copy recid=65 stamp=695767911 filename=/oracle/oradata/racdb/psdb_smob_i.375.670413705datafile 30 switched to datafile copyinput datafile copy recid=66 stamp=695767911 filename=/oracle/oradata/racdb/psdb_smob_i.666.670098753datafile 22 switched to datafile copyinput datafile copy recid=67 stamp=695767911 filename=/oracle/oradata/racdb/psdb_odes.538.676804437datafile 7 switched to datafile copyinput datafile copy recid=68 stamp=695767911 filename=/oracle/oradata/racdb/psdb_isn_d.409.676742365datafile 9 switched to datafile copyinput datafile copy recid=69 stamp=695767911 filename=/oracle/oradata/racdb/psdb_isn_i.410.676742405datafile 15 switched to datafile copyinput datafile copy recid=70 stamp=695767911 filename=/oracle/oradata/racdb/psdb_iise_d.301.668682663datafile 16 switched to datafile copyinput datafile copy recid=71 stamp=695767911 filename=/oracle/oradata/racdb/psdb_iise_i.303.668682685datafile 32 switched to datafile copyinput datafile copy recid=72 stamp=695767911 filename=/oracle/oradata/racdb/psdb_wbj_d.729.670098811datafile 33 switched to datafile copyinput datafile copy recid=73 stamp=695767911 filename=/oracle/oradata/racdb/psdb_wbj_i.652.670098831datafile 12 switched to datafile copyinput datafile copy recid=74 stamp=695767911 filename=/oracle/oradata/racdb/wbj.337.668615843datafile 13 switched to datafile copyinput datafile copy recid=75 stamp=695767911 filename=/oracle/oradata/racdb/perfstat.340.668616315datafile 34 switched to datafile copyinput datafile copy recid=76 stamp=695767911 filename=/oracle/oradata/racdb/perfstat.626.670860931datafile 20 switched to datafile copyinput datafile copy recid=77 stamp=695767911 filename=/oracle/oradata/racdb/sec.365.670416195datafile 6 switched to datafile copyinput datafile copy recid=78 stamp=695767911 filename=/oracle/oradata/racdb/sec.280.668540851datafile 8 switched to datafile copyinput datafile copy recid=79 stamp=695767911 filename=/oracle/oradata/racdb/sec_idx.282.668540885datafile 3 switched to datafile copyinput datafile copy recid=80 stamp=695767911 filename=/oracle/oradata/racdb/sysaux.263.668538117datafile 1 switched to datafile copyinput datafile copy recid=81 stamp=695767911 filename=/oracle/oradata/racdb/system.261.668538061datafile 26 switched to datafile copyinput datafile copy recid=82 stamp=695767911 filename=/oracle/oradata/racdb/undotbs1.551.670001545datafile 24 switched to datafile copyinput datafile copy recid=83 stamp=695767911 filename=/oracle/oradata/racdb/undotbs1.594.670001207datafile 2 switched to datafile copyinput datafile copy recid=84 stamp=695767911 filename=/oracle/oradata/racdb/undotbs1.262.668538095datafile 27 switched to datafile copyinput datafile copy recid=85 stamp=695767911 filename=/oracle/oradata/racdb/undotbs2.544.670001557datafile 4 switched to datafile copyinput datafile copy recid=86 stamp=695767911 filename=/oracle/oradata/racdb/undotbs2.265.668538137datafile 25 switched to datafile copyinput datafile copy recid=87 stamp=695767911 filename=/oracle/oradata/racdb/undotbs2.562.670001221datafile 5 switched to datafile copyinput datafile copy recid=88 stamp=695767911 filename=/oracle/oradata/racdb/users.266.668538159RMAN>9.sqlplus下,修改联机日志的路径和名称。目的是防止在open resetlogs时报错racdb1@testdb183 /oracle$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.3.0 - Production on Mon Aug 24 21:01:40 2009Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit ProductionWith the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine optionsSQL> alter database rename file +ORADATA/racdb/onlinelog/group_1.257.668538023 to /oracle/oradata/racdb/group_1.257.668538023;SQL> alter database rename file +ORADATA/racdb/onlinelog/group_2.258.668538033 to /oracle/oradata/racdb/group_2.258.668538033;SQL> alter database rename file +ORADATA/racdb/onlinelog/group_3.259.668538043 to /oracle/oradata/racdb/group_3.259.668538043;SQL> alter database rename file +ORADATA/racdb/onlinelog/group_4.260.668538053 to /oracle/oradata/racdb/group_4.260.668538053;SQL> alter database rename file +ORADATA/racdb/onlinelog/group_5.267.668539011 to /oracle/oradata/racdb/group_5.267.668539011;SQL> alter database rename file +ORADATA/racdb/onlinelog/group_6.268.668539021 to /oracle/oradata/racdb/group_6.268.668539021;SQL> alter database rename file +ORADATA/racdb/onlinelog/group_7.269.668539031 to /oracle/oradata/racdb/group_7.269.668539031;SQL> alter database rename file +ORADATA/racdb/onlinelog/group_8.270.668539041 to /oracle/oradata/racdb/group_8.270.668539041;10.回到RMAN命令行,进行recover数据库racdb1@testdb183 /oracle$ rman target /Recovery Manager: Release 10.2.0.3.0 - Production on Mon Aug 24 21:02:26 2009Copyright (c) 1982, 2005, Oracle.  All rights reserved.connected to target database: racdb (DBID=3914926878, not open)RMAN>RMAN> recover database;Starting recover at 2009-08-24 21:02:58using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=870 devtype=DISKchannel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00002: /oracle/oradata/racdb/undotbs1.262.668538095destination for restore of datafile 00014: /oracle/oradata/racdb/smms.321.668623735destination for restore of datafile 00018: /oracle/oradata/racdb/gosdidx.333.668687233destination for restore of datafile 00020: /oracle/oradata/racdb/sec.365.670416195channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/gpknbsk7_1_1_4633.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/gpknbsk7_1_1_4633.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:15channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00007: /oracle/oradata/racdb/psdb_isn_d.409.676742365destination for restore of datafile 00011: /oracle/oradata/racdb/psdb_smob_i.375.670413705destination for restore of datafile 00019: /oracle/oradata/racdb/psdb_auib.283.676742737destination for restore of datafile 00030: /oracle/oradata/racdb/psdb_smob_i.666.670098753channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/gqknbsk7_1_1_4634.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/gqknbsk7_1_1_4634.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:01:05channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00004: /oracle/oradata/racdb/undotbs2.265.668538137destination for restore of datafile 00008: /oracle/oradata/racdb/sec_idx.282.668540885destination for restore of datafile 00021: /oracle/oradata/racdb/smmsdb.364.676804261destination for restore of datafile 00024: /oracle/oradata/racdb/undotbs1.594.670001207channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/grknbsk7_1_1_4635.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/grknbsk7_1_1_4635.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:45channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00003: /oracle/oradata/racdb/sysaux.263.668538117destination for restore of datafile 00016: /oracle/oradata/racdb/psdb_iise_i.303.668682685destination for restore of datafile 00017: /oracle/oradata/racdb/gosd.329.668687127destination for restore of datafile 00027: /oracle/oradata/racdb/undotbs2.544.670001557channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/guknbsm8_1_1_4638.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/guknbsm8_1_1_4638.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:46channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: /oracle/oradata/racdb/system.261.668538061destination for restore of datafile 00006: /oracle/oradata/racdb/sec.280.668540851destination for restore of datafile 00025: /oracle/oradata/racdb/undotbs2.562.670001221destination for restore of datafile 00032: /oracle/oradata/racdb/psdb_wbj_d.729.670098811channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/gsknbsm8_1_1_4636.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/gsknbsm8_1_1_4636.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:25channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00009: /oracle/oradata/racdb/psdb_isn_i.410.676742405destination for restore of datafile 00010: /oracle/oradata/racdb/psdb_smob_d.284.670413675destination for restore of datafile 00028: /oracle/oradata/racdb/gosd.536.670002437destination for restore of datafile 00033: /oracle/oradata/racdb/psdb_wbj_i.652.670098831channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/gtknbsm8_1_1_4637.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/gtknbsm8_1_1_4637.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:36channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00005: /oracle/oradata/racdb/users.266.668538159destination for restore of datafile 00013: /oracle/oradata/racdb/perfstat.340.668616315destination for restore of datafile 00026: /oracle/oradata/racdb/undotbs1.551.670001545destination for restore of datafile 00034: /oracle/oradata/racdb/perfstat.626.670860931channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/gvknbsnm_1_1_4639.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/gvknbsnm_1_1_4639.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:08channel ORA_DISK_1: starting incremental datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00012: /oracle/oradata/racdb/wbj.337.668615843destination for restore of datafile 00015: /oracle/oradata/racdb/psdb_iise_d.301.668682663destination for restore of datafile 00022: /oracle/oradata/racdb/psdb_odes.538.676804437destination for restore of datafile 00031: /oracle/oradata/racdb/psdb_smob_d.718.670098771channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/h0knbsnm_1_1_4640.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/h0knbsnm_1_1_4640.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:36starting media recoverychannel ORA_DISK_1: starting archive log restore to default destinationchannel ORA_DISK_1: restoring archive logarchive log thread=2 sequence=4105channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/h1knbson_1_1_4641.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/h1knbson_1_1_4641.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:02channel ORA_DISK_1: starting archive log restore to default destinationchannel ORA_DISK_1: restoring archive logarchive log thread=1 sequence=5126channel ORA_DISK_1: reading from backup piece /orabak/week1/Saturday/h2knbson_1_1_4642.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/orabak/week1/Saturday/h2knbson_1_1_4642.bak tag=DB1channel ORA_DISK_1: restore complete, elapsed time: 00:00:02archive log filename=/oracle/app/oracle/product/10.2.0/db_1/dbs/arch1_5126_668538014.arch thread=1 sequence=5126archive log filename=/oracle/app/oracle/product/10.2.0/db_1/dbs/arch2_4105_668538014.arch thread=2 sequence=4105unable to find archive logarchive log thread=2 sequence=4106RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 08/24/2009 21:07:45RMAN-06054: media recovery requesting unknown log: thread 2 seq 4106 lowscn 56948875711.以open resetlogs的方式打开数据库,完成整个RMAN的恢复RMAN> alter database open resetlogs;database openedRMAN>12.验证登陆数据库,检查版本信息。sys@racdb> select * from v$version;BANNER----------------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64biPL/SQL Release 10.2.0.3.0 - ProductionCORE    10.2.0.3.0      ProductionTNS for Linux: Version 10.2.0.3.0 - ProductionNLSRTL Version 10.2.0.3.0 - Production13.后续工作还有很多,如一些参数的调整,这里着重说明一下:需要全新的创建以下临时文件。更多信息请参考alert警告文件通过RMAN恢复过来的临时文件是不可用的,需要处理一下。报错信息如下:sys@racdb> select tablespace_name,file_name,bytes/1024/1024 M from dba_temp_files;select tablespace_name,file_name,bytes/1024/1024 M from dba_temp_files                                                        *ERROR at line 1:ORA-01157: cannot identify/lock data file 201 - see DBWR trace fileORA-01110: data file 201: +ORADATA/racdb/tempfile/temp.264.668538129处理临时文件:先创建一个临时表空间temp1sys@racdb> create temporary tablespace temp1 tempfile /oracle/oradata/racdb/temp01.dbf size 512m reuse autoextend on next 1m maxsize unlimited;Tablespace created.将默认的临时表空间指定到这个新建的表空间上sys@racdb> alter database default temporary tablespace temp1;Database altered.删除通过RMAN回复过来的临时文件。完成临时文件的整个处理过程。sys@racdb> drop tablespace temp including contents and datafiles;Tablespace dropped.sys@racdb> col FILE_NAME for a40

sys@racdb> select tablespace_name,file_name,bytes/1024/1024 M from dba_temp_files;

TABLESPACE_NAME   FILE_NAME                             M

----------------- --------------------------------- -----

TEMP1             /oracle/oradata/racdb/temp01.dbf    512

14.到此整个RAC到异地单机的RMAN恢复任务已经完成。注:这里只是简单的介绍一下恢复的过程,每一个细节都可以细细的斟酌,加以考量。DBA的永恒的使命:“恢复数据库”!Goodluck everyone.-- The End --

来自 “ ITPUB博客 ” ,链接:http://blog.itpub-/519536/viewspace-613110/,如需转载,请注明出处,否则将追究法律责任。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:mysql存储过程怎么创建
下一篇:mysql存储过程和存储函数有哪些区别
相关文章

 发表评论

暂时没有评论,来抢沙发吧~