Re: How does one manually corrupt a database (database file, redo logs and backups)

echo "<somewhat string>" >> oracle_file

This should alter the file offset (I don't know if this is
the correct technical term) for every binary file and thus
making it corrupted towards and Oracle db.
The command should also work for both unix and windows.

try it, I doubt it..appending junk at the end of a datafile might not cause any headache until the next autoextend...

On Solaris:

09:18:51 SYS@ora10gr2> create tablespace test datafile '/app/oracle/oradata/ora10gr2/tes01.dbf' size 5m reuse;

Tablespace created.

09:18:59 SYS@ora10gr2> !dbv file=/app/oracle/oradata/ora10gr2/tes01.dbf

DBVERIFY: Release 10.2.0.2.0 - Production on Sun Sep 3 09:19:12 2006

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

DBVERIFY - Verification starting : FILE = /app/oracle/oradata/ora10gr2/tes01.dbf


DBVERIFY - Verification complete

Total Pages Examined         : 640
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 8
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 632
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Highest block SCN            : 8128994 (0.8128994)

09:19:12 SYS@ora10gr2> !echo "hello hello hello" >> /app/oracle/oradata/ora10gr2/tes01.dbf

09:19:18 SYS@ora10gr2> !dbv file=/app/oracle/oradata/ora10gr2/tes01.dbf

DBVERIFY: Release 10.2.0.2.0 - Production on Sun Sep 3 09:19:23 2006

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

DBVERIFY - Verification starting : FILE = /app/oracle/oradata/ora10gr2/tes01.dbf


DBVERIFY - Verification complete

Total Pages Examined         : 640
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 8
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 632
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Highest block SCN            : 8128994 (0.8128994)

09:19:23 SYS@ora10gr2> !dd if=/dev/null of=/app/oracle/oradata/ora10gr2/tes01.dbf count=1 seek=3 bs=8192
0+0 records in
0+0 records out


09:19:35 SYS@ora10gr2> !dbv file=/app/oracle/oradata/ora10gr2/tes01.dbf

DBVERIFY: Release 10.2.0.2.0 - Production on Sun Sep 3 09:19:41 2006

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


DBV-00102: File I/O error on FILE (/app/oracle/oradata/ora10gr2/tes01.dbf) during end read operation (-1)


09:19:41 SYS@ora10gr2> alter system checkpoint;

System altered.

09:19:57 SYS@ora10gr2> !dd if=/dev/null of=/app/oracle/oradata/ora10gr2/tes01.dbf count=1 seek=1 bs=8192
0+0 records in
0+0 records out


09:20:11 SYS@ora10gr2> alter system checkpoint;

System altered.

09:20:18 SYS@ora10gr2>


alert.log content:

Sun Sep 3 09:18:55 2006
create tablespace test datafile '/app/oracle/oradata/ora10gr2/tes01.dbf' size 5m reuse
Sun Sep 3 09:18:57 2006
Starting control autobackup
Control autobackup written to DISK device
handle '/siriofs/oracle/backup/ora10gr2_bck/control_c-3888264759-20060903-0a'
Completed: create tablespace test datafile '/app/oracle/oradata/ora10gr2/tes01.dbf' size 5m reuse
Sun Sep 3 09:19:57 2006
Beginning global checkpoint up to RBA [0xbe.14d9e.10], SCN: 8129034
Completed checkpoint up to RBA [0xbe.14d9e.10], SCN: 8129034
Sun Sep 3 09:20:17 2006
Beginning global checkpoint up to RBA [0xbe.14e15.10], SCN: 8129079
Sun Sep 3 09:20:18 2006
Errors in file /app/oracle/admin/ora10gr2/bdump/ora10gr2_ckpt_4436.trc:
ORA-01171: datafile 8 going offline due to error advancing checkpoint
ORA-01110: data file 8: '/app/oracle/oradata/ora10gr2/tes01.dbf'
ORA-01115: IO error reading block from file 8 (block # 1)
ORA-27063: number of bytes read/written is incorrect
Additional information: 8192
Completed checkpoint up to RBA [0xbe.14e15.10], SCN: 8129079



Regards Dimitre


-- http://www.freelists.org/webpage/oracle-l


Other related posts: