Re: events to corrupt a database

  • From: Kenny Payton <k3nnyp@xxxxxxxxx>
  • To: howard.latham@xxxxxxxxx
  • Date: Wed, 14 May 2014 11:07:06 -0400

If you’re using dd be sure to look into the conv notrunc option.  If you’re 
trying to update 8K in the middle of a file the last thing you want is to be 
left with a single 8k file.  ASM makes this a little more complex but doing the 
same I have copied files from ASM to a filesystem to corrupt them and then 
copied them back.  You would want the database down, or datafile offline, 
during the copy of course.

I’ve used dd for this same purpose on a number of occasions.  I’ve also used it 
for some more bizarre ( and I might add unsupported ) operations.  One 
interesting option was to fix a corrupt block in production where an archive 
log was inadvertently deleted during a failed backup prior to correcting the 
corrupt database block.  The corrupt block could not be rolled forward to 
current due to missing archived logs but enough redo was available to recover 
the block beyond the point it was corrupted.  I used dd to surgically copy the 
recovered block from the alternate datafile to the existing production 
datafile.  Not something I would recommend but interesting nonetheless.

Sometimes even the simplest tool, even one you might never think you would ever 
use, can get you out of a bind.  I’ve also used dd and md5sum to save a 
colleague from re-copying multiple terabytes of datafiles during a botched 
transportable tablespace effort.  

Kenny


On May 13, 2014, at 3:19 PM, Howard.latham <howard.latham@xxxxxxxxx> wrote:

> I once had a problem where users couldnt connect, turned out an index on aud$ 
> was corrupt. Drop it and all was well, so you could create an error by 
> filling up the ts where aud$ is stored. For example. 
> 
> 
> 
> 
> Sent from Samsung tablet
> 
> 
> 
> -------- Original message --------
> From Josh Collier <Josh.Collier@xxxxxxxxxxxx> 
> Date: 13/05/2014 17:00 (GMT+00:00) 
> To Martin Berger <martin.a.berger@xxxxxxxxx> 
> Cc oracle-l@xxxxxxxxxxxxx 
> Subject RE: events to corrupt a database 
> 
> 
> Hi Martin
> 
>  
> 
> The purpose is to break a database and then give it to someone else so they 
> can practice troubleshooting and recovery steps.
> 
>  
> 
> From: Martin Berger [mailto:martin.a.berger@xxxxxxxxx] 
> Sent: Monday, May 12, 2014 11:55 AM
> To: Josh Collier
> Cc: oracle-l@xxxxxxxxxxxxx
> Subject: Re: events to corrupt a database
> 
>  
> 
> I see it a hard task to corrupt a database at will. Especially if it is set 
> up properly :-) 
> 
>  
> 
> It depends on the kind of corruption you want to achieve. For some small, but 
> very specific block corruptions I'd use BBED. Or I'd take a previous copy of 
> datafiles/redos and replace some blocks from the current files using dd. 
> 
> But there are also some funny ways to confuse people: in a running DB, rename 
> any datafile and create a symlink with that name pointing to any other 
> datafile. 
> 
>  
> 
> It all depends on the type of corruption you want to create? what's the 
> purpose at all? 
> 
>  
> 
>  
> 
>  
> 
> On Mon, May 12, 2014 at 8:16 PM, Josh Collier <Josh.Collier@xxxxxxxxxxxx> 
> wrote:
> 
> I am looking for different events to set that will corrupt a database, or 
> mimic a crash or error condition. For testing and training purposes? Any 
> awesome ways to break an oracle database beyond the standard “delete a live 
> redo log”, “delete a live datafile”, and “kill pmon”
> 
>  
> 
> Josh C.
> 
>  
> 

Other related posts: