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: Creating a corrupt block(s)

Re: Creating a corrupt block(s)

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Thu, 09 Feb 2006 00:51:12 GMT
Message-Id: <pan.2006.02.09.00.51.12.16752@sbcglobal.net>


On Wed, 08 Feb 2006 13:00:50 -0800, BrainDead wrote:

> Hi,
> Does anyone know a way to create a corrupt block or blocks in an Oracle
> tablespace ?
> I want to checkout the DBMS_REPAIR package for real.
> I'm running 10G on Windows XP.
> Ideally I would like a Perl or java program.
>
> cheers, BrainDead

#!/usr/bin/perl -w
use strict;
my $ring= << 'DOOM'
Three Rings for the elven kings, under the sky Seven for the dwarf lords, in their halls of stone Nine for mortal men, doomed to die
and one for the Dark Lord, on his dark throne in the land of Mordor, where the shadows lie

One Ring to rule them all, One Ring to find them One Ring to bring them all, and in the darkness bind them in the land of Mordor, where the shadows lie DOOM
;

open FLE,">system01.dbf";
for (my $i=0;$i<100;$i++) {

    print FLE "$i:\n$ring\n";
}

This program should create a few corrupt blocks in your database file. You should only replace the name system01.dbf with the file you want to corrupt.

-- 
http://www.mgogala.com
Received on Wed Feb 08 2006 - 18:51:12 CST

Original text of this message

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