Re: Read a corrupted block

  • From: Tim Gorman <tim@xxxxxxxxx>
  • To: Joel.Patterson@xxxxxxxxxxx
  • Date: Thu, 29 Jul 2010 09:39:08 -0600

Joel,

DUDE probably is overkill for one block, but it depends on the value of the data.  If you think about the cost of a DBA, an IT manager, a business manager, and a business analyst all working 4-8 hours trying to diagnose and clean up the mess caused by the data lost in a small number of blocks, then the $1000-$5000 spent on DUDE becomes a bargain.  Kurt Van Meerbeeck (http://www.ora600.be) is the creator of DUDE and Dan Fink and I are the US contacts for Kurt.

There is the ALTER SYSTEM DUMP DATAFILE command, with the following syntax...
SQL> alter system dump datafile '<file-name>' | <file#> block [ <block#> | block min <beginning-block#> block max <ending-block#> ];
where...
  • "<file-name>" is the name of the Oracle datafile
  • "<file#>" is the FILE_ID of the Oracle datafile
  • "<block#>" is the database block number
  • "<beginning-block#>" is the starting block number within the datafile
  • "<ending-block#>" is the ending block number within the datafile
The output will be dumped to an Oracle trace file within the USER_DUMP_DEST directory.  Example ALTER SYSTEM DUMP DATAFILE commands include...
  • alter system dump datafile '+DATA_DG/datafile/PROD/system_1_123456.dbf' block 32;
  • alter system dump datafile 3932 block min 100 block max 200;
The first command dumps one block from the indicated ASM datafile in the SYSTEM tablespace.  The second command dumps 101 blocks from datafile #3932.

Of course, I long for the grand old days of the DEC VMS "dump" command, but on UNIX/Linux you might consider something like the following...
$ dd if=<file-name> bs=<db-block-size> seek=<beginning-block#> count=<#blocks> | od -cx > <output-filename>
where...
  • "<file-name>" is the name of the Oracle datafile
  • "<db-block-size>" is the size of the Oracle database blocks in that tablespace
  • "<beginning-block#>" is the starting block number within the datafile
  • "<#blocks>" is the number of blocks you wish to dump
So, the UNIX/Linux "dd" command extracts the block(s) from the datafile and the UNIX/Linux "od" (a.k.a. "octal dump") command translates the stream into "ASCII character" (i.e. "-c" flag) and hexadecimal (i.e. "-x" flag).

Hope this helps...
Tim Gorman
consultant -> Evergreen Database Technologies, Inc.
postal     => P.O. Box 630791, Highlands Ranch CO  80163-0791
website    => http://www.EvDBT.com/
email      => Tim@xxxxxxxxx
mobile     => +1-303-885-4526
fax        => +1-303-484-3608
Lost Data? => http://www.ora600.be/ for info about DUDE...

On 7/29/2010 8:46 AM, Joel.Patterson@xxxxxxxxxxx wrote:

When all hope fails – block recover, dbms_repair, etc.  and before you enable skipping corrupt blocks, is there some utility that can show me what is in the block?

 

Something like a hex reader, but since it is only one block, (and we are probably going to be getting rid of that data anyway), the method should be free.  (For instance, I think dude (possible spelling) is something that could work, but for one block it would be overkill).

 

Even if it is not free, you could let me know.   I probably won’t get it, but the information would be useful, and the question has been raised.

 

 

 

-- //www.freelists.org/webpage/oracle-l

Other related posts: