Re: Intentional Corruption

  • From: "Roman Podshivalov" <roman.podshivalov@xxxxxxxxx>
  • To: ahbaid@xxxxxxx
  • Date: Thu, 14 Feb 2008 12:21:39 -0500

Hi,

Disclaimer: I'm not a lawyer and this is not a legal advice 8-) And please
do not do this on your production system ;-)

Described approach should work if your datafiles are located on the
filesystem and your system is a UNIX one

- calculate the offset in bytes for your table in the datafile by using
dba_extents view and the fact that size of any datafile is one database
block over the size reported in v$datafile  (alternatively you can use
DBMS_ROWID to corrupt a specific row)
- dd if=/dev/zero of=<datafile> bs=1 seek=<calculated offset> count=<number
of bytes to corrupt> conv=notrunc (this syntax is for Solaris)
- in shell sync; sync; sync to make sure filesystem cache was flushed to
disk.
- flush your db cache by using alter system flush buffer_cache
- do a full table scan

That should be enough to detect a corruption.

PS: you can experiment with <number of bytes to corrupt> or <calculated
offset> to get desired result. Keep in mind that you should aim to corrupt
the blocks below HWM of the target table in order for FTS to detect a
corruption.

--romas

On 2/14/08, Ahbaid Gaffoor <ahbaid@xxxxxxx> wrote:
>
> Is there a way to intentionally introduce block level corruption?
>
> I'd like to play with some scenarios to learn more about DBMS_REPAIR
>
> thanks
>
> Ahbaid
> --
> //www.freelists.org/webpage/oracle-l
>
>
>

Other related posts: