如果我们仅有一份rman备份,而这个时候rman备份有出现坏块,使得我们的还原/恢复工作无法继续下去,导致数据大量丢失。怎么才能跳过这个rman坏块进行数据恢复?本文分享了一些技巧和方法,希望能帮到你。

AD:2013大数据全球技术峰会课程PPT下载


在有些情况下,我们仅有一份rman备份,而这个时候rman 备份有出现坏块,使得我们的还原/恢复工作无法继续下去,导致数据大量丢失。我们可以通过设置event 19548/19549来跳过坏块,最大程度抢救数据。

rman备份数据文件

  1. C:\Users\XIFENFEI>rman target /

  2. Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jun 6 20:31:19 2013

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: XIFENFEI (DBID=1422012639)

  5. RMAN> backup tablespace users format 'f:/users_bak.rman';

  6. Starting backup at 06-JUN-13

  7. using target database control file instead of recovery catalog

  8. allocated channel: ORA_DISK_1

  9. channel ORA_DISK_1: SID=197 device type=DISK

  10. channel ORA_DISK_1: starting full datafile backup set

  11. channel ORA_DISK_1: specifying datafile(s) in backup set

  12. input datafile file number=00004name=E:\ORACLE\ORADATA\XIFENFEI\USERS01.DBF

  13. channel ORA_DISK_1: starting piece 1 at 06-JUN-13

  14. channel ORA_DISK_1: finished piece 1 at 06-JUN-13

  15. piece handle=F:\USERS_BAK.RMAN tag=TAG20130606T203154comment=NONE

  16. channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

  17. Finished backup at 06-JUN-13

切换归档日志

  1. SQL> alter system switch logfile;

  2. System altered.

  3. SQL> /

  4. System altered.

  5. SQL> /

  6. System altered.

  7. SQL> archive log list;

  8. Database log mode              Archive Mode

  9. Automatic archival             Enabled

  10. Archive destination            E:\oracle\product\11.2.0\dbhome_1\RDBMS

  11. Oldest online log sequence     95

  12. Next log sequence to archive   97

  13. Current log sequence           97

重命名数据文件

  1. SQL> shutdown immediate

  2. Database closed.

  3. Database dismounted.

  4. ORACLE instance shut down.

  5. --------------------------------------

  6. e:\oracle\oradata\XIFENFEI>move USERS01.DBF USERS01_bak.DBF

  7. 移动了         1 个文件。

  8. --------------------------------------

  9. SQL> startup

  10. ORACLE instance started.

  11. Total System Global Area  418484224 bytes

  12. Fixed Size                  1385052 bytes

  13. Variable Size             327159204 bytes

  14. Database Buffers           83886080 bytes

  15. Redo Buffers                6053888 bytes

  16. Database mounted.

  17. ORA-01157: cannot identify/lock data file 4 - see DBWR trace file

  18. ORA-01110: data file 4: 'E:\ORACLE\ORADATA\XIFENFEI\USERS01.DBF'