Thursday, July 23, 2015

ORA-01163: SIZE clause indicates (blocks), but should match header

I have generated a control file using “backup control file to trace” but while recreating I have encountered below error

ERROR at line 1:
ORA-01163: SIZE clause indicates 32768 (blocks), but should match header 262144
ORA-01517: log member: '/oracle/TEST/redo1/TEST_redo1.rdo'

I see that the failure is due to log member size. But the current redo log file size on the disk and in the script is correct. I ran below query to find the redo log BLOCKSIZE and found that the size is 4096.

select * from v$log;

I tried couple of options to recreate the control file by changing the redo log size in KB/MB/Bytes..etc but nothing worked. After investigation I found that drop and recreating the redo log is only the option.

Other possible scenarios/errors
1. If you receive the same ORA-01163 error for DATA FILE then your size calculation might be incorrect.

    Use below formula to get the size.
    Expected size = Expected no of blocks * db_block_size / 1024

2. ORA-01378: The logical block size (4096) of file /oracle/TEST/redo1/TEST_redo1.rdo'is not
    compatible with the disk sector size (media sector size is 512 and host sector size is 512)

If you receive above error you ned to set below parameter
SQL> alter system set "_disk_sector_size_override"=TRUE scope=both;

Reference for more info.
ORA-00344: WHEN RESIZING YOUR REDO LOGS (Doc ID 1018307.102)

Satishbabu Gunukula, Oracle ACE