Re: Intentional Corruption

From: Roman Podshivalov <roman.podshivalov_at_gmail.com>
Date: Thu, 14 Feb 2008 12:21:39 -0500
Message-ID: <55f303590802140921s4927dbd0ha1b001f606516e32@mail.gmail.com>


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_at_att.net> 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
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Feb 14 2008 - 11:21:39 CST

Original text of this message