返回小栈
16_深入解析Oracle os header结构(2)
orastar2020-03-23 14:28:41

1.概念介绍

Oracle os header共包含8个字段,其中fileCheck/blkSize/magicNumber 3个字段异常时数据库无法正常启动报错(ORA-27048: skgfifi: file header information is invalid),bbed修复 后恢复正常,

offset 2: fileType,只影响dbverify,数据库可以正常open;
offset 7~8: fileCheck ,bbed/dbv异常,影响数据库open报错ORA-27048,bbed修复后恢复正常;
offset 17~18: chkval, 该字段异常后暂无影响;
offset 21~22: blkSize,bbed/dbv/dbfsize均异常,数据库open报错ORA-27048,bbed修复后恢复正常;
offset 25~26: fileSize,dbv/dbfsize结果内容不对,数据库可以正常open;
offset 29~32: magicNumber,bbed/dbv/dbfsize均异常,数据库open报错ORA-27048,bbed修复后恢复正常;
offset 33~34: flag,该字段异常后暂无影响。
,结果如下所示,

offset 解释 bbed dbverify dbfsize startup 修复方法
offset 2 fileType 正常 异常 正常 正常 正常
offset 7~8 fileCheck BBED-00309 DBV-00107 正常 ORA-27048 bbed修复
offset 17~18 chkval 正常 正常 正常 正常 正常
offset 21~22 blkSize BBED-00309 DBV-00107 blkSize=0 ORA-27048 bbed修复
offset 25~26 fileSize 正常 所有列结果为0 fileSize=0 正常 正常
offset 29~32 magicNumber BBED-00309 DBV-00107 magic number is bad ORA-27048 bbed修复
offset 33~34 flag 正常 正常 正常 正常 正常

2. fileType异常分析

2.1 使用bbed清0 fileType(offset 2)

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 0000c0ff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

