oracle block recover笔记



select * from dba_segments where owner='TEST';--header_block=10
[oracle@oel ~]$ dd of=/u01/app/oracle/oradata/orcl/test01.dbf bs=8192 conv=notrunc seek=11 <<EOF
> asdfsdfadf
> EOF
0+1 records in
0+1 records out
11 bytes (11 B) copied, 0.000609742 s, 18.0 kB/s
[oracle@oel ~]$
SQL> alter system flush buffer_cache;

 

System altered.

 

SQL> select * from test.employees;
select * from test.employees
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 7, block # 11)
ORA-01110: data file 7: '/u01/app/oracle/oradata/orcl/test01.dbf'

 


SQL>

 

[oracle@oel ~]$ dbv file=/u01/app/oracle/oradata/orcl/test01.dbf blocksize=8192

 

DBVERIFY: Release 11.2.0.4.0 - Production on Thu Feb 15 22:36:23 2018

 

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

 

DBVERIFY - Verification starting : FILE = /u01/app/oracle/oradata/orcl/test01.dbf
Page 11 is marked corrupt
Corrupt block relative dba: 0x01c0000b (file 7, block 11)
Bad header found during dbv:
Data in bad block:
 type: 97 format: 3 rdba: 0x61666473
 last change scn: 0x0000.000a6664 seq: 0x2 flg: 0x04
 spare1: 0x64 spare2: 0x66 spare3: 0x0
 consistency value in tail: 0x9b560602
 check value in block header: 0xe6ef
 computed block checksum: 0x4ef4

 

 

 

DBVERIFY - Verification complete

 

Total Pages Examined         : 128
Total Pages Processed (Data) : 1
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 66
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 60
Total Pages Marked Corrupt   : 1
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 1153882 (0.1153882)
[oracle@oel ~]$
----------------------------------------------------

 

RMAN> recover corruption list;

 

Starting recover at 15-FEB-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=69 device type=DISK

 

channel ORA_DISK_1: restoring block(s)
channel ORA_DISK_1: specifying block(s) to restore from backup set
restoring blocks of datafile 00007
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORCL/backupset/2018_02_15/o1_mf_nnndf_TAG20180215T221003_f8dlwvoo_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2018_02_15/o1_mf_nnndf_TAG20180215T221003_f8dlwvoo_.bkp tag=TAG20180215T221003
channel ORA_DISK_1: restored block(s) from backup piece 1
channel ORA_DISK_1: block restore complete, elapsed time: 00:00:01

 

starting media recovery
media recovery complete, elapsed time: 00:00:01

 

Finished recover at 15-FEB-18

 

RMAN>
----------------------------------------------------------
RMAN> blockrecover datafile 7 block 11;

 

Starting recover at 15-FEB-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=8 device type=DISK

 

channel ORA_DISK_1: restoring block(s)
channel ORA_DISK_1: specifying block(s) to restore from backup set
restoring blocks of datafile 00007
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORCL/backupset/2018_02_15/o1_mf_nnndf_TAG20180215T221003_f8dlwvoo_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2018_02_15/o1_mf_nnndf_TAG20180215T221003_f8dlwvoo_.bkp tag=TAG20180215T221003
channel ORA_DISK_1: restored block(s) from backup piece 1
channel ORA_DISK_1: block restore complete, elapsed time: 00:00:01

 

starting media recovery
media recovery complete, elapsed time: 00:00:03

 

Finished recover at 15-FEB-18

RMAN>
----------------------------------------------------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值