感谢https://www.cnblogs.com/lhrbest/articles/5405849.html文档对我的指导
版本11.2.0.4 linux x64
数据库无法open。
SQL> startup;
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2253824 bytes
Variable Size 167775232 bytes
Database Buffers 243269632 bytes
Redo Buffers 4247552 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-00702: bootstrap verison '' inconsistent with version '8.0.0.0.0'
Process ID: 2479
Session ID: 1 Serial number: 5
后台alert日志报错:
SMON: enabling cache recovery
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2479.trc:
ORA-00704: bootstrap process failure
ORA-00702: bootstrap verison '' inconsistent with version '8.0.0.0.0'
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2479.trc:
ORA-00704: bootstrap process failure
ORA-00702: bootstrap verison '' inconsistent with version '8.0.0.0.0'
Error 704 happened during db open, shutting down database
USER (ospid: 2479): terminating the instance due to error 704
Mon Jul 08 11:16:09 2019
ARC1 started with pid=21, OS id=2483
Instance terminated by USER, pid = 2479
ORA-1092 signalled during: ALTER DATABASE OPEN MIGRATE...
opiodr aborting process unknown ospid (2479) as a result of ORA-1092
10046查看
SQL> oradebug setmypid --跟踪当前会话
SQL> oradebug EVENT 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12 --10046等级=12
SQL> alter session set db_file_multiblocK_read_count=1; --一次最多读1个块
SQL> oradebug TRACEFILE_NAME --显示trace文件的名字
SQL> alter database Open;
SQL> oradebug EVENT 10046 trace name context off --关闭10046,防止爆涨
WAIT #139636233907032: nam='instance state change' ela= 210 layer=2 value=1 waited=1 obj#=-1 tim=1562555463240603
WAIT #139636233907032: nam='db file sequential read' ela= 10 file#=1 block#=520 blocks=1 obj#=-1 tim=1562555463240886
=====================
PARSING IN CURSOR #139636233898808 len=188 dep=1 uid=0 oct=1 lid=0 tim=1562555463241390 hv=4006182593 ad='788cea18' sqlid='32r4f1brckzq1'
create table bootstrap$ (
END OF STMT
PARSE #139636233898808:c=0,e=421,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=0,tim=1562555463241389
EXEC #139636233898808:c=0,e=123,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,plh=0,tim=1562555463241545
CLOSE #139636233898808:c=0,e=2,dep=1,type=0,tim=1562555463241583
=====================
PARSING IN CURSOR #139636233898808 len=55 dep=1 uid=0 oct=3 lid=0 tim=1562555463242066 hv=2111436465 ad='788cd0b8' sqlid='6apq2rjyxmxpj'
select line#, sql_text from bootstrap$ where obj# != :1
END OF STMT
PARSE #139636233898808:c=1000,e=475,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=0,tim=1562555463242065
BINDS #139636233898808:
Bind#0
oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0
kxsbbbfp=7eff981e86f0 bln=22 avl=02 flg=05
value=59
EXEC #139636233898808:c=2000,e=3393,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=867914364,tim=1562555463245514
WAIT #139636233898808: nam='db file sequential read' ela= 11 file#=1 block#=520 blocks=1 obj#=59 tim=1562555463245580
WAIT #139636233898808: nam='db file sequential read' ela= 6 file#=1 block#=521 blocks=1 obj#=59 tim=1562555463245672
WAIT #139636233898808: nam='db file sequential read' ela= 5 file#=1 block#=522 blocks=1 obj#=59 tim=1562555463245710
WAIT #139636233898808: nam='db file sequential read' ela= 4 file#=1 block#=523 blocks=1 obj#=59 tim=1562555463245749
FETCH #139636233898808:c=0,e=214,p=4,cr=5,cu=0,mis=0,r=0,dep=1,og=4,plh=867914364,tim=1562555463245761
STAT #139636233898808 id=1 cnt=0 pid=0 pos=1 obj=59 op='TABLE ACCESS FULL BOOTSTRAP$ (cr=5 pr=4 pw=0 time=215 us)'
*** 2019-07-08 11:11:03.247
Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x0] [PC:0x977B2D8, lmebucp()+24] [flags: 0x0, count: 1]
Incident 21753 created, dump file: /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_21753/orcl_ora_2398_i21753.trc
ORA-07445: exception encountered: core dump [lmebucp()+24] [SIGSEGV] [ADDR:0x0] [PC:0x977B2D8] [Address not mapped to object] []
解决方案:
bootstrap$在相同平台下是一样的,所以找到一个同平台,同版本的system01.dbf,用bbed正常的块替换掉损坏的块就可以了。
1. BBED安装:
在11g中没有,需要在对应的平台上的10g版本上获取
$ORACLE_HOME/rdbms/lib/ssbbded.o
$ORACLE_HOME/rdbms/lib/sbbdpt.o
$ORACLE_HOME/rdbms/mesg/bbedus.msb
$ORACLE_HOME/rdbms/mesg/bbedus.msg
在10g上的如上路径中将文件cp出来,放在11g的对应的路径下
进行安装:
make -f $ORACLE_HOME/rdbms/lib/ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed
该语句是另外指定一个目录生成bbed文件
11g下sys.bootstrap$对象所占用的块变成了520、521、522、523这4个块,10g下为377、378、379、380这4个块
找到正常的数据库
dd if=/xxxx/o1_mf_system_f347jch4_.dbf of=/tmp/bst.dmp bs=10M count=1
注释:11g位于520-523,所以只需要523*8K大小即可,此处取10MB。
[oracle@dongsc bbed_dir]$ cat sys_list.txt
1 /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_f347jch4_.dbf
5 /tmp/bst.dmp
bbed PASSWORD=blockedit mode=edit blocksize=8192 listfile=/home/oracle/bbed_dir/sys_list.txt
BBED> info --查看是否正确指引到数据文件。
BBED> set count 128
BBED> copy file 5 block 520 to file 1 block 520
BBED> copy file 5 block 521 to file 1 block 521
BBED> copy file 5 block 522 to file 1 block 522
BBED> copy file 5 block 523 to file 1 block 523
BBED> sum apply
如下是详细输出
[oracle@dongsc bbed_dir]$ bbed PASSWORD=blockedit mode=edit blocksize=8192 listfile=/home/oracle/bbed_dir/sys_list.txt
BBED: Release 2.0.0.0.0 - Limited Production on Mon Jul 8 12:11:01 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> info
File# Name Size(blks)
----- ---- ----------
1 /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_f347jch 0
5 /tmp/bst.dmp 0
BBED> set count 128
COUNT 128
BBED> copy file 5 block 520 to file 1 block 520
File: /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_f347jch4_.dbf (1)
Block: 520 Offsets: 0 to 127 Dba:0x00400208
------------------------------------------------------------------------
10a20000 08024000 d0010000 00000204 43e40000 00000000 00000000 00000000
00000000 01000000 07000000 20100000 00000000 03000000 07000000 0c024000
00000000 00000000 01000000 03000000 00000000 00000000 00000000 01000000
00000000 3b000000 00000040 09024000 07000000 00000000 00000000 00000000
<32 bytes per line>
BBED> copy file 5 block 521 to file 1 block 521
File: /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_f347jch4_.dbf (1)
Block: 521 Offsets: 0 to 127 Dba:0x00400209
------------------------------------------------------------------------
06a20000 09024000 d7010000 00000106 fa520000 01000000 3b000000 73010000
00000000 01f80200 00000000 00002500 02000000 11024000 02004c00 18200000
d7010000 00011800 ffff4200 c6048404 84040000 1800a31f 1a1f951d cd1c4e1b
7a1aad19 49177b16 b315d614 0a14ef12 05120e11 380f680e 910d790c 69099c08
<32 bytes per line>
BBED> copy file 5 block 522 to file 1 block 522
File: /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_f347jch4_.dbf (1)
Block: 522 Offsets: 0 to 127 Dba:0x0040020a
------------------------------------------------------------------------
06a20000 0a024000 d7010000 00000106 e81e0000 01000000 3b000000 bb010000
00000000 01f80200 00000000 00002500 02000000 20024000 04000700 15200000
d7010000 00011500 ffff3c00 b2057605 76050000 1500521d 811cb71b e31a8a18
07172216 ce120312 f9102010 410f750e 590dad0c 800bb30a dc096507 9606b205
<32 bytes per line>
BBED> copy file 5 block 523 to file 1 block 523
File: /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_f347jch4_.dbf (1)
Block: 523 Offsets: 0 to 127 Dba:0x0040020b
------------------------------------------------------------------------
06a20000 0b024000 d7010000 00000106 7b7e0000 01000000 3b000000 d0010000
00000000 01000300 00000000 00002500 02000000 27024000 04002f00 0f200000
d7010000 00010f00 ffff3000 f50dc50d c50d0000 0f00301d 561c481b 821aab19
9c18c117 f816b113 ea122011 5110890f c00ef50d 00000000 00000000 00000000
<32 bytes per line>
BBED>
BBED>
BBED> sum apply
Check value for File 1, Block 523:
current = 0x7e7b, required = 0x7e7b
BBED>
BBED>
BBED>
BBED> exit
然后就可以正常起库。
11g下sys.bootstrap$对象所占用的块变成了520、521、522、523这4个块,10g下为377、378、379、380这4个块