See http://orafaq.com/papers/dissassembling_the_data_block.pdf bbed - main commands
http://oracleprof.blogspot.com/2009/06/asm-and-bbed.html to use bbed with ASM
#create bbed
#avoid history
sh
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

#Generate using v$datafile
#add more datafiles to use as backup and buffer 8192_local_autosize_autospace_log.zip
[a.txt]
2 /ora01_aol/AOL_PRE/data/tools01.dbf 1048576000

[par.bbd]
blocksize=8192
listfile=a.txt
mode=edit

./bbed parfile=par.bbd

password: <This is an Oracle internal tool>

dump a block
	dump file 3 block 36
	dump file 2 block 36 count 8200
	#dump as a string
	dump /v dba 2,1 offset 0 count 512

verfify a block
	verify file 3 block 1
	
backup a block
	copy file 2 block 36 to file 3 block 1
	
verify checksum
	sum file 2 block 36
	#and apply cheksum
	sum file 2 block 36 apply
	
modify a block
	modify /x 6c6f676f file 2 block 9983 offset 873
	modify /x 6c6f6aaf dba 2,9983
	
find a string over a block
	find /c RCC TOP
	#find next
	f

 

How to read it
#Offset 0
0ba20000 00800001 00000000 00000104
#Offset 4
0ba20000 00800001 00000000 00000104

Examples

db
CREATE CONTROLFILE set DATABASE RCC_PRO RESETLOGS FORCE LOGGING NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01161: database name RCC_SCT in file header does not match given name of
RCC_PRO
ORA-01110: data file 2: '/ora01_rcc/RCC_PRO/data/undotbs01.dbf'

change the db name on file header
[a.txt]
2 /ora01_rcc/RCC_PRO/data/undotbs01.dbf

dump /v dba 2,1 offset 32 count 16
    Block: 1       Offsets:   32 to   47  Dba:0x00800001
    -------------------------------------------------------
    5243435f 53435400 00000e82 0000fa00 l RCC_SCT.........

modify /c RCC_PRO file 2 block 1 offset 32

Change the tablespace name
dump /v dba 2,1 offset 338 count 500
modify /c "      " file 2 block 1 offset 338
#REPAIR
#modify /c "SYSTEM" file 2 block 1 offset 338

#view the block checksum, a mismatch will be reported
sum file 2 block 1
#force save the new checksum
sum file 2 block 1 apply
verify file 2 block 1