Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Data Block corruption
Thanks - for this it was the kind of info I was after:
I dumped the block and look at the .trc file, but could not find the
Dump of memory from 0x1A65714 to 0x1A676FC 1A65710 00000000 00000000 00000000 [............]
Any suggestions?
Thanks
koert54 wrote:
> 1. use hot backup - if your backup doesn't contain the corruption of
> course - offline datafile, restore, recover etc
> 2. start fiddling around :
> - find out the object id by :
> * try to dump the block : alter system dump datafile 11 block 27874 ;
> * go to udump and open the trace file
> * look for seg/obj: 0xs140 -> hex to dec -> your OBJECTID
> * select owner, object_name, object_type from dba_objects where
> object_id=<OBJECTID>
> - if OBJECT_TYPE = INDEX -> *REBUILD* index
> - if OBJECT_TYPE= TABLE - use of recent export
> * find out which records are stored in the corrupted block by using your
> PK index
> - get the rowid's surrounding the corrupted block :
> select dbms_rowid.rowid_create(<rowid_type> , <object_number>
> ,<relative_fno>, <block_number> from dual ; -> low rowid
> select dbms_rowid.rowid_create(<rowid_type> , <object_number>
> ,<relative_fno>, <block_number+1> from dual ; -> high rowid
> - now you know the rowid's - we can partially extract the corrupted
> data out of the indexes
> create table salvage as select /*+ INDEX(<corrupted table>
> <PKINDEX>) */
> <indx_col1> x1, <indx_col2> x2 from <corrupted table> where
> rowid >= 'low rowid' and rowid < 'high rowid'
> * let's export the latest data and skip the corrupted block :
> - exec dbms_repair.skip_corrupt_blocks('<owner>', '<corrupted
> table>') ;
> - exp system/manager tables=<owner>.<corrupted table>
> * drop the corrupted table
> * import the table - the data in the corrupted block is now gone - but
> we know which records are missing (they are
> in the table salvage)
> * so now we import the table from a recent export dump into another
> schema (hoping the data in the corrupted block
> was static or hasn't changed after the export)
> * if we now put the pieces together we can insert the missing records by
> using the salvage table (PK) and the table
> in the other schema (rest of the columns)
>
![]() |
![]() |