Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help Dumping a Block

Re: Help Dumping a Block

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 04 Dec 2006 08:37:14 -0800
Message-ID: <1165250234.959296@bubbleator.drizzle.com>


hpuxrac wrote:
> DA Morgan wrote:

>> hpuxrac wrote:
>>> DA Morgan wrote:
>>>> Does anyone know how to dump an Oracle block as just the binary
>>>> data without formatting or commenting as part of the process?
>>>>
>>>> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 21229;
>>>>
>>>> Is not what I need.
>>>>
>>> Use the unix dd command.
>> How would you use that to extract a single known block?
>>
>> Say, for example, the block referred to in this query?
>>
>> SELECT album, dbms_rowid.rowid_to_absolute_fno(rowid, 'UWCLASS',
>> 'BOWIE_STUFF') ABSOLUTE_FNO, dbms_rowid.rowid_block_number(rowid)
>> BLOCKNO, dbms_rowid.rowid_row_number(rowid) ROWNUMBER
>> FROM bowie_stuff
>> WHERE album LIKE '%Dogs%';
>>
>> ALBUM                          ABSOLUTE_FNO BLOCKNO    ROWNUMBER
>> ------------------------------ ------------ ---------- ----------
>> Diamond Dogs                              6       8586          1
>>
>> File number 6 is easy to find. But how would I find block 8586 with dd?
>>

>
> You could write a little plsql procedure ... allow an input variable to
> contain the query ( as above ) that you want to execute. Maybe some
> other variables with default variables to contain the name of the
> output shell script and the output file that will be produced.
>
> Use utl_file to create as output a shell script that contains a dd
> command.
>
> #!/bin/ksh
> dd if="file_name_from_lookup_of_file" of="whatever_file_name_you_want"
> bs=<db_block_size> skip="how_many_blocks_to_skip" count=1
>
> You might have to fudge around some with skip depending on os platform
> and also whether you are running on raw partitions or not.
>
> There's probably some way you could do this if you are running ASM but
> I would start by getting this operational without ASM first.
>
> WIthout the ASM complication this is really pretty basic stuff.

Thanks.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Mon Dec 04 2006 - 10:37:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US