0000000: 00 a2 00 00 00 00 c0 ff 00 00 00 00 00 00 00 00 ................
0000010: 66 ff 00 00 00 20 00 00 00 05 00 00 7d 7c 7b 7a f...........}|{z
0000020: a0 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 0000c0ff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0000 offset 0
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00000000 0000c0ff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED>

2.2 bbed可用性检查(正常)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 21:55:58 2020

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

************* !!! For Oracle Internal Use only !!! ***************
BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00000000 0000c0ff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED>

2.3 dbverify 可用性检查(异常)

[oracle@sourcedb ~]$ dbv file=/oradata/epmsn/hsql01.dbf

DBVERIFY: Release 11.2.0.4.0 - Production on Thu Feb 13 11:16:30 2020

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

DBV-00107: Unknown header format (0) (2054913149)

[oracle@sourcedb ~]$

2.4 dbfsize可用性检查(正常)

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

Database file: /oradata/epmsn/hsql01.dbf
Database file type: file system
Database file size: 1280 8192 byte blocks

2.5 数据库启动检查(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
Database opened.
SQL>

Database Characterset is ZHS16GBK
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Thu Feb 13 22:44:30 2020
QMNC started with pid=24, OS id=23790
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Completed: ALTER DATABASE OPEN

2.6 恢复fileType

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 22:51:59 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00000000 0000c0ff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 00a2 offset 0
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 0000c0ff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 0000c0ff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED>

3. fileCheck 异常分析

3.1 使用bbed清0 fileCheck(offset 7~8)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 22:55:20 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 0000c0ff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0000 offset 6
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 6 to 53 Dba:0x01400000
------------------------------------------------------------------------
00000000 00000000 000066ff 00000020 00000005 00007d7c 7b7aa081 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000000 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED> exit

3.2 bbed可用性检查(异常)

BBED> set file 5 block 0
FILE# 5
BBED-00309: out of range block number (0)


BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000000 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED>

3.3 dbverify 可用性检查(异常)

[oracle@sourcedb ~]$ dbv file=/oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbv file=/oradata/epmsn/hsql01.dbf

DBVERIFY: Release 11.2.0.4.0 - Production on Thu Feb 13 23:01:11 2020

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


DBV-00107: Unknown header format (162) (0)
[oracle@sourcedb trace]$

3.4 dbfsize可用性检查(正常)

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

Database file: /oradata/epmsn/hsql01.dbf
Database file type: file system
Database file size: 1280 8192 byte blocks
[oracle@sourcedb trace]$

3.5 数据库启动检查(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oradata/epmsn/hsql01.dbf'


SQL>

Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
Thu Feb 13 23:02:57 2020
ALTER DATABASE OPEN
Errors in file /u01/app/oracle/diag/rdbms/epmsn/epmsn/trace/epmsn_dbw0_23917.trc:
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oradata/epmsn/hsql01.dbf'
ORA-27048: skgfifi: file header information is invalid
Additional information: 11

3.6 bbed恢复fileCheck

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:05:28 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BBED-00309: out of range block number (0)


BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000000 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0cff offset 6
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 6 to 53 Dba:0x01400001
------------------------------------------------------------------------
0cff0000 00000000 000066ff 00000020 00000005 00007d7c 7b7aa081 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 1:
current = 0xff66, required = 0xff66

BBED>

3.7 数据库startup测试(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
Database opened.
SQL>

4. chkval 异常分析

4.1 使用bbed清0 chkval(offset 17~18)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:20:19 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0000 offset 16
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 16 to 63 Dba:0x01400000
------------------------------------------------------------------------
00000000 00200000 00050000 7d7c7b7a a0810000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 00000000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0x0000, required = 0x0000

BBED>

4.2 bbed可用性检查(正常)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:22:40 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 00000000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED>

4.3 dbverify 可用性检查(正常)

[oracle@sourcedb ~]$ dbv file=/oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbv file=/oradata/epmsn/hsql01.dbf

DBVERIFY: Release 11.2.0.4.0 - Production on Thu Feb 13 23:23:40 2020

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

DBVERIFY - Verification starting : FILE = /oradata/epmsn/hsql01.dbf


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 : 1153
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 4134886 (0.4134886)
[oracle@sourcedb trace]$

4.4 dbfsize可用性检查(正常)

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

Database file: /oradata/epmsn/hsql01.dbf
Database file type: file system
Database file size: 1280 8192 byte blocks
[oracle@sourcedb trace]$

4.5 数据库启动检查(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
Database opened.
SQL>

4.6 恢复chkval

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:26:43 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 00000000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 66ff offset 16
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 16 to 63 Dba:0x01400000
------------------------------------------------------------------------
66ff0000 00200000 00050000 7d7c7b7a a0810000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED>

5. blkSize 异常分析

5.1 使用bbed清0 blkSize(offset 21~22)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:30:17 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0000 offset 20
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 20 to 67 Dba:0x01400000
------------------------------------------------------------------------
00000000 00050000 7d7c7b7a a0810000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00000000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED>

5.2 bbed可用性检查(异常)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:31:59 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BBED-00309: out of range block number (0)


BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00000000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED>

5.3 dbverify 可用性检查(异常)

[oracle@sourcedb ~]$ dbv file=/oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbv file=/oradata/epmsn/hsql01.dbf

DBVERIFY: Release 11.2.0.4.0 - Production on Thu Feb 13 23:35:50 2020

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


DBV-00107: Unknown header format (162) (2054913149)
[oracle@sourcedb trace]$

5.4 dbfsize可用性检查(正常)

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

Database file: /oradata/epmsn/hsql01.dbf
Database file type: file system
Database file size: 1280 0 byte blocks
[oracle@sourcedb trace]$

5.5 数据库启动检查(异常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oradata/epmsn/hsql01.dbf'
SQL>

Successful mount of redo thread 1, with mount id 2733388513
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
Thu Feb 13 23:38:13 2020
ALTER DATABASE OPEN
Errors in file /u01/app/oracle/diag/rdbms/epmsn/epmsn/trace/epmsn_dbw0_24264.trc:
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oradata/epmsn/hsql01.dbf'
ORA-27048: skgfifi: file header information is invalid
Additional information: 11

5.6 bbed恢复 blkSize

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:40:26 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BBED-00309: out of range block number (0)


BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00000000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0020 offset 20
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 20 to 67 Dba:0x01400001
------------------------------------------------------------------------
00200000 00050000 7d7c7b7a a0810000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 1:
current = 0xff66, required = 0xff66

BBED>

5.7 数据库startup测试(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
Database opened.
SQL>

6. fileSize 异常分析

6.1 使用bbed清0 fileSize (offset 25~26)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:49:57 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0000 offset 24
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 24 to 71 Dba:0x01400000
------------------------------------------------------------------------
00000000 7d7c7b7a a0810000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00000000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED>

6.2 bbed可用性检查(正常)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:52:54 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00000000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED>

6.3 dbverify 可用性检查(异常)

[oracle@sourcedb ~]$ dbv file=/oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbv file=/oradata/epmsn/hsql01.dbf

DBVERIFY: Release 11.2.0.4.0 - Production on Thu Feb 13 23:53:47 2020

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

DBVERIFY - Verification starting : FILE = /oradata/epmsn/hsql01.dbf


DBVERIFY - Verification complete

Total Pages Examined : 0
Total Pages Processed (Data) : 0
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing (Index): 0
Total Pages Processed (Other): 0
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 0
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 0 (0.0)
[oracle@sourcedb trace]$

6.4 dbfsize可用性检查(正常)

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

Database file: /oradata/epmsn/hsql01.dbf
Database file type: file system
Database file size: 0 8192 byte blocks
[oracle@sourcedb trace]$

6.5 数据库启动检查(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
Database opened.
SQL> alter system checkpoint;

System altered.

SQL>

6.6 恢复 fileSize

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Thu Feb 13 23:56:23 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00000000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0005 offset 24
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 24 to 71 Dba:0x01400000
------------------------------------------------------------------------
00050000 7d7c7b7a a0810000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED>

7. magicNumber 异常分析

7.1 使用bbed清0 magicNumber (offset 29~32)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Fri Feb 14 00:03:57 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 00000000 offset 28
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 28 to 75 Dba:0x01400000
------------------------------------------------------------------------
00000000 a0810000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 00000000
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED>

7.2 bbed可用性检查(异常)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Fri Feb 14 00:05:26 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BBED-00309: out of range block number (0)


BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 00000000
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED>

7.3 dbverify 可用性检查(异常)

[oracle@sourcedb ~]$ dbv file=/oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbv file=/oradata/epmsn/hsql01.dbf

DBVERIFY: Release 11.2.0.4.0 - Production on Fri Feb 14 00:06:21 2020

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


DBV-00107: Unknown header format (162) (0)
[oracle@sourcedb trace]$

7.4 dbfsize可用性检查(正常)

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf
/oradata/epmsn/hsql01.dbf: Header block magic number is bad
[oracle@sourcedb trace]$

7.5 数据库启动检查(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oradata/epmsn/hsql01.dbf'


SQL>

Completed: ALTER DATABASE MOUNT
Fri Feb 14 00:07:40 2020
ALTER DATABASE OPEN
Errors in file /u01/app/oracle/diag/rdbms/epmsn/epmsn/trace/epmsn_dbw0_24574.trc:
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oradata/epmsn/hsql01.dbf'
ORA-27048: skgfifi: file header information is invalid
Additional information: 11

7.6 bbed修复 magicNumber

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Fri Feb 14 00:05:26 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BBED-00309: out of range block number (0)


BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 00000000
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 7d7c7b7a offset 28
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 28 to 75 Dba:0x01400001
------------------------------------------------------------------------
7d7c7b7a a0810000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1 Offsets: 0 to 47 Dba:0x01400001
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 1:
current = 0xff66, required = 0xff66

BBED>

7.7 数据库startup测试(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
Database opened.
SQL> alter system checkpoint;

System altered.

SQL>

8. flag 异常分析

8.1 使用bbed清0 flag (offset 33~34)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Fri Feb 14 00:15:16 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
a0810000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x 0000 offset 32
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 32 to 79 Dba:0x01400000
------------------------------------------------------------------------
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED>

8.2 bbed可用性检查(异常)

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Fri Feb 14 00:16:24 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED>

8.3 dbverify 可用性检查(异常)

[oracle@sourcedb ~]$ dbv file=/oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbv file=/oradata/epmsn/hsql01.dbf

DBVERIFY: Release 11.2.0.4.0 - Production on Fri Feb 14 00:17:04 2020

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

DBVERIFY - Verification starting : FILE = /oradata/epmsn/hsql01.dbf


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 : 1153
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 4134886 (0.4134886)
[oracle@sourcedb trace]$

8.4 dbfsize可用性检查(正常)

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

[oracle@sourcedb trace]$ dbfsize /oradata/epmsn/hsql01.dbf

Database file: /oradata/epmsn/hsql01.dbf
Database file type: file system
Database file size: 1280 8192 byte blocks
[oracle@sourcedb trace]$

8.5 数据库启动检查(正常)

SQL> startup
ORACLE instance started.

Total System Global Area 1202556928 bytes
Fixed Size 2252704 bytes
Variable Size 369098848 bytes
Database Buffers 822083584 bytes
Redo Buffers 9121792 bytes
Database mounted.
Database opened.
SQL>

8.6 bbed恢复 flag

[oracle@sourcedb bbed]$ ./l_bbed.sh

BBED: Release 2.0.0.0.0 - Limited Production on Fri Feb 14 00:16:24 2020

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 5 block 0
FILE# 5
BLOCK# 0

BBED> d offset 0 count 48
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 0 to 47 Dba:0x01400000
------------------------------------------------------------------------
00a20000 00000cff 00000000 00000000 66ff0000 00200000 00050000 7d7c7b7a
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> m /x a081 offset 32
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oradata/epmsn/hsql01.dbf (5)
Block: 0 Offsets: 32 to 79 Dba:0x01400000
------------------------------------------------------------------------
a0810000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> sum apply
Check value for File 5, Block 0:
current = 0xff66, required = 0xff66

BBED>

9. 关于所有类型文件的fileCheck/magicNumber/flag值

dd if=/oradata/epmsn/system01.dbf bs=8192 count=1 | od -x | head -4
0000000 a200 0000 0000 ffc0 0000 0000 0000 0000
0000020 7b67 0000 2000 0000 8100 0001 7c7d 7a7b
0000040 81a0 0000 0000 0000 0000 0000 0000 0000
0000060 0000 0000 0000 0000 0000 0000 0000 0000

dd if=/oradata/epmsn/sysaux01.dbf bs=8192 count=1 | od -x | head -4
0000000 a200 0000 0000 ffc0 0000 0000 0000 0000
0000020 6f67 0000 2000 0000 9500 0001 7c7d 7a7b
0000040 81a0 0000 0000 0000 0000 0000 0000 0000
0000060 0000 0000 0000 0000 0000 0000 0000 0000

dd if=/oradata/epmsn/redo01.log bs=512 count=1 | od -x | head -4
0000000 2200 0000 0000 ffc0 0000 0000 0000 0000
0000020 c867 0000 0200 0000 9000 0001 7c7d 7a7b
0000040 81a0 0000 0000 0000 0000 0000 0000 0000
0000060 0000 0000 0000 0000 0000 0000 0000 0000

dd of control file:
dd if=/oradata/epmsn/control01.ctl bs=16384 count=1 | od -x | head -4
0000000 c200 0000 0000 ffc0 0000 0000 0000 0000
0000020 f8a2 0000 4000 0000 02c4 0000 7c7d 7a7b
0000040 81a0 0000 0000 0000 0000 0000 0000 0000
0000060 0000 0000 0000 0000 0000 0000 0000 0000

fileCheck/magicNumber/flag 在所有类型的文件中值均一样,但fileCheck/magicNumber在db startup阶段需要检查该值,这两个值异常时数据库无法启动,报错信息ORA-27048: skgfifi: file header information is invalid,flag值异常时不影响数据库启动

10、说



1、以上内容为个人多次测试结果,由于个人原因,如有分析不足之处还请见谅及指正。

2、文章涉及内容,请勿在生产环境模拟。

 



0
0