关于这个数据块就不做多的介绍,网上有很多资料
-
SQL> select header_file,header_block from dba_segments where segment_name='BOOTSTRAP$';
-
-
HEADER_FILE HEADER_BLOCK
-
----------- ------------
-
1 520
下面试验几种段头块被破坏,恢复的情况
1、使用离线备份
2、复制同位置好的数据块
3、修改为原来的值
1、使用离线备份
-
[oracle@kvm61 ~]$ cp /oracle/oradata/sdk/system01.dbf /oracle/oradata/sdk/system01.dbf.2
同时加入到bbed配置中
-
[oracle@kvm61 ~]$ vi bbed.conf
-
1 /oracle/oradata/sdk/system01.dbf 723517440
-
2 /oracle/oradata/sdk/sysaux01.dbf 639631360
-
3 /oracle/oradata/sdk/undotbs01.dbf 204472320
-
4 /oracle/oradata/sdk/users01.dbf 595066880
-
5 /oracle/oradata/sdk/example01.dbf 108134400
-
6 /oracle/scripts/sql/TBS_A.DBF 25165824
-
7 /oracle/oradata/sdk/users01.dbf.2 595066880
-
8 /oracle/oradata/sdk/system01.dbf.2 723517440
-
[root@kvm61 ~]# su - oracle
-
[oracle@kvm61 ~]$ bbed
-
Password:
-
-
BBED: Release 2.0.0.0.0 - Limited Production on 星期四 6月 23 13:53:33 2016
-
-
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
-
-
************* !!! For Oracle Internal Use only !!! ***************
-
-
BBED> set file 1 block 520
-
FILE# 1
-
BLOCK# 520
-
-
BBED> show
-
FILE# 1
-
BLOCK# 520
-
OFFSET 0
-
DBA 0x00400208 (4194824 1,520)
-
FILENAME /oracle/oradata/sdk/system01.dbf
-
BIFILE bifile.bbd
-
LISTFILE /home/oracle/bbed.conf
-
BLOCKSIZE 8192
-
MODE Edit
-
EDIT Unrecoverable
-
IBASE Dec
-
OBASE Dec
-
WIDTH 80
-
COUNT 512
-
LOGFILE log.bbd
-
SPOOL No
-
-
BBED> dump
-
File: /oracle/oradata/sdk/system01.dbf (1)
-
Block: 520 Offsets: 0 to 511 Dba:0x00400208
-
------------------------------------------------------------------------
-
10a20000 08024000 4b020000 00000104 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
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
-
<32 bytes="" per="" line="">
修改 破坏数据块
-
BBED> modify 1111 file 1 block 520
-
File: /oracle/oradata/sdk/system01.dbf (1)
-
Block: 520 Offsets: 0 to 511 Dba:0x00400208
-
------------------------------------------------------------------------
-
04570000 08024000 4b020000 00000104 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
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
-
<32 bytes="" per="" line="">
校验文件
-
BBED> verify file 1
-
DBVERIFY - Verification starting
-
FILE = /oracle/oradata/sdk/system01.dbf
-
-
Block 520 is corrupt
-
Corrupt block relative dba: 0x00400208 (file 0, block 520)
-
Bad header found during verification
-
Data in bad block:
-
type: 4 format: 7 rdba: 0x00400208
-
last change scn: 0x0000.0000024b seq: 0x1 flg: 0x04
-
spare1: 0x0 spare2: 0x0 spare3: 0x0
-
consistency value in tail: 0x024b1001
-
check value in block header: 0xe443
-
computed block checksum: 0xf514
-
-
-
DBVERIFY - Verification complete
-
-
Total Blocks Examined : 88320
-
Total Blocks Processed (Data) : 59588
-
Total Blocks Failing (Data) : 0
-
Total Blocks Processed (Index): 12419
-
Total Blocks Failing (Index): 0
-
Total Blocks Empty : 12896
-
Total Blocks Marked Corrupt : 1
-
Total Blocks Influx : 0
-
Message 531 not found; product=RDBMS; facility=BBED
启动报错
-
SQL> startup
-
ORACLE 例程已经启动。
-
-
Total System Global Area 513585152 bytes
-
Fixed Size 2214856 bytes
-
Variable Size 289408056 bytes
-
Database Buffers 213909504 bytes
-
Redo Buffers 8052736 bytes
-
数据库装载完毕。
-
-
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: '/oracle/oradata/sdk/system01.dbf'
-
进程 ID: 2782
-
会话 ID: 125 序列号: 5
告警日志
-
Reading datafile '/oracle/oradata/sdk/system01.dbf' for corruption at rdba: 0x00400208 (file 1, block 520)
-
Reread (file 1, block 520) found same corrupt data
-
Errors in file /oracle/diag/rdbms/sdk/sdk/trace/sdk_ora_4528.trc (incident=55359):
-
ORA-01578: ORACLE 数据块损坏 (文件号 1, 块号 520)
-
ORA-01110: 数据文件 1: '/oracle/oradata/sdk/system01.dbf'
-
Incident details in: /oracle/diag/rdbms/sdk/sdk/incident/incdir_55359/sdk_ora_4528_i55359.trc
-
ARC3: Archival started
-
ARC0: STARTING ARCH PROCESSES COMPLETE
-
Errors in file /oracle/diag/rdbms/sdk/sdk/trace/sdk_ora_4528.trc:
-
ORA-00704: 引导程序进程失败
-
ORA-01578: ORACLE 数据块损坏 (文件号 1, 块号 520)
-
ORA-01110: 数据文件 1: '/oracle/oradata/sdk/system01.dbf'
-
Errors in file /oracle/diag/rdbms/sdk/sdk/trace/sdk_ora_4528.trc:
-
ORA-00704: 引导程序进程失败
-
ORA-01578: ORACLE 数据块损坏 (文件号 1, 块号 520)
-
ORA-01110: 数据文件 1: '/oracle/oradata/sdk/system01.dbf'
-
Error 704 happened during db open, shutting down database
-
USER (ospid: 4528): terminating the instance due to error 704
-
Instance terminated by USER, pid = 4528
-
ORA-1092 signalled during: ALTER DATABASE OPEN...
-
opiodr aborting process unknown ospid (4528) as a result of ORA-1092
-
Thu Jun 23 17:34:13 2016
-
ORA-1092 : opitsk aborting process
将备份的离线备份数据文件覆盖损坏的数据文件
再次启动数据库
-
SQL> startup
-
ORACLE 例程已经启动。
-
-
Total System Global Area 513585152 bytes
-
Fixed Size 2214856 bytes
-
Variable Size 289408056 bytes
-
Database Buffers 213909504 bytes
-
Redo Buffers 8052736 bytes
-
数据库装载完毕。
-
ORA-01113: 文件 1 需要介质恢复
-
ORA-01110: 数据文件 1: '/oracle/oradata/sdk/system01.dbf'
做介质恢复
-
SQL> recover datafile 1
-
ORA-00279: 更改 2096976 (在 06/23/2016 01:00:08 生成) 对于线程 1 是必需的
-
ORA-00289: 建议: /archive/1_58_911404654.dbf
-
ORA-00280: 更改 2096976 (用于线程 1) 在序列 #58 中
-
-
-
指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
-
AUTO
-
ORA-00279: 更改 2131469 (在 06/23/2016 13:53:05 生成) 对于线程 1 是必需的
-
ORA-00289: 建议: /archive/1_59_911404654.dbf
-
ORA-00280: 更改 2131469 (用于线程 1) 在序列 #59 中
-
-
-
ORA-00279: 更改 2152061 (在 06/23/2016 14:03:47 生成) 对于线程 1 是必需的
-
ORA-00289: 建议: /archive/1_60_911404654.dbf
-
ORA-00280: 更改 2152061 (用于线程 1) 在序列 #60 中
-
-
-
ORA-00279: 更改 2172753 (在 06/23/2016 14:13:37 生成) 对于线程 1 是必需的
-
ORA-00289: 建议: /archive/1_61_911404654.dbf
-
ORA-00280: 更改 2172753 (用于线程 1) 在序列 #61 中
-
-
-
ORA-00279: 更改 2192759 (在 06/23/2016 14:33:39 生成) 对于线程 1 是必需的
-
ORA-00289: 建议: /archive/1_62_911404654.dbf
-
ORA-00280: 更改 2192759 (用于线程 1) 在序列 #62 中
-
-
-
已应用的日志。
-
完成介质恢复。
方式二,使用备份的文件中的数据块进行恢复
-
BBED> set file 8
-
FILE# 8
-
-
BBED> show
-
FILE# 8
-
BLOCK# 520
-
OFFSET 0
-
DBA 0x02000208 (33554952 8,520)
-
FILENAME /oracle/oradata/sdk/system01.dbf.2
-
BIFILE bifile.bbd
-
LISTFILE /home/oracle/bbed.conf
-
BLOCKSIZE 8192
-
MODE Edit
-
EDIT Unrecoverable
-
IBASE Dec
-
OBASE Dec
-
WIDTH 80
-
COUNT 512
-
LOGFILE log.bbd
-
SPOOL No
-
-
BBED> copy file 8 block 520 to file 1 block 520
-
File: /oracle/oradata/sdk/system01.dbf (1)
-
Block: 520 Offsets: 0 to 511 Dba:0x00400208
-
------------------------------------------------------------------------
-
10a20000 08024000 4b020000 00000104 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
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
-
-
<32 bytes per line>
-
-
BBED> verify file 1
-
DBVERIFY - Verification starting
-
FILE = /oracle/oradata/sdk/system01.dbf
-
-
-
DBVERIFY - Verification complete
-
-
Total Blocks Examined : 88320
-
Total Blocks Processed (Data) : 59588
-
Total Blocks Failing (Data) : 0
-
Total Blocks Processed (Index): 12419
-
Total Blocks Failing (Index): 0
-
Total Blocks Empty : 12896
-
Total Blocks Marked Corrupt : 0
-
Total Blocks Influx : 0
-
Message 531 not found; product=RDBMS; facility=BBED
-
-
SQL> connect / as sysdba
-
已连接到空闲例程。
-
SQL>
-
SQL> startup
-
ORACLE 例程已经启动。
-
-
Total System Global Area 513585152 bytes
-
Fixed Size 2214856 bytes
-
Variable Size 289408056 bytes
-
Database Buffers 213909504 bytes
-
Redo Buffers 8052736 bytes
-
数据库装载完毕。
-
数据库已经打开。
修改损坏的块为原来的值
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29023300/viewspace-2121078/
,如需转载,请注明出处,否则将追究法律责任。