--修改file header
-------------------------------------------------------------------------
cd $ORACLE_H0ME/rdbms/lib
./bbed blockedit
set filename '/u01/app/oracle/product/10.2.0/db_1/dbs/test01.dbf'
show
map /v
p kcvfhckp
BBED> modify /x 005a
--拷贝 文件 那块 要好好测试 和认知
BBED> showv
FILE# 1
BLOCK# 1
OFFSET 0
DBA 0x00400001 (4194305 1,1)
FILENAME /u01/app/oracle/oradata/test/block.dbf
BIFILE bifile.bbd
LISTFILE list
BLOCKSIZE 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No
BBED> map /v
File: /u01/app/oracle/oradata/test/block.dbf (1)
Block: 1 Dba:0x00400001
------------------------------------------------------------
Data File Header
struct kcvfh, 676 bytes @0
struct kcvfhbfh, 20 bytes @0
struct kcvfhhdr, 76 bytes @20
ub4 kcvfhrdb @96
struct kcvfhcrs, 8 bytes @100
ub4 kcvfhcrt @108
ub4 kcvfhrlc @112
struct kcvfhrls, 8 bytes @116
ub4 kcvfhbti @124
struct kcvfhbsc, 8 bytes @128
ub2 kcvfhbth @136
ub2 kcvfhsta @138 //强制打开数据库的时候 有的资料上说这个也要修改

图片来源(oracle 实战攻略)
struct kcvfhckp, 36 bytes @484 修改的三个部分! 9i 140 处 ub4 kcvfhcpc @140
ub4 kcvfhrts @144
ub4 kcvfhccc @148
struct kcvfhbcp, 36 bytes @152
ub4 kcvfhbhz @312
struct kcvfhxcd, 16 bytes @316
word kcvfhtsn @332
ub2 kcvfhtln @336
text kcvfhtnm[30] @338
ub4 kcvfhrfn @368
struct kcvfhrfs, 8 bytes @372
ub4 kcvfhrft @380
struct kcvfhafs, 8 bytes @384
ub4 kcvfhbbc @392
ub4 kcvfhncb @396
ub4 kcvfhmcb @400
ub4 kcvfhlcb @404
ub4 kcvfhbcs @408
ub2 kcvfhofb @412
ub2 kcvfhnfb @414
ub4 kcvfhprc @416
struct kcvfhprs, 8 bytes @420
struct kcvfhprfs, 8 bytes @428
ub4 kcvfhtrt @444
ub4 tailchk @8188
BBED> p kcvfhckp
struct kcvfhckp, 36 bytes @484
struct kc
vcpscn, 8 bytes @484
ub4 kscnbas @484 0x000ddc27 --
ub2 kscnwrp @488 0x0000
ub4 kcvcptim @492 0x2d2fe78a --
ub2 kcvcpthr @496 0x0001
union u, 12 bytes @500
struct kcvcprba, 12 bytes @500
ub4 kcrbaseq @500 0x00000011
ub4 kcrbabno @504 0x00000002
ub2 kcrbabof @508 0x0010
ub1 kcvcpetb[0] @512 0x02
ub1 kcvcpetb[1] @513 0x00
ub1 kcvcpetb[2] @514 0x00
ub1 kcvcpetb[3] @515 0x00
ub1 kcvcpetb[4] @516 0x00
ub1 kcvcpetb[5] @517 0x00
ub1 kcvcpetb[6] @518 0x00
ub1 kcvcpetb[7] @519 0x00
BBED> p kcvfhcpc
ub4 kcvfhcpc @140 0x00000032 --
BBED> p kcvfhccc
ub4 kcvfhccc @148 0x00000031 --
--修改以上几个数据就可以了
BBED> set offset 484 count 16
OFFSET 484
COUNT 16
BBED> dump /v
File: /u01/app/oracle/oradata/test/block.dbf (1)
Block: 1 Offsets: 484 to 499 Dba:0x00400001
-------------------------------------------------------
27dc0d00 00005a00 8ae72f2d 01000000 l ' ...Z.. -....
<16 bytes per line>'
--一下是具体的实验步骤
--shutdown database and reopen to mount
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 1218412 bytes
Variable Size 92276884 bytes
Database Buffers 88080384 bytes
Redo Buffers 2973696 bytes
Database mounted.
--update datafile header
BBED> show
FILE# 1
BLOCK# 1
OFFSET 0
DBA 0x00400001 (4194305 1,1)
FILENAME /u01/app/oracle/oradata/test/block.dbf
BIFILE bifile.bbd
LISTFILE list
BLOCKSIZE 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No
BBED> p kcvfhckp
struct kcvfhckp, 36 bytes @484
struct kcvcpscn, 8 bytes @484
ub4 kscnbas @484 0x000df330
ub2 kscnwrp @488 0x0000
ub4 kcvcptim @492 0x2d300 |