BBED修复数据块损坏引起的数据库崩溃(ORA-01092,ORA-00704,ORA-01578)(2021年苏州某国企的案例更新至公众号)
问题现象:
1.Symptom
用户一个边缘系统出现数据文件损坏,且没有备份,数据库无法启动
报错如下,发现是oracle bootstrap损坏
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-01578: ORACLE data block corrupted (file # 1, block # 520)
ORA-01110: data file 1: '+DATA/dbocs/datafile/system01'
Process ID: 83985
Session ID: 191 Serial number: 3
问题分析:
bootstrap保存数据库中object_id最小的部分DDL (10g为 infoFile# Name Size(blks)
----- ---- ----------
1 /u01/oracle/oradata/orcl/system01.dbf 0
20 u01/oracle/oradata/tmp/bbed_system.dbf 0
BBED> set count 128
COUNT 128
BBED> copy file 20 block 520 to file 1 block 520 ---做文件block的对拷 来修复数据文件
File: /u01/oracle/oradata/orcl/system01.dbf (1)
Block: 520 Offsets: 0 to 127 Dba:0x00400208
------------------------------------------------------------------------
10a20000 08024000 d0010000 00000204 43e40000 00000000 00000000 00000000
00000000 01000000 07000000 20100000 00000000 03000000 07000000 0c024000
00000000 00000000 01000000 03000000 00000000 00000000 00000000 01000000
00000000 3b000000 00000040 09024000 07000000 00000000 00000000 00000000
BBED> copy file 20 block 521 to file 1 block 521
File: /u01/oracle/oradata/orcl/system01.dbf (1)
Block: 521 Offsets: 0 to 127 Dba:0x00400209
------------------------------------------------------------------------
06a20000 09024000 d7010000 00000106 fa520000 01000000 3b000000 73010000
00000000 01f80200 00000000 00002500 02000000 11024000 02004c00 18200000
d7010000 00011800 ffff4200 c6048404 84040000 1800a31f 1a1f951d cd1c4e1b
7a1aad19 49177b16 b315d614 0a14ef12 05120e11 380f680e 910d790c 69099c08
BBED> copy file 20 block 522 to file 1 block 522
File: /u01/oracle/oradata/orcl/system01.dbf (1)
Block: 522 Offsets: 0 to 127 Dba:0x0040020a
------------------------------------------------------------------------
06a20000 0a024000 d7010000 00000106 e81e0000 01000000 3b000000 bb010000
00000000 01f80200 00000000 00002500 02000000 20024000 04000700 15200000
d7010000 00011500 ffff3c00 b2057605 76050000 1500521d 811cb71b e31a8a18
07172216 ce120312 f9102010 410f750e 590dad0c 800bb30a dc096507 9606b205
BBED> copy file 20 block 523 to file 1 block 523
File: /u01/oracle/oradata/orcl/system01.dbf (1)
Block: 523 Offsets: 0 to 127 Dba:0x0040020b
------------------------------------------------------------------------
06a20000 0b024000 d7010000 00000106 7b7e0000 01000000 3b000000 d0010000
00000000 01000300 00000000 00002500 02000000 27024000 04002f00 0f200000
d7010000 00010f00 ffff3000 f50dc50d c50d0000 0f00301d 561c481b 821aab19
9c18c117 f816b113 ea122011 5110890f c00ef50d 00000000 00000000 00000000
BBED> sum apply
Check value for File 1, Block 523:
current = 0x7e7b, required = 0x7e7b
BBED>
BBED> exit
2.5修复后 重新启动数据
修复后可以正常启动
SQL> startup
ORACLE instance started.
Total System Global Area 8217530368 bytes
Fixed Size 2269552 bytes
Variable Size 1761611408 bytes
Database Buffers 6442450944 bytes
Redo Buffers 11198464 bytes
Database mounted.
Database opened.
SQL>
3.后记
常言道有备无患,但是仍然有很多很多的案例因为没有备份,不得不选择各种非常规手段来恢复数据,只有个expdp或者rman就可以解决99%的问题!备份--数据库的最后一道保险!希望大家都不会用到BBED和DUL!