You are on page 1of 3

Page 1 of 3

How to detect and fix a corruption in the datafile OS header/Block Zero - ORA-
27047 [ID 360032.1]

Modified 22-APR-2010 Type PROBLEM Status PUBLISHED

Applies to:

Oracle Server - Enterprise Edition - Version: 8.0.5.0 to 11.2.0.1 - Release: 8.0.5 to 11.2
Oracle Server - Enterprise Edition - Version: 8.0.5.0 to 11.2.0.1 [Release: 8.0.5 to 11.2]
Information in this document applies to any platform.

Symptoms

OS block in an Oracle file

The OS Block Header is in the first datafile block. It is used by Oracle to store Operating System
information.
It is the Block Zero. It is not the datafile header which is in Oracle Block 1.
Corruption in Block Zero will not cause damage to the data and it is not detected by dbverify/rman.
When this block is corrupted the database may be opened with no errors.

@ This block contains a magic number to identify the platform, the size of the datafile in

Symptoms

Creating the control file may report error ORA-27047 when OS block header is invalid for a particular
datafile:

ORA-27047 : unable to read the header block of file.

Example taken from HPUX:


ORA-1503: CREATE CONTROLFILE failed
ORA-1565: error in identifying file '/oradata/users.dbf'
ORA-27047: unable to read the header block of file
HP-UX Error: 22: Invalid argument
Additional information: 2

DBVerify does not report a corruption in the datafile.

Cause

OS block in the datafile is corrupted.

The corruption is identified by the Oracle utility dbfsize:

$ dbfsize /oradata/users.dbf
Header block magic number is bad

Other errors by dbfsize can be:

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PROBLE... 24/06/2010
Page 2 of 3

/oradata/users.dbf: Header block file size is bad; trying raw file format...
/oradata/users.dbf: Header block magic number is bad

This can be caused by an invalid copy of the datafile. Example is when copying files between raw devices
and file systems using the OS command dd. Reference Bug 4307836 (closed as not a bug) in HPUX.

A file system corruption may cause this.

It can be caused by NetBackup as described in Note:373595.1

Bug 4721022 / Bug 4724358 may also cause it. See Note 4724358.8

Solution

Open the database using a good controlfile copy and resize the datafile.

Resizing the datafile will reformat the OS block header.

alter database datafile '/oradata/users.dbf' resize <new size>;

Run dbfsize to confirm that the block is repaired:

$ dbfsize /oradata/users.dbf

Database file: /oradata/users.dbf


Database file type: file system
Database file size: 51200 8192 byte blocks

If a file system corruption caused it, run fsck on the file system which may fix it.
Another option is to restore/recover the affected file from a backup.

bug:4307836note:373595.1bug:4721022bug:4724358bug:4307836bug:4721022bug:4724358

References

BUG:4721022 - ORA-27045 REPORTED INTERMITTENTLY AND WITH BLOCK CORRUPTIONS


BUG:4724358 - USING DBMS_LDAP WITH CONNECTION POOLING CAN CAUSE CORRUPTION / ORA-
27045
NOTE:373595.1 - OS datafile header or Block 2 are CORRUPT when using RMAN / NetBackup
NOTE:4724358.8 - Bug 4724358 - ORA-27045 ORA-1578 ORA-27047 corruption with DBMS_LDAP bytes

Related

Products

Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition

Keywords

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PROBLE... 24/06/2010
Page 3 of 3

CONTROLFILE; CREATE~CONTROLFILE; DATA~CORRUPTION


Errors

ORA-1565; ORA-27047; ORA-1503

Back to top

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PROBLE... 24/06/2010