Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail
From: "hpuxrac" <johnbhurley@sbcglobal.net>
Newsgroups: comp.databases.oracle.server
Subject: Re: How to corrupt oracle block
Date: 11 Nov 2005 09:40:40 -0800
Organization: http://groups.google.com
Lines: 50
Message-ID: <1131730840.656138.159850@f14g2000cwb.googlegroups.com>
References: <1131719641.604060.30300@g49g2000cwa.googlegroups.com>
NNTP-Posting-Host: 208.44.49.5
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1131730845 21759 127.0.0.1 (11 Nov 2005 17:40:45 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 11 Nov 2005 17:40:45 +0000 (UTC)
In-Reply-To: <1131719641.604060.30300@g49g2000cwa.googlegroups.com>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 PROXY
Complaints-To: groups-abuse@google.com
Injection-Info: f14g2000cwb.googlegroups.com; posting-host=208.44.49.5;
   posting-account=Dz_3bQ0AAAC5LZNB2NPEJz1sl_a8qcDY
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.server:255241

Js wrote:
> Hi,
>
> I want to corrupt the oracle block for testing purpose on my test
> machine.
>
> Can one tall me how can we do this.
>
> I heard that we can do that using "dd"  ...
>
> Please suggest.
>
> Regards,
> Js

Disclaimer severe damage may result.  Make sure you have anything
necessary backed up.  Do not do this on a production system!

The best advice would be to open a tar with oracle and get them to
supply info.  But they won't do that ( at least easily ) when the
subject is how to corrupt a block.

Then proceed carefully and do some queries to identify what block you
want to wack!

The following script will ( perhaps ) work on a cooked file system.

*** Script supplied by oracle in the advanced rman class ...

> more corrupt.sh
#!/bin/ksh
FILE=${1:?'Parameter 1 should be set to file name'}
BLOCK=${2:?'Parameter 2 should be set to the block to be corrupted'}
dd of=$FILE bs=8192 conv=notrunc oseek=$BLOCK <<EOF
CORRUPT
EOF

You may have to do something a little differently on a raw partition
and perhaps adjust the seek value ( from what block oracle thinks it is
) ( varies by os and logical volume manager setup )

> more bad_block.sh
#!/bin/ksh
dd if=/home/oracle/badb13.dd of=/dev/vs_4/r_(fill_in_raw_partion)_.dbf
bs=8192 seek=13 count=1

> more badb13.dd
************************ (just a bunch of characters or whatever you
want ) ****

