应某省的局方要求,在双机热备的备机上,将主机数据库的system、undo、temp和某个应用的表空间DATA_STATIC进行还原。
环境如下:
(1)HA主机:xj_db01
(2)HA备机:xj_db02
(3)备份软件:LEGATO
且legato的备份脚本为:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
connect catalog rman/passwd@xjrman; connect target sys/passwd; run { allocate channel t1 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; allocate channel t2 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; allocate channel t3 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; backup format "db_%d_t%t_s%s_p%p" (database); sql 'alter system archive log current'; crosscheck archivelog all; backup format "arch_%d_t%t_s%s_p%p" (archivelog all delete input); release channel t1; release channel t2; release channel t3; } |
(4)要求:将带库上的备份还原到xj_db02上,使用文件系统(原来的生产库使用裸设备)。
下面,我们开始还原和恢复。
(一)还原spfile:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
RMAN> startup nomount; startup failed: ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/oracle/app/oracle/product/9.2.0/dbs/initxjmisc.ora' trying to start the Oracle instance without parameter files ... Oracle instance started Total System Global Area 165376664 bytes Fixed Size 737944 bytes Variable Size 113246208 bytes Database Buffers 50331648 bytes Redo Buffers 1060864 bytes |
此时rman没有找到spfile,于是自己nomount一个dummy数据库。我们需要通过catalog库,将spfile和controlfile进行restore(注,如果没有catalog库,也可以利用dbms_backup_restore包来进行restore)。restore之前需要先set dbid,如果不指定,就会报错,相关的报错见文章后面troubleshooting部分。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
RMAN> list incarnation; List of Database Incarnations DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time ------- ------- -------- ---------------- --- ---------- ---------- 1 2 XJMISC 1874943871 YES 1 19-JUN-05 134205 134206 XJBM 4217558296 YES 1 26-MAR-07 RMAN> set dbid 1874943871; executing command: SET DBID RMAN> RMAN> run { 2> allocate channel t1 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; allocate channel t2 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; allocate channel t3 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; restore spfile; release channel t1; release channel t2; release channel t3; }3> 4> 5> 6> 7> 8> 9> 10> 11> 12> released channel: ORA_DISK_1 allocated channel: t1 channel t1: sid=12 devtype=SBT_TAPE channel t1: NMO v4.1.0.0 allocated channel: t2 channel t2: sid=13 devtype=SBT_TAPE channel t2: NMO v4.1.0.0 allocated channel: t3 channel t3: sid=14 devtype=SBT_TAPE channel t3: NMO v4.1.0.0 Starting restore at 31-DEC-08 channel t1: starting datafile backupset restore channel t1: restoring SPFILE output filename=/oracle/app/oracle/product/9.2.0/dbs/spfilexjmisc.ora channel t1: restored backup piece 1 piece handle=db_XJMISC_t674791343_s9882_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 31-DEC-08 released channel: t1 released channel: t2 released channel: t3 RMAN> |
(二)还原controlfile:
先用已经restore的spfile启动数据库,在create pfile from spfile;修改pfile中的控制文件路径到文件系统。再用pfile启动,create spfile from pfile;再用该spfile启动数据库。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
RMAN> run { 2> allocate channel t1 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; allocate channel t2 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; allocate channel t3 type 'sbt_tape' parms 'ENV=(NSR_CLIENT=xj_db)'; restore controlfile; release channel t1; release channel t2; release channel t3; }3> 4> 5> 6> 7> 8> 9> 10> 11> 12> released channel: ORA_DISK_1 allocated channel: t1 channel t1: sid=12 devtype=SBT_TAPE channel t1: NMO v4.1.0.0 allocated channel: t2 channel t2: sid=13 devtype=SBT_TAPE channel t2: NMO v4.1.0.0 allocated channel: t3 channel t3: sid=14 devtype=SBT_TAPE channel t3: NMO v4.1.0.0 Starting restore at 31-DEC-08 channel t1: starting datafile backupset restore channel t1: restoring controlfile output filename=/oradata/recover_xjmisc/cfile/control01.ctl channel t1: restored backup piece 1 piece handle=db_XJMISC_t674791343_s9882_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete replicating controlfile input filename=/oradata/recover_xjmisc/cfile/control01.ctl output filename=/oradata/recover_xjmisc/cfile/control02.ctl output filename=/oradata/recover_xjmisc/cfile/control03.ctl Finished restore at 31-DEC-08 released channel: t1 released channel: t2 released channel: t3 RMAN> |
restore控制文件之后,我们把数据库启动到mount状态。
1 2 3 4 5 |
RMAN> sql "alter database mount"; sql statement: alter database mount RMAN> |
(三)还原数据文件,要启动一个最小的数据,我们只需还原undo和system表空间即可。在这里,我们还原undo、system和一个应用的表空间data_static。在这里,我们将把数据文件还原到/oradata/recover_xjmisc/dfile路径,因此我们需要set newname一下,并且在最后进行switch datafile all。注意表空间的相关数据文件,我们可以通过关联v$datafile和v$tablespace来获得。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
RMAN> run { 2> allocate channel t1 type 'sbt_tape' 3> parms 'ENV=(NSR_CLIENT=xj_db)'; 4> allocate channel t2 type 'sbt_tape' 5> parms 'ENV=(NSR_CLIENT=xj_db)'; 6> allocate channel t3 type 'sbt_tape' 7> parms 'ENV=(NSR_CLIENT=xj_db)'; 8> set newname for datafile '/dev/vg_ora1/rsys_512m_01' to '/oradata/recover_xjmisc/dfile/system01.dbf'; 9> restore datafile 1; 10> set newname for datafile '/dev/vg_ora7/rdata_2g_180' to '/oradata/recover_xjmisc/dfile/system02.dbf'; 11> restore datafile 438; 12> set newname for datafile '/dev/vg_ora1/rdata_1g_001' to '/oradata/recover_xjmisc/dfile/undotbs101.dbf'; 13> restore datafile 2; 14> set newname for datafile '/dev/vg_ora2/rdata_1g_002' to '/oradata/recover_xjmisc/dfile/undotbs102.dbf'; 15> restore datafile 7; 16> set newname for datafile '/dev/vg_ora3/rdata_1g_003' to '/oradata/recover_xjmisc/dfile/undotbs103.dbf'; 17> restore datafile 8; 18> set newname for datafile '/dev/vg_ora1/rdata_1g_004' to '/oradata/recover_xjmisc/dfile/undotbs104.dbf'; 19> restore datafile 9; 20> set newname for datafile '/dev/vg_ora2/rdata_1g_005' to '/oradata/recover_xjmisc/dfile/undotbs105.dbf'; 21> restore datafile 10; 22> set newname for datafile '/dev/vg_ora3/rdata_1g_006' to '/oradata/recover_xjmisc/dfile/undotbs106.dbf'; 23> restore datafile 11; 24> set newname for datafile '/dev/vg_ora6/rdata_2g_181' to '/oradata/recover_xjmisc/dfile/undotbs107.dbf'; 25> restore datafile 435; 26> set newname for datafile '/dev/vg_ora7/rdata_2g_182' to '/oradata/recover_xjmisc/dfile/undotbs108.dbf'; 27> restore datafile 436; 28> set newname for datafile '/dev/vg_ora6/rdata_2g_183' to '/oradata/recover_xjmisc/dfile/undotbs109.dbf'; 29> restore datafile 437; 30> set newname for datafile '/dev/vg_ora1/rdata_1g_070' to '/oradata/recover_xjmisc/dfile/data_static01.dbf'; 31> restore datafile 70; 32> switch datafile all; 33> release channel t1; 34> release channel t2; 35> release channel t3; 36> } allocated channel: t1 channel t1: sid=17 devtype=SBT_TAPE channel t1: NMO v4.1.0.0 allocated channel: t2 channel t2: sid=18 devtype=SBT_TAPE channel t2: NMO v4.1.0.0 allocated channel: t3 channel t3: sid=19 devtype=SBT_TAPE channel t3: NMO v4.1.0.0 executing command: SET NEWNAME Starting restore at 31-DEC-08 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00001 to /oradata/recover_xjmisc/dfile/system01.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674791343_s9882_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 31-DEC-08 executing command: SET NEWNAME Starting restore at 31-DEC-08 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00438 to /oradata/recover_xjmisc/dfile/system02.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674791343_s9883_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 31-DEC-08 executing command: SET NEWNAME Starting restore at 31-DEC-08 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00002 to /oradata/recover_xjmisc/dfile/undotbs101.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674791343_s9884_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 31-DEC-08 executing command: SET NEWNAME Starting restore at 31-DEC-08 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00007 to /oradata/recover_xjmisc/dfile/undotbs102.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674794307_s9885_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 executing command: SET NEWNAME Starting restore at 01-JAN-09 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00008 to /oradata/recover_xjmisc/dfile/undotbs103.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674794353_s9886_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 executing command: SET NEWNAME Starting restore at 01-JAN-09 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00009 to /oradata/recover_xjmisc/dfile/undotbs104.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674791343_s9882_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 executing command: SET NEWNAME Starting restore at 01-JAN-09 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00010 to /oradata/recover_xjmisc/dfile/undotbs105.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674794390_s9887_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 executing command: SET NEWNAME Starting restore at 01-JAN-09 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00011 to /oradata/recover_xjmisc/dfile/undotbs106.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674797310_s9888_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 executing command: SET NEWNAME Starting restore at 01-JAN-09 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00435 to /oradata/recover_xjmisc/dfile/undotbs107.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674791343_s9882_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 executing command: SET NEWNAME Starting restore at 01-JAN-09 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00436 to /oradata/recover_xjmisc/dfile/undotbs108.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674794390_s9887_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 executing command: SET NEWNAME Starting restore at 01-JAN-09 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00437 to /oradata/recover_xjmisc/dfile/undotbs109.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674797310_s9888_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 executing command: SET NEWNAME Starting restore at 01-JAN-09 channel t1: starting datafile backupset restore channel t1: specifying datafile(s) to restore from backup set restoring datafile 00070 to /oradata/recover_xjmisc/dfile/data_static01.dbf channel t1: restored backup piece 1 piece handle=db_XJMISC_t674791343_s9882_p1 tag=TAG20081230T020219 params=NULL channel t1: restore complete Finished restore at 01-JAN-09 datafile 1 switched to datafile copy input datafilecopy recid=15 stamp=674997287 filename=/oradata/recover_xjmisc/dfile/system01.dbf datafile 438 switched to datafile copy input datafilecopy recid=16 stamp=674997287 filename=/oradata/recover_xjmisc/dfile/system02.dbf datafile 2 switched to datafile copy input datafilecopy recid=17 stamp=674997287 filename=/oradata/recover_xjmisc/dfile/undotbs101.dbf datafile 7 switched to datafile copy input datafilecopy recid=18 stamp=674997287 filename=/oradata/recover_xjmisc/dfile/undotbs102.dbf datafile 8 switched to datafile copy input datafilecopy recid=19 stamp=674997287 filename=/oradata/recover_xjmisc/dfile/undotbs103.dbf datafile 9 switched to datafile copy input datafilecopy recid=20 stamp=674997288 filename=/oradata/recover_xjmisc/dfile/undotbs104.dbf datafile 10 switched to datafile copy input datafilecopy recid=21 stamp=674997288 filename=/oradata/recover_xjmisc/dfile/undotbs105.dbf datafile 11 switched to datafile copy input datafilecopy recid=22 stamp=674997288 filename=/oradata/recover_xjmisc/dfile/undotbs106.dbf datafile 435 switched to datafile copy input datafilecopy recid=23 stamp=674997288 filename=/oradata/recover_xjmisc/dfile/undotbs107.dbf datafile 436 switched to datafile copy input datafilecopy recid=24 stamp=674997288 filename=/oradata/recover_xjmisc/dfile/undotbs108.dbf datafile 437 switched to datafile copy input datafilecopy recid=25 stamp=674997288 filename=/oradata/recover_xjmisc/dfile/undotbs109.dbf datafile 70 switched to datafile copy input datafilecopy recid=26 stamp=674997288 filename=/oradata/recover_xjmisc/dfile/data_static01.dbf released channel: t1 released channel: t2 released channel: t3 RMAN> |
(四)将控制文件中的其他数据文件做offline drop。
我们可以在sqlplus下通过动态sql取。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
SQL> select 'sql "alter database datafile '''''||name||''''' offline drop";' from v$datafile; 'SQL"ALTERDATABASEDATAFILE'''''||NAME||'''''OFFLINEDROP";' -------------------------------------------------------------------------------------------sql "alter database datafile ''/oradata/recover_xjmisc/dfile/system01.dbf'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs101.dbf'' offline drop"; sql "alter database datafile ''/dev/vg_ora2/rindx_256m_01'' offline drop"; sql "alter database datafile ''/dev/vg_ora3/rtools_512m_01'' offline drop"; sql "alter database datafile ''/dev/vg_ora2/ruser_256m_01'' offline drop"; sql "alter database datafile ''/dev/vg_ora3/rprefstat_512m_01'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs102.dbf'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs103.dbf'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs104.dbf'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs105.dbf'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs106.dbf'' offline drop"; sql "alter database datafile ''/dev/vg_ora3/rdata_1g_012'' offline drop"; sql "alter database datafile ''/dev/vg_ora1/rdata_1g_013'' offline drop"; sql "alter database datafile ''/dev/vg_ora2/rdata_1g_014'' offline drop"; sql "alter database datafile ''/dev/vg_ora3/rdata_1g_015'' offline drop"; sql "alter database datafile ''/dev/vg_ora1/rdata_1g_016'' offline drop"; sql "alter database datafile ''/dev/vg_ora2/rdata_1g_017'' offline drop"; …… sql "alter database datafile ''/dev/vg_ora6/rdata_2g_177'' offline drop"; sql "alter database datafile ''/dev/vg_ora7/rdata_2g_178'' offline drop"; sql "alter database datafile ''/dev/vg_ora6/rdata_2g_179'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs107.dbf'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs108.dbf'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/undotbs109.dbf'' offline drop"; sql "alter database datafile ''/oradata/recover_xjmisc/dfile/system02.dbf'' offline drop"; 438 rows selected. |
在rman中我们把undo、system和应用数据文件去掉后,执行剩下的语句:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
RMAN> sql "alter database datafile ''/dev/vg_ora2/rindx_256m_01'' offline drop"; sql "alter database datafile ''/dev/vg_ora3/rtools_512m_01'' offline drop"; sql "alter database datafile ''/dev/vg_ora2/ruser_256m_01'' offline drop"; sql "alter database datafile ''/dev/vg_ora3/rprefstat_512m_01'' offline drop"; sql "alter database datafile ''/dev/vg_ora3/rdata_1g_012'' offline drop"; …… RMAN> sql statement: alter database datafile ''/dev/vg_ora7/rdata_2g_176'' offline drop RMAN> sql statement: alter database datafile ''/dev/vg_ora6/rdata_2g_177'' offline drop RMAN> sql statement: alter database datafile ''/dev/vg_ora7/rdata_2g_178'' offline drop RMAN> sql statement: alter database datafile ''/dev/vg_ora6/rdata_2g_179'' offline drop RMAN> RMAN> |
(五)更改redolog路径:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
RMAN> sql statement: alter database rename file ''/dev/vg_ora2/rredo_256m_11'' to ''/oradata/recover_xjmisc/lfile/redo1_02.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora3/rredo_256m_21'' to ''/oradata/recover_xjmisc/lfile/redo1_03.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora1/rredo_256m_02'' to ''/oradata/recover_xjmisc/lfile/redo2_01.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora2/rredo_256m_12'' to ''/oradata/recover_xjmisc/lfile/redo2_02.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora3/rredo_256m_22'' to ''/oradata/recover_xjmisc/lfile/redo2_03.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora1/rredo_256m_03'' to ''/oradata/recover_xjmisc/lfile/redo3_01.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora2/rredo_256m_13'' to ''/oradata/recover_xjmisc/lfile/redo3_02.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora3/rredo_256m_23'' to ''/oradata/recover_xjmisc/lfile/redo3_03.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora1/rredo_256m_04'' to ''/oradata/recover_xjmisc/lfile/redo4_01.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora2/rredo_256m_14'' to ''/oradata/recover_xjmisc/lfile/redo4_02.log'' RMAN> sql statement: alter database rename file ''/dev/vg_ora3/rredo_256m_24'' to ''/oradata/recover_xjmisc/lfile/redo4_03.log'' RMAN> |
(六)还原部分arch日志,需要还原哪些,可以从list backup of archivelog all;来查看最近一次全备时间点之后的归档日志的sequence号。注意我们在备机上也是需要把arch restore到别的目录,因此也是需要set archivelog destination:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
RMAN> run { 2> allocate channel t1 type 'sbt_tape' 3> parms 'ENV=(NSR_CLIENT=xj_db)'; 4> allocate channel t2 type 'sbt_tape' 5> parms 'ENV=(NSR_CLIENT=xj_db)'; 6> allocate channel t3 type 'sbt_tape' 7> parms 'ENV=(NSR_CLIENT=xj_db)'; 8> set archivelog destination to '/oradata/recover_xjmisc/arch'; 9> restore archivelog sequence between 45801 and 45851; 10> switch datafile all; 11> release channel t1; 12> release channel t2; 13> release channel t3; 14> } released channel: ORA_DISK_1 allocated channel: t1 channel t1: sid=19 devtype=SBT_TAPE channel t1: NMO v4.1.0.0 allocated channel: t2 channel t2: sid=10 devtype=SBT_TAPE channel t2: NMO v4.1.0.0 allocated channel: t3 channel t3: sid=11 devtype=SBT_TAPE channel t3: NMO v4.1.0.0 executing command: SET ARCHIVELOG DESTINATION Starting restore at 03-JAN-09 channel t1: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t3: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t1: restoring archive log archive log thread=1 sequence=45801 channel t2: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t3: restoring archive log archive log thread=1 sequence=45805 channel t1: restoring archive log archive log thread=1 sequence=45802 channel t2: restoring archive log archive log thread=1 sequence=45817 channel t3: restoring archive log archive log thread=1 sequence=45806 channel t1: restoring archive log archive log thread=1 sequence=45803 channel t2: restoring archive log archive log thread=1 sequence=45818 channel t3: restoring archive log archive log thread=1 sequence=45807 channel t1: restoring archive log archive log thread=1 sequence=45804 channel t2: restoring archive log archive log thread=1 sequence=45819 channel t3: restoring archive log archive log thread=1 sequence=45808 channel t2: restoring archive log archive log thread=1 sequence=45820 channel t3: restoring archive log archive log thread=1 sequence=45809 channel t2: restoring archive log archive log thread=1 sequence=45821 channel t3: restoring archive log archive log thread=1 sequence=45810 channel t2: restored backup piece 1 piece handle=arch_XJMISC_t674798845_s9891_p1 tag=TAG20081230T040725 params=NULL channel t2: restore complete channel t2: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t2: restoring archive log archive log thread=1 sequence=45811 channel t2: restoring archive log archive log thread=1 sequence=45812 channel t2: restoring archive log archive log thread=1 sequence=45813 channel t2: restoring archive log archive log thread=1 sequence=45814 channel t2: restoring archive log archive log thread=1 sequence=45815 channel t2: restoring archive log archive log thread=1 sequence=45816 channel t1: restored backup piece 1 piece handle=arch_XJMISC_t674784212_s9881_p1 tag=TAG20081230T000331 params=NULL channel t1: restore complete channel t1: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t1: restoring archive log archive log thread=1 sequence=45832 channel t1: restoring archive log archive log thread=1 sequence=45833 channel t1: restoring archive log archive log thread=1 sequence=45834 channel t1: restoring archive log archive log thread=1 sequence=45835 channel t3: restored backup piece 1 piece handle=arch_XJMISC_t674798845_s9889_p1 tag=TAG20081230T040725 params=NULL channel t3: restore complete channel t3: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t3: restoring archive log archive log thread=1 sequence=45822 channel t3: restoring archive log archive log thread=1 sequence=45823 channel t3: restoring archive log archive log thread=1 sequence=45824 channel t3: restoring archive log archive log thread=1 sequence=45825 channel t3: restoring archive log archive log thread=1 sequence=45826 channel t2: restored backup piece 1 piece handle=arch_XJMISC_t674798845_s9890_p1 tag=TAG20081230T040725 params=NULL channel t2: restore complete channel t2: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t2: restoring archive log archive log thread=1 sequence=45827 channel t2: restoring archive log archive log thread=1 sequence=45828 channel t2: restoring archive log archive log thread=1 sequence=45829 channel t2: restoring archive log archive log thread=1 sequence=45830 channel t2: restoring archive log archive log thread=1 sequence=45831 channel t1: restored backup piece 1 piece handle=arch_XJMISC_t674827434_s9894_p1 tag=TAG20081230T120350 params=NULL channel t1: restore complete channel t1: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t1: restoring archive log archive log thread=1 sequence=45836 channel t1: restoring archive log archive log thread=1 sequence=45837 channel t1: restoring archive log archive log thread=1 sequence=45838 channel t1: restoring archive log archive log thread=1 sequence=45839 channel t1: restoring archive log archive log thread=1 sequence=45840 channel t1: restoring archive log archive log thread=1 sequence=45841 channel t1: restoring archive log archive log thread=1 sequence=45842 channel t1: restoring archive log archive log thread=1 sequence=45843 channel t1: restoring archive log archive log thread=1 sequence=45844 channel t1: restoring archive log archive log thread=1 sequence=45845 channel t1: restoring archive log archive log thread=1 sequence=45846 channel t1: restoring archive log archive log thread=1 sequence=45847 channel t3: restored backup piece 1 piece handle=arch_XJMISC_t674827434_s9892_p1 tag=TAG20081230T120350 params=NULL channel t3: restore complete channel t3: starting archive log restore to user-specified destination archive log destination=/oradata/recover_xjmisc/arch channel t3: restoring archive log archive log thread=1 sequence=45848 channel t3: restoring archive log archive log thread=1 sequence=45849 channel t3: restoring archive log archive log thread=1 sequence=45850 channel t3: restoring archive log archive log thread=1 sequence=45851 channel t2: restored backup piece 1 piece handle=arch_XJMISC_t674827434_s9893_p1 tag=TAG20081230T120350 params=NULL channel t2: restore complete channel t3: restored backup piece 1 piece handle=arch_XJMISC_t674870633_s9896_p1 tag=TAG20081231T000352 params=NULL channel t3: restore complete channel t1: restored backup piece 1 piece handle=arch_XJMISC_t674870633_s9895_p1 tag=TAG20081231T000352 params=NULL channel t1: restore complete Finished restore at 03-JAN-09 released channel: t1 released channel: t2 released channel: t3 RMAN> RMAN> |
(七)做recover。如果在restore时间比较长,在restore开始之后,recover开始之前,legato有进行了一次备份,那么用这个catalog做recover就会报错(报错见troubleshooting部分)。我们可以用控制文件中的信息来执行recover,用nocatalog模式连接。在recover的时候,我们要skip那些不需要的tablespace:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
$ rman target / nocatalog; Recovery Manager: Release 9.2.0.6.0 - 64bit Production Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved. connected to target database: XJMISC (DBID=1874943871) using target database controlfile instead of recovery catalog RMAN> RMAN> recover database skip forever tablespace 'INDX','TOOLS','USERS' 2> ,'PREFSTAT','DATA_CDR','INDEX_CDR','DATA_DYNAMIC','INDEX_DYNAMIC', 3> 'DATA_HISTORY','INDEX_HISTORY','DATA_PORTAL','INDEX_PORTAL', 4> 'INDEX_STATIC','DATA_SUBR01','DATA_SUBR02','DATA_SUBR03','DATA_SUBR04', 5> 'INDEX_SUBR01','INDEX_SUBR02','INDEX_SUBR03','INDEX_SUBR04', 6> 'DATA_SUBN01','DATA_SUBN02','DATA_SUBN03','DATA_SUBN04', 7> 'INDEX_SUBN01','INDEX_SUBN02','INDEX_SUBN03','INDEX_SUBN04', 8> 'DATA_ADMIN','INDEX_ADMIN','SPOA','SPOA_INDX','SPOA_BLOB', 9> 'DATA_MISCTOOLS','OFFLINE_KERNEL_DATA','OLK_DATA'; Starting recover at 03-JAN-09 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=13 devtype=DISK starting media recovery archive log thread 1 sequence 45811 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45811.arc archive log thread 1 sequence 45812 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45812.arc archive log thread 1 sequence 45813 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45813.arc archive log thread 1 sequence 45814 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45814.arc archive log thread 1 sequence 45815 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45815.arc archive log thread 1 sequence 45816 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45816.arc archive log thread 1 sequence 45817 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45817.arc archive log thread 1 sequence 45818 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45818.arc archive log thread 1 sequence 45819 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45819.arc archive log thread 1 sequence 45820 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45820.arc archive log thread 1 sequence 45821 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45821.arc archive log thread 1 sequence 45822 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45822.arc archive log thread 1 sequence 45823 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45823.arc archive log thread 1 sequence 45824 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45824.arc archive log thread 1 sequence 45825 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45825.arc archive log thread 1 sequence 45826 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45826.arc archive log thread 1 sequence 45827 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45827.arc archive log thread 1 sequence 45828 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45828.arc archive log thread 1 sequence 45829 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45829.arc archive log thread 1 sequence 45830 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45830.arc archive log thread 1 sequence 45831 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45831.arc archive log thread 1 sequence 45832 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45832.arc archive log thread 1 sequence 45833 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45833.arc archive log thread 1 sequence 45834 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45834.arc archive log thread 1 sequence 45835 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45835.arc archive log thread 1 sequence 45836 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45836.arc archive log thread 1 sequence 45837 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45837.arc archive log thread 1 sequence 45838 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45838.arc archive log thread 1 sequence 45839 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45839.arc archive log thread 1 sequence 45840 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45840.arc archive log thread 1 sequence 45841 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45841.arc archive log thread 1 sequence 45842 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45842.arc archive log thread 1 sequence 45843 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45843.arc archive log thread 1 sequence 45844 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45844.arc archive log thread 1 sequence 45845 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45845.arc archive log thread 1 sequence 45846 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45846.arc archive log thread 1 sequence 45847 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45847.arc archive log thread 1 sequence 45848 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45848.arc archive log thread 1 sequence 45849 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45849.arc archive log thread 1 sequence 45850 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45850.arc archive log thread 1 sequence 45851 is already on disk as file /oradata/recover_xjmisc/arch/arch_1_45851.arc archive log filename=/oradata/recover_xjmisc/arch/arch_1_45811.arc thread=1 sequence=45811 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45812.arc thread=1 sequence=45812 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45813.arc thread=1 sequence=45813 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45814.arc thread=1 sequence=45814 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45815.arc thread=1 sequence=45815 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45816.arc thread=1 sequence=45816 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45817.arc thread=1 sequence=45817 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45818.arc thread=1 sequence=45818 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45819.arc thread=1 sequence=45819 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45820.arc thread=1 sequence=45820 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45821.arc thread=1 sequence=45821 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45822.arc thread=1 sequence=45822 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45823.arc thread=1 sequence=45823 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45824.arc thread=1 sequence=45824 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45825.arc thread=1 sequence=45825 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45826.arc thread=1 sequence=45826 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45827.arc thread=1 sequence=45827 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45828.arc thread=1 sequence=45828 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45829.arc thread=1 sequence=45829 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45830.arc thread=1 sequence=45830 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45831.arc thread=1 sequence=45831 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45832.arc thread=1 sequence=45832 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45833.arc thread=1 sequence=45833 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45834.arc thread=1 sequence=45834 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45835.arc thread=1 sequence=45835 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45836.arc thread=1 sequence=45836 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45837.arc thread=1 sequence=45837 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45838.arc thread=1 sequence=45838 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45839.arc thread=1 sequence=45839 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45840.arc thread=1 sequence=45840 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45841.arc thread=1 sequence=45841 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45842.arc thread=1 sequence=45842 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45843.arc thread=1 sequence=45843 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45844.arc thread=1 sequence=45844 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45845.arc thread=1 sequence=45845 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45846.arc thread=1 sequence=45846 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45847.arc thread=1 sequence=45847 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45848.arc thread=1 sequence=45848 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45849.arc thread=1 sequence=45849 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45850.arc thread=1 sequence=45850 archive log filename=/oradata/recover_xjmisc/arch/arch_1_45851.arc thread=1 sequence=45851 unable to find archive log archive log thread=1 sequence=45852 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 01/03/2009 10:25:27 RMAN-06054: media recovery requesting unknown log: thread 1 scn 9279328755 RMAN> |
至此,部分表空间的还原完成,我们用不完全恢复的方式,恢复数据库至sequence 45851时间点。如果还需要recover后续的,就要补充arch日志,再recover。
(八)我们用open resetlogs的模式打开数据库。此时redolog就会在之前第五步的指定路径出现。
1 2 3 4 5 |
RMAN> alter database open resetlogs; database opened RMAN> |
(九)9i中rman的恢复之后需要手工添加tempfile:
1 2 3 4 5 |
SQL> alter tablespace temp add tempfile '/oradata/recover_xjmisc/dfile/temp01.dbf' size 300m; Tablespace altered. SQL> |
(十)【Troubleshooting】:
(1)如果没有set dbid就进行restore spfile,就会报错:
1 2 3 4 5 6 7 8 9 10 11 12 |
RMAN> restore spfile; Starting restore at 31-DEC-08 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 12/31/2008 16:09:33 RMAN-12010: automatic channel allocation initialization failed RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog RMAN> |
我们需要set dbid。
(2)由于我们是利用带库备份,如果在restore的时候,没有指定channel的parms变量,就会报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
--controlfile的报错: RMAN> restore controlfile; Starting restore at 31-DEC-08 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=12 devtype=DISK RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 12/31/2008 16:25:20 ORA-19625: error identifying file /oracle/control1.ctl ORA-27037: unable to obtain file status HP-UX Error: 2: No such file or directory Additional information: 3 --arch的报错: RMAN> run{ 2> set archivelog destination to '/oradata/recover_xjmisc/arch'; 3> restore archivelog sequence between 45801 and 45851; 4> } executing command: SET ARCHIVELOG DESTINATION Starting restore at 03-JAN-09 using channel ORA_DISK_1 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 01/03/2009 00:54:13 RMAN-06026: some targets not found - aborting restore RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45851 scn 9279045481 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45850 scn 9278752626 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45849 scn 9278467576 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45848 scn 9278166821 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45847 scn 9277879504 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45846 scn 9277584166 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45845 scn 9277297969 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45844 scn 9277009892 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45843 scn 9276742358 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45842 scn 9276456690 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45841 scn 9276165384 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45840 scn 9275881526 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45839 scn 9275595007 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45838 scn 9275313630 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45837 scn 9275031946 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45836 scn 9274739481 RMAN-06102: no channel to restore a backup or copy of log thread 1 seq 45835 scn 9274735939 |
我们需要添加channel和parms。
(3)如果在restore完成之后,recover完成之前,legato又做了一次备份,那么在执行recover的时候,就会报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
RMAN> run { 2> allocate channel t1 type 'sbt_tape' 3> parms 'ENV=(NSR_CLIENT=xj_db)'; 4> allocate channel t2 type 'sbt_tape' 5> parms 'ENV=(NSR_CLIENT=xj_db)'; 6> allocate channel t3 type 'sbt_tape' 7> parms 'ENV=(NSR_CLIENT=xj_db)'; 8> recover database skip forever tablespace 'INDX','TOOLS','USERS' 9> ,'PREFSTAT','DATA_CDR','INDEX_CDR','DATA_DYNAMIC','INDEX_DYNAMIC', 10> 'DATA_HISTORY','INDEX_HISTORY','DATA_PORTAL','INDEX_PORTAL', 11> 'INDEX_STATIC','DATA_SUBR01','DATA_SUBR02','DATA_SUBR03','DATA_SUBR04', 12> 'INDEX_SUBR01','INDEX_SUBR02','INDEX_SUBR03','INDEX_SUBR04', 13> 'DATA_SUBN01','DATA_SUBN02','DATA_SUBN03','DATA_SUBN04', 14> 'INDEX_SUBN01','INDEX_SUBN02','INDEX_SUBN03','INDEX_SUBN04', 15> 'DATA_ADMIN','INDEX_ADMIN','SPOA','SPOA_INDX','SPOA_BLOB', 16> 'DATA_MISCTOOLS','OFFLINE_KERNEL_DATA','OLK_DATA'; 17> release channel t1; 18> release channel t2; 19> release channel t3; 20> } allocated channel: t1 channel t1: sid=12 devtype=SBT_TAPE channel t1: NMO v4.1.0.0 allocated channel: t2 channel t2: sid=13 devtype=SBT_TAPE channel t2: NMO v4.1.0.0 allocated channel: t3 channel t3: sid=14 devtype=SBT_TAPE channel t3: NMO v4.1.0.0 Starting recover at 03-JAN-09 released channel: t1 released channel: t2 released channel: t3 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 01/03/2009 09:02:02 RMAN-06094: datafile 1 must be restored RMAN> |
我们可以用nocatalog来做。
(4)如果数据库resetlogs方式打开后,还是想用原来的备份集做再次还原,那么就需要reset database:reset database to incarnation XXX;
7条评论
收藏
去年我们这边也有个类似的案例。一张计费配置表被改动了,也是采用不完恢复,只恢复该表空间的数据。
不过,前面restore的操作都是采用DP进行。
不错不错,一直看你的blog.
控制文件和spfile是怎么备份的?脚本里没有看到,设置了auto吗?如果是,在备机rman在dummy实例时,直接restore spfile from XXX,restore controlfile from XXX.可否?
re dhhb:只要含system表空间,默认就会自动备份spfile和控制文件,因此全备的时候,也含了这2个文件。控制文件的自动备份configure 是default的,即不是自动备份。
哦,是这样啊。 我的意思是如果不是用catalog库来恢复,直接在rman下使用restore spfile from + 包含控制文件的备份集 来恢复spfile和controlfile…
re dhhb:不用catalog恢复也有不少方式,如用dbms_backup_resotre的包,或者从控制文件的snapshot中恢复(10G默认是$ORACLE_HOME/dbs/sncfsid.ora)。pfile可以自己写。
不错,小荷,我转走了哈。保留你的版权~~~~不过今天的GDDSSP他们已经自己回滚回去了。。。先学习
这个例子好像跟我有关系,恢复测试,呵呵