[Translated from mos] how to detect and solve the damage to the datafile OS header (Block Zero -,
How to detect and resolve corruption of datafile OS header (Block Zero)-ORA-27047 DBV-107 ORA-1157/ORA-27048
Source:
How to Detect and Fix a previous uption in the Datafile OS Header/Block Zero-ORA-27047 DBV-107 ORA-1157/ORA-27048 (Document ID 360032.1)
Applicable:
Oracle Database-Enterprise Edition-Version 8.0.5.0 to 12.1.0.2 [Release 8.0.5 to 12.1]
Information in this document applies to any platform.
* ** Checked for relevance on 02-FEB-15 ***
Symptoms:
Knowledge about OS block in oracle file: 1.The OS Block Header is the first block in datafile, which is used by oracle to store operating system information. 2. Its block number is Zero (It is the Block Zero), while the block number of the datafile header is 1. These two headers are not the same thing. 3. Damage to Block Zero will not cause data damage. Before oracle 11g, the damage to Block Zero cannot be detected by dbv or rman. Dbv of 11G has been improved (enhanced), and dbv of 11g can detect Block Zero damage. 4. dbfsize can be used to check the consistency of Block Zero. note: For examples of dbfsize, see my article: http://blog.csdn.net/msdnchina/article/details/43345445 5. when Block Zero is damaged, sometimes the database may be open and there is no error (no errors ). Block Zero is checked (checked) in the following circumstances: 5.1 some specific database operations, such as 'create controlfile' 5.2 In the 11g version, when the database is opened.
Symptoms:
1. When the OS block header is invalid, creating a control file may report a ORA-27047 on a specific datafile
ORA-27047 : unable to read the header block of file.
The following is an example of 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
2. The dbv utility earlier than 11g does not report a partition uption on the data file, and the 11g dbv reports an error "DBV-00107: Unknown header format"
3. database upgrade (open migrate) or normal open may fail with an error: ORA-01157 ORA-27048
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file ORA-01110: data file 1: '/oracle/dbs/system.dbf' ORA-27048: skgfifi: file header information is invalid
Cause:
The OS block header (Block 0) in datafile is damaged.
1. The Oracle utility dbfsize can be used to identify upload uption
$ dbfsize /oradata/users.dbf Header block magic number is bad
Other errors identified by dbfsize include:
/oradata/users.dbf: Header block file size is bad; trying raw file format... /oradata/users.dbf: Header block magic number is bad
2. Invalid datafile copy will cause this problem. One example is when the OS command dd is used for file copying on bare devices and file systems. Reference Bug 4307836 (closed as not a bug) in HPUX.
3. File System corruption may cause this problem.
4. This issue may be caused by the release of the company's service. For details, see Note: 373595.1.
5. Bug 4721022/Bug 4724358 may also cause it. See Note 4724358.8
Solution:
Copy the open database and resize the datafile.
1. resizing datafile will reformat the OS block header
alter database datafile '/oradata/users.dbf' resize <new size>;
Run dbfsize to confirm that the block has been fixed:
$ dbfsize /oradata/users.dbf Database file: /oradata/users.dbf Database file type: file system Database file size: 51200 8192 byte blocks
Note: If the original size is resize, an error is returned after reconstruction. You need to resize a different size. -- Source: http://www.cnblogs.com/rootq/archive/2012/12/12/2814579.html
2. If fsck is run on the file system due to damage to the file system, the problem may be fixed.
3. Another method to solve this problem is to restore recover the affected file from the backup.
References
NOTE: 4724358.8-Bug 4724358-ORA-27045 ORA-1578 ORA-27047 commit uption caused by DBMS_LDAP
BUG: 4721022-ORA-27045 reported intermittently and with block uptions
BUG: 4724358-USING DBMS_LDAP with connection pooling can cause resume uption/ORA-27045
NOTE: 373595.1-ORA-1578 ORA-27047 ORA-27048 Corrupt blocks when using RMAN/NetBackup