tags:

views:

572

answers:

2

I just had an oracle9 database crash and it left me with a couple of .trc files. Some of them specified indexes that were out of kilter and i dropped and readded those indexes.

However, when I run:

ANALYZE TABLE TABLESPACE.TABLE VALIDATE STRUCTURE CASCADE;

I still get an error: ora_00900, sqlstate: 4200

This creates a .trc file with:

Table/Index row count mismatch
table 1172 : index 1250, 0
Index root = tsn: 9 rdba: 0x0240390b

What do I do with this information?

I found this link, however I'm not sure how to use it: http://www.freelists.org/post/oracle-l/Table-index-mismatch-trace-file,1

A: 

To be honest, with an error like this I would recommend opening an SR with Oracle - you want to make sure you don't lose your data!

Stephen ODonnell
+3  A: 

The error says your indexes (perhaps not the ones you thought) are still bad.

From your link, if you run the query through SQL*PLUS it will ask for a rdba number. Enter the value from your error message '0x0240390b' (no quotes). This will return a file number and a block number.

SELECT dbms_utility.data_block_address_file(
         to_number(trim(leading '0' from
replace('&&rdba','0x','')),'XXXXXXXX')
       ) AS rfile#,
       dbms_utility.data_block_address_block(
         to_number(trim(leading '0' from
replace('&&rdba','0x','')),'XXXXXXXX')
       ) AS block#
FROM dual;

Next run the following query:

select owner, segment_name, segment_type 
from  dba_segments 
where header_file = <rfile#>
  and header_block = <block#>

This will give you the offending index to be dropped and recreated.

Thomas Jones-Low
can this be tweaked so I do not have to type the command through sqlplus? I have easier access to tools like squirrel.
Nathan Feger
Thomas Jones-Low
Got it, that query works. However, the second query doesn't. The dba_extents table has file_id = 9 hits, but nothing matches on the block_id part of the where clause.
Nathan Feger
I fixed the second query to use the correct table, please try the query again.
Thomas Jones-Low