Routine to corrupt a block [message #515969] |
Thu, 14 July 2011 05:51 |
John Watson
Messages: 8941 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Does anyone have a repeatable technique for damaging a datafile block?
I need to demonstrate and contrast various recovery techniques, such as dbms_repair, RMAN block recovery, and Data Guard automatic block repair.
Ideally, I'll end up with a shell script (or batch file) where I can enter a file number and block number, and wipe out that block.
Thanks for any suggestions.
|
|
|
|
Re: Routine to corrupt a block [message #515991 is a reply to message #515983] |
Thu, 14 July 2011 07:16 |
John Watson
Messages: 8941 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Thanks, this works:
#!/bin/ksh
# script to damage a block, for testing block repair routine
# assumes 16k blocksize
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=16384 conv=notrunc oseek=$BLOCK
I execute this script, reading in some junk from STDIN:
$HOME/corrupt.sh o1_mf_mars_dat_7vsfhfqx_.dbf 13140 < junk.txt
and the block is broken.
ps - I did try to search the forum before asking for help! Really! I was getting Quote:Too many concurrent search requests. Please try again later.
|
|
|
|