04 bbed修复system文件头损坏

1 启动数据库,查看trace,在mount到open,

SQL> startup mount;
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size            2257352 bytes
Variable Size          511708728 bytes
Database Buffers      264241152 bytes
Redo Buffers            6791168 bytes
Database mounted.
SQL> alter session set events '10046 trace name context forever,level 8';

Session altered.

SQL> alter database open;

Database altered.

SQL> alter session set events '10046 trace name context off';

Session altered.

SQL> select value from v$diag_info where name='Default Trace File';

VALUE
------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_11247.trc

查看文件,在启动的是,先检查各个数据文件的1号块

[oracle@DSI ~]$ more /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_11247.trc
WAIT #139760412634104: nam='control file sequential read' ela= 2 file#=0 block#=23 blocks=1 obj#=-1 tim=1557884751568850
WAIT #139760412634104: nam='db file sequential read' ela= 3 file#=1 block#=1 blocks=1 obj#=-1 tim=1557884751568874 ##数据文件1的1号块
WAIT #139760412634104: nam='db file sequential read' ela= 1 file#=2 block#=1 blocks=1 obj#=-1 tim=1557884751568894
WAIT #139760412634104: nam='db file sequential read' ela= 2 file#=3 block#=1 blocks=1 obj#=-1 tim=1557884751568911
WAIT #139760412634104: nam='db file sequential read' ela= 1 file#=4 block#=1 blocks=1 obj#=-1 tim=1557884751568922
WAIT #139760412634104: nam='db file sequential read' ela= 1 file#=5 block#=1 blocks=1 obj#=-1 tim=1557884751568929

2 system数据文件1号块损坏修复

测试之前先做冷备,防止修复不成功

[oracle@DSI oradata]$ cp -rf orcl/ /home/oracle/.
BBED> info
 File#  Name                                                        Size(blks)
 -----  ----                                                        ----------
     1  /u01/app/oracle/oradata/orcl/system01.dbf                        94720
     2  /u01/app/oracle/oradata/orcl/sysaux01.dbf                        76800
     3  /u01/app/oracle/oradata/orcl/undotbs01.dbf                      144640
     4  /u01/app/oracle/oradata/orcl/users01.dbf                           640
     5  /u01/app/oracle/oradata/orcl/test01.dbf                           6400
BBED> set file 1 block 1
    FILE#              1
    BLOCK#             1
BBED> map /v
 File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
 Block: 1                                     Dba:0x00400001
------------------------------------------------------------
 Data File Header
 struct kcvfh, 860 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     
    struct kcvfhckp, 36 bytes               @484     
    ub4 kcvfhcpc                            @140     
    ub4 kcvfhrts                            @144     
    ub4 kcvfhccc                            @148     
    struct kcvfhbcp, 36 bytes               @152     
    ub4 kcvfhbhz                            @312     
    struct kcvfhxcd, 16 bytes               @316     
    sword 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> dump
 File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
 Block: 1                Offsets:    0 to  511           Dba:0x00400001
------------------------------------------------------------------------
 0ba20000 01004000 00000000 00000104 9bec0000 00000000 0004200b cf766f5b 
 4f52434c 00000000 c0170000 00770100 00200000 01000300 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 08024000 07000000 00000000 512bfa3b 4f2bfa3b 01000000 00000000 00000000 
 00000000 00000000 00000420 8c000000 b993173c 8b000000 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 00000000 06005359 5354454d 00000000 00000000 
 00000000 00000000 00000000 00000000 01000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0a000a00 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 21fd1700 00000000 3e171a3c 01000000 75000000 1e7b0000 10000000 
 <32 bytes per line>
View Code

相关文章: