Home > 11gR2, oracle > Corrupt block found – Oracle 11g Release 2

Corrupt block found – Oracle 11g Release 2

I’m getting errors of block corruption in the alert.log of an Oracle 11g Release 2 test database:


Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0xFFFFFFFA7DBAF398] [PC:0x896E0BE, kcbgcur()+3026] [flags: 0x0, count: 1]

check value in block header: 0x46c2
 computed block checksum: 0x0
Reading datafile '/app/oracle/oradata/database2/sgirgea_01.dbf' for corruption at rdba: 0x0a808912 (file 42, block 35090)
Reread (file 42, block 35090) found same corrupt data (no logical check)
Corrupt Block Found
 TSN = 46, TSNAME = SGIRGEA
 RFN = 42, BLK = 35090, RDBA = 176195858
 OBJN = 0, OBJD = 258730, OBJECT = SGIRGEA, SUBOBJECT =
 SEGMENT OWNER = , SEGMENT TYPE = Temporary Segment
Hex dump of (file 42, block 35218) in trace file /app/oracle/diag/rdbms/database1/database1/trace/sid_w000_23395.trc
Corrupt block relative dba: 0x0a808992 (file 42, block 35218)
Bad header found during buffer read
Data in bad block:
 type: 35 format: 2 rdba: 0x01408992
 last change scn: 0x0000.000b6126 seq: 0x3 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x61262303
 check value in block header: 0xcffd
 computed block checksum: 0x0

In this case it’s not a data corruption,  I’ts due to a silly mistake in the creation of a tablespace.

I have two databases created on the same server (it’s a test server), and the datafiles of the two databases in different folders:

  • /app/oracle/oradata/database1: datafiles of the database 1.
  • /app/oracle/oradata/database2: datafiles of the database 2.

I’m testing an application with different database configurations. So, I created this user in database 1, with its own datafile, but by mistake I created the datafile on /app/oracle/oradata/database2, the folder for the other database’s datafiles.

Then, I did the same for the database 2, created the same user, with its own tablespace, and now, I created the datafile correctly in its own folder (/app/oracle/oradata/database2), with the same name as the other database’s datafile. This is an illustration of this mistake:

Oracle shared datafile

Oracle shared datafile

When I noticed the error in the alert log, I performed a backup of the user on both databases. Then, dropped the user in database 1 to recreate it again, but when I try to delete the tablespace in database 1 I get this error:


SQL@database1> drop tablespace sgirgea;
drop tablespace sgirgea
*
ERROR at line 1:
ORA-01122: database file 42 failed verification check
ORA-01110: data file 42: '/app/oracle/oradata/database2/sgirgea_01.dbf'
ORA-01210: data file header is media corrupt

Trying to alter the tablespace to bring it offline doesn’t works:


SQL@database1> alter tablespace sgirgea offline;
alter tablespace sgirgea offline
*
ERROR at line 1:
ORA-01122: database file 42 failed verification check
ORA-01110: data file 42: '/app/oracle/oradata/database2/sgirgea_01.dbf'
ORA-01210: data file header is media corrupt

I try to bring the tablespace offline with the database mounted, but I can not shutdown the database for the same reason:


SQL@database1> shutdown immediate;
ORA-01122: database file 42 failed verification check
ORA-01110: data file 42: '/app/oracle/oradata/database2/sgirgea_01.dbf'
ORA-01210: data file header is media corrupt

Prior to a shutdown abort, I tried to offline the datafile, instead of the tablespace:


SQL@database1> alter database datafile 42 offline;
alter database datafile 42 offline
*
ERROR at line 1:
ORA-01145: offline immediate disallowed unless media recovery enabled

But it’s not possible because the database is in NOARCHIVELOG mode, as this is a test environment.

Finally, I tried an offline drop of the datafile and it worked. Then just dropped the tablespace just including contents, not the datafile (without the “including contents and datafiles” clause, only “including contents“):


SQL@database1> alter database datafile 42 offline drop;

Database altered.

SQL@database1> drop tablespace sgirgea including contents;

Tablespace dropped.

Then I checked for the datafile and it’s still there, and it’s correctly attached to database2, and everything works fine on database 2. Just have to recreate the same user in database 1 to continue testing.

Please, feel free to leave your comments below.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: