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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How do I corrupt a block

Re: How do I corrupt a block

From: George Schlossnagle <george_at_omniti.com>
Date: Thu, 31 May 2001 14:27:33 -0700
Message-ID: <F001.00317125.20010531143308@fatcity.com>

You can write a little perl script to write over the block. Just open the datafile, sysseek to (block_number)*(block_size), then syswrite(chr(0),block_size). Strangely though, the naive approach of overwriting a block entirely with nulls results in a block which is not detectable with dbms_repair (though you will definitely get a corrupt block error).

If you want to be more clever (for example, altering the itl lists in the block, which is detectable by dbms_repair), then I would recommend do a formatted dump with alter system dump datafile .... the doing a raw dump of the block with dd if=... ibs=block_size skip=block_number count=1, viewing that with a hex editor and then comparing the two. The location and structure of the header components is pretty obvious. You can then use the method above to change what you want to change.

Of course, doing any of this can damage your database beyond repair and you won't be supported by oracle support, etc.

George

>
> It apparently is only on NT, and unless you have the password,
> which is known only to Oracle Support Personnel, you can't
> use it.
>
> http://www.ixora.com.au/q+a/0101/23224038.htm
>
> Jared
>
>
> On Thursday 31 May 2001 12:10, K Gopalakrishnan wrote:
> > Hi !
> >
> >
> > The simple thing is you can edit the datablocks using
> > BBED editor. It is shipped with Oracle and You need a
> > password to use that utility. You can browse and edit
> > the data blocks.
> >
> >
> > $BBED will give the required details. BUT IT IS
> > DANGEROUS>>>>>>>>>>>>
> >
> > --- novicedba <novicedba_at_hotmail.com> wrote:
> > > hi,
> > > This may sound funny. I want to know how to
> > > corrupt a block. I want to test the different
> > > methods of identifying block corruption, but I don't
> > > have sample data blocks.
> > > Please help me
> > >
> > > novice
> >
> > =====
> > Have a nice day !!
> > ------------------------------------------------------------
> > Best Regards,
> > K Gopalakrishnan,
> > Bangalore, INDIA.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail - only $35
> > a year! http://personal.mail.yahoo.com/
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Jared Still
> INET: jkstill_at_cybcon.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: George Schlossnagle
  INET: george_at_omniti.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu May 31 2001 - 16:27:33 CDT

Original text of this message

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