ASM来用DD命令模拟数据块损坏

ASM来用DD命令模拟坏块

会话1:oracle
SQL> create tablespace test datafile '+DATA/ora11g23/datafile/test.dbf' size 10m;
Tablespace created.

SQL> select file_id,file_name from dba_data_files ;
... ...
        6 +DATA/ora11g23/datafile/test.dbf
6 rows selected.

SQL> alter database datafile 6 offline;
Database altered.

会话2:grid
ASMCMD> cp test.dbf /tmp/test.dbf
copying +DATA/ora11g23/datafile/test.dbf -> /tmp/test.dbf

会话3:root
[root@oel6 tmp]# dd if=/dev/zero of=/tmp/test.dbf count=10 seek=131 bs=8192 conv=notrunc
10+0 records in
10+0 records out
81920 bytes (82 kB) copied, 0.000513171 s, 160 MB/s

会话4:oracle
执行dbv校验
[oracle@oel6 ~]$ dbf file=/tmp/test.dbf blocksize=8192
-bash: dbf: command not found
[oracle@oel6 ~]$ dbv file=/tmp/test.dbf blocksize=8192
DBVERIFY: Release 11.2.0.3.0 - Production on Tue Mar 17 11:15:56 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

DBVERIFY - Verification starting : FILE = /tmp/test.dbf
Page 131 is marked corrupt
Corrupt block relative dba: 0x01800083 (file 6, block 131)
Completely zero block found during dbv: 

Page 132 is marked corrupt
Corrupt block relative dba: 0x01800084 (file 6, block 132)
Completely zero block found during dbv: 

Page 133 is marked corrupt
Corrupt block relative dba: 0x01800085 (file 6, block 133)
Completely zero block found during dbv: 

... ....
DBVERIFY - Verification complete

Total Pages Examined         : 1280
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 127
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 1143
Total Pages Marked Corrupt   : 10
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 1409085 (0.1409085)

此时
会话2:grid
ASMCMD> cp /tmp/test.dbf test.dbf
copying /tmp/test.dbf -> +DATA/ora11g23/datafile/test.dbf

会话1:oracle
SQL> alter database datafile 6 online;
alter database datafile 6 online
*
ERROR at line 1:
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '+DATA/ora11g23/datafile/test.dbf'
数据块损坏,文件无法加载,需要做介质恢复了。

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

转载于:http://blog.itpub.net/89196/viewspace-1463570/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值