如果我们仅有一份rman备份,而这个时候rman备份有出现坏块,使得我们的还原/恢复工作无法继续下去,导致数据大量丢失。怎么才能跳过这个rman坏块进行数据恢复?本文分享了一些技巧和方法,希望能帮到你。
在有些情况下,我们仅有一份rman备份,而这个时候rman 备份有出现坏块,使得我们的还原/恢复工作无法继续下去,导致数据大量丢失。我们可以通过设置event 19548/19549来跳过坏块,最大程度抢救数据。
rman备份数据文件
C:\Users\XIFENFEI>rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jun 6 20:31:19 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: XIFENFEI (DBID=1422012639)
RMAN> backup tablespace users format 'f:/users_bak.rman';
Starting backup at 06-JUN-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=197 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004name=E:\ORACLE\ORADATA\XIFENFEI\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 06-JUN-13
channel ORA_DISK_1: finished piece 1 at 06-JUN-13
piece handle=F:\USERS_BAK.RMAN tag=TAG20130606T203154comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 06-JUN-13
切换归档日志
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination E:\oracle\product\11.2.0\dbhome_1\RDBMS
Oldest online log sequence 95
Next log sequence to archive 97
Current log sequence 97
重命名数据文件
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
--------------------------------------
e:\oracle\oradata\XIFENFEI>move USERS01.DBF USERS01_bak.DBF
移动了 1 个文件。
--------------------------------------
SQL> startup
ORACLE instance started.
Total System Global Area 418484224 bytes
Fixed Size 1385052 bytes
Variable Size 327159204 bytes
Database Buffers 83886080 bytes
Redo Buffers 6053888 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: 'E:\ORACLE\ORADATA\XIFENFEI\USERS01.DBF'
第 1 页:rman备份数据文件 | 第 2 页:破坏备份集 |
第 3 页:观察已经正常还原出来数据文件情况 | 第 4 页:rman还原数据文件 |