十、用BBED工具怎么修改数据文件的kcvfhsta
一、你的场景不需要改kcvfhsta,可以正常创建controlfile,然后用online redo恢复一下就行了

SQL> alter database backup controlfile to trace;

Database altered.
SQL> oradebug setmypid
Statement processed.
SQL> oradebug tracefile_name
/oracle/app/product/rdbms/log/test_ora_807024.trc
SQL> select * from v$controlfile;

STATUS
————–
NAME
——————————————————————————–

/oracle/app/product/dbs/cntrltest.dbf
SQL> shutdown abort
ORACLE instance shut down.
SQL> host
$ rm /oracle/app/product/dbs/cntrltest.dbf
$ more /oracle/app/product/rdbms/log/test_ora_807024.trc

SQL> STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE “TEST” RESETLOGS NOARCHIVELOG
– SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 30
MAXINSTANCES 1
MAXLOGHISTORY 113
LOGFILE
GROUP 1 ‘/oracle/app/product/dbs/log1test.dbf’ SIZE 500K,
GROUP 2 ‘/oracle/app/product/dbs/log2test.dbf’ SIZE 500K
– STANDBY LOGFILE
DATAFILE
‘/oracle/app/product/dbs/dbs1test.dbf’
CHARACTER SET US7ASCII
;ORACLE instance started.

Total System Global Area 160924896 bytes
Fixed Size 742624 bytes
Variable Size 109051904 bytes
Database Buffers 50331648 bytes
Redo Buffers 798720 bytes
SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Control file created.
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 78009 generated at 05/12/2010 16:45:45 needed for thread 1
ORA-00289: suggestion : /oracle/app/product/dbs/arch1_28.dbf
ORA-00280: change 78009 for thread 1 is in sequence #28

Specify log: {=suggested | filename | AUTO | CANCEL}
/oracle/app/product/dbs/log2test.dbf
Log applied.
Media recovery complete.
SQL> alter database open resetlogs;

Database altered.

SQL>

二、用bbed改kcvfhsta的方法

BBED> set mode edit
MODE Edit

BBED> set blocksize 4096
BLOCKSIZE 4096

BBED> set filename ‘/oracle/app/product/dbs/dbs1test.dbf’
FILENAME /oracle/app/product/dbs/dbs1test.dbf

BBED> set block 1
BLOCK# 1

BBED> print kcvfhsta
ub2 kcvfhsta @138 0×0004 (KCVFHOFZ)

BBED> set offset 138
OFFSET 138

BBED> modify 0×0000
File: /oracle/app/product/dbs/dbs1test.dbf (0)
Block: 1 Offsets: 138 to 649 Dba:0×00000000
————————————————————————
00000000 e2580000 d7202ad8 597c0001 d5500000 001b0000 00070010 ffff0200
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 000000ff
ffff0000 00272ad8 59010000 00260000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000006 53595354 454d0000 00000000 00000000 00000000 00000000
00000000 00000000 00010000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 0000000a 000a0000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

<32 bytes per line>

BBED> print
kcvfh.kcvfhsta
————–
ub2 kcvfhsta @138 0×0000 (NONE)

BBED> sum apply
Check value for File 0, Block 1:
current = 0xeb25, required = 0xeb25

BBED> quit

改完的确如你设想,不需要recover database就可以open resetlogs,不过我建议用recover的方法比较好,如果连online redo也丢了,可以用隐含参数打开数据库。bbed改的方法,会不会还有其他要考虑的地方,还不完备?

Trackback

no comment untill now

Add your comment now

切换到手机版