10 oracle bbed恢复ora-600[4193][4194]的错误

ORA-600 [4193] 错误解析
ERROR:
    Format: ORA-600 [4193] [a] [b]
VERSIONS:
    versions 6.0 to 12.1
DESCRIPTION:
    A mismatch has been detected between Redo records and Rollback (Undo)
records.
    We are validating the Undo block sequence number in the undo block against
the Redo block sequence number relating to the change being applied.
    This error is reported when this validation fails.
ARGUMENTS:
    Arg [a] Undo record seq number
    Arg [b] Redo record seq number

ORA-600 [4193] 错误解析

人为构造ORA-600 [4193]错误(Cont…)

SQL> select HEADER_FILE,HEADER_BLOCK from dba_segments where segment_name='SYSTEM';

HEADER_FILE HEADER_BLOCK
----------- ------------
      1         128
SQL> alter system dump datafile 1 block 128;
System altered.
SQL> select VALUE from v$diag_info where name='Default Trace File';
VALUE
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_8493.trc
  Extent Control Header
  -----------------------------------------------------------------
  Extent Header:: spare1: 0      spare2: 0      #extents: 6      #blocks: 47    
                  last map  0x00000000  #maps: 0      offset: 4128  
      Highwater::  0x00400229  ext#: 5      blk#: 1      ext size: 8     
  #blocks in seg. hdr's freelists: 0     
  #blocks below: 0     
  mapblk  0x00000000  offset: 5     
                   Unlocked
     Map Header:: next  0x00000000  #extents: 6    obj#: 0      flag: 0x40000000
  Extent Map
  -----------------------------------------------------------------
   0x00400081  length: 7     
   0x00400088  length: 8     
   0x00400210  length: 8     
   0x00400218  length: 8     
   0x00400220  length: 8     
   0x00400228  length: 8     
  
  TRN CTL:: seq: 0x001d chd: 0x003e ctl: 0x0048 inc: 0x00000000 nfb: 0x0001
            mgc: 0x8002 xts: 0x0068 flg: 0x0001 opt: 2147483646 (0x7ffffffe)
            uba: 0x00400229.001d.12 scn: 0x0000.0096025c
Version: 0x01
  FREE BLOCK POOL::
    uba: 0x00400229.001d.12 ext: 0x5  spc: 0xb72   
    uba: 0x00000000.0018.34 ext: 0x0  spc: 0x942   
    uba: 0x00000000.0018.02 ext: 0x0  spc: 0x1e62  
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0     
    uba: 0x00000000.0000.00 ext: 0x0  spc: 0x0     
  TRN TBL::
 
  index  state cflags  wrap#    uel         scn            dba            parent-xid    nub     stmt_num
  ------------------------------------------------------------------------------------------------
   0x00    9    0x00  0x0019  0x004a  0x0000.00969848  0x00400227  0x0000.000.00000000  0x00000001   0x00000000
   0x01    9    0x00  0x0019  0x000a  0x0000.0096984c  0x00400227  0x0000.000.00000000  0x00000001   0x00000000

模拟的时候先关闭数据库

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

BBED> set file 1 block 128
    FILE#              1
    BLOCK#             128

BBED> map /v
 File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
 Block: 128                                   Dba:0x00400080
------------------------------------------------------------
 Unlimited Undo Segment Header
BBED> p ktuxc ##事务控制列表
struct ktuxcfbp[0], 12 bytes             @4192    
      struct ktufbuba, 8 bytes              @4192    
         ub4 kubadba                        @4192     0x00400229
         ub2 kubaseq                        @4196     0x001d
         ub1 kubarec                        @4198     0x12
      sb2 ktufbext                          @4200     5
      sb2 ktufbspc                          @4202     2930
   struct ktuxcfbp[1], 12 bytes             @4204    
      struct ktufbuba, 8 bytes              @4204    
         ub4 kubadba                        @4204     0x00000000
         ub2 kubaseq                        @4208     0x0018
         ub1 kubarec                        @4210     0x34
      sb2 ktufbext                          @4212     0
      sb2 ktufbspc                          @4214     2370
BBED> set dba 0x00400229
    DBA                0x00400229 (4194857 1,553)

BBED> map /v
 File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
 Block: 553                                   Dba:0x00400229
------------------------------------------------------------
 Undo Data

 struct kcbh, 20 bytes                      @0       
    ub1 type_kcbh                           @0       
    ub1 frmt_kcbh                           @1       
    ub1 spare1_kcbh                         @2       
    ub1 spare2_kcbh                         @3       
    ub4 rdba_kcbh                           @4       
    ub4 bas_kcbh                            @8       
    ub2 wrp_kcbh                            @12      
    ub1 seq_kcbh                            @14      
    ub1 flg_kcbh                            @15      
    ub2 chkval_kcbh                         @16      
    ub2 spare3_kcbh                         @18      

 struct ktubh, 52 bytes                     @20      
    struct ktubhxid, 8 bytes                @20      
    ub2 ktubhseq                            @28      #####
    ub1 ktubhcnt                            @30      
    ub1 ktubhirb                            @31      
    ub1 ktubhicl                            @32      
    ub1 ktubhflg                            @33      
    ub2 ktubhidx[19]                        @34      

 ub1 freespace[2932]                        @72      

 ub1 undodata[5184]                         @3004    

 ub4 tailchk                                @8188  

使用bbed修改并应用

BBED> modify /x 1e offset 28
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
 File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
 Block: 553              Offsets:   28 to  539           Dba:0x00400229
BBED> sum apply

启动数据报错

SQL> startup mount;
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size            2257352 bytes
Variable Size          478154296 bytes
Database Buffers      297795584 bytes
Redo Buffers            6791168 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00600: internal error code, arguments: [4193], [], [], [], [], [], [], [],
[], [], [], []
Process ID: 8643
Session ID: 125 Serial number: 5

alert日志

[oracle@DSI ~]$ tail -n 100 /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log
Block recovery completed at rba 31.72797.16, scn 0.10127330
Undo initialization errored: err:600 serial:0 start:107136944 end:107138904 diff:1960 (19 seconds)
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_8643.trc:
ORA-00600: internal error code, arguments: [4193], [], [], [], [], [], [], [], [], [], [], []
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_8643.trc:
ORA-00600: internal error code, arguments: [4193], [], [], [], [], [], [], [], [], [], [], []
Error 600 happened during db open, shutting down database
USER (ospid: 8643): terminating the instance due to error 600

10046

SYS@ orcl >oradebug setmypid
Statement processed.
SYS@ orcl >oradebug tracefile_name
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_8771.trc
SYS@ orcl >oradebug event 10046 trace name context forever,level 12
SYS@ orcl > alter database open;

PARSING IN CURSOR #139713678966960 len=55 dep=1 uid=0 oct=3 lid=0 tim=1561619032814165 hv=2111436465 ad='8e889e30' sqlid='6apq2rjyxmxpj'
select line#, sql_text from bootstrap$ where obj# != :1
END OF STMT
PARSE #139713678966960:c=1000,e=243,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=0,tim=1561619032814165
BINDS #139713678966960:
 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=7f11a0347c68  bln=22  avl=02  flg=05
  value=59

PARSING IN CURSOR #139713654947120 len=160 dep=1 uid=0 oct=6 lid=0 tim=1561619032979076 hv=1292341136 ad='88bcc840' sqlid='8vyjutx6hg3wh'
update /*+ rule */ undo$ set name=:2,file#=:3,block#=:4,status$=:5,user#=:6,undosqn=:7,xactsqn=:8,scnbas=:9,scnwrp=:10,inst#=:11,ts#=:12,spare1=:13 where us#=:1
END OF STMT
PARSE #139713654947120:c=2000,e=2120,p=6,cr=43,cu=0,mis=1,r=0,dep=1,og=3,plh=0,tim=1561619032979076
BINDS #139713654947120:
 Bind#0
  oacdty=01 mxl=32(20) mxlc=00 mal=00 scl=00 pre=00
  oacflg=18 fl2=0001 frm=01 csi=873 siz=32 off=0
  kxsbbbfp=88bdf03a  bln=32  avl=20  flg=09
  value="_SYSSMU1_1925302723$"

WAIT #139713654947120: nam='db file sequential read' ela= 6 file#=1 block#=553 blocks=1 obj#=0 tim=1561619032979636
Incident 55355 created, dump file: /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_55355/orcl_ora_8771_i55355.trc
ORA-00600: internal error code, arguments: [4193], [], [], [], [], [], [], [], [], [], [], []

Error 600 in redo application callback
Dump of change vector:
TYP:0 CLS:16 AFN:1 DBA:0x00400229 OBJ:4294967295 SCN:0x0000.00998c56 SEQ:1 OP:5.1 ENC:0 RBL:0
ktudb redo: siz: 288 spc: 642 flg: 0x0012 seq: 0x001d rec: 0x1d
            xid:  0x0000.040.00000019

尝试设置free block pool(如果不知道,假设free block pool没有可用的undo block!)如下方法:
1、 ktuxc.ktuxcnfb设置为 0x00
2、 kubadba设为0x00000000

BBED> set file 1 block 128
    FILE#              1
    BLOCK#             128
BBED> map /v
BBED> p ktuxc
struct ktuxc, 104 bytes                     @4148    
   struct ktuxcscn, 8 bytes                 @4148    
      ub4 kscnbas                           @4148     0x0096025e
      ub2 kscnwrp                           @4152     0x0000
   struct ktuxcuba, 8 bytes                 @4156    
      ub4 kubadba                           @4156     0x00400229
      ub2 kubaseq                           @4160     0x001d
      ub1 kubarec                           @4162     0x13
   sb2 ktuxcflg                             @4164     1 (KTUXCFSK)
   ub2 ktuxcseq                             @4166     0x001d
   sb2 ktuxcnfb                             @4168     1
   ub4 ktuxcinc                             @4172     0x00000000
   sb2 ktuxcchd                             @4176     64
   sb2 ktuxcctl                             @4178     62
   ub2 ktuxcmgc                             @4180     0x8002
   ub4 ktuxcopt                             @4188     0x7ffffffe
BBED> modify /x 00 offset 4168
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
 File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
 Block: 128              Offsets: 4168 to 4679           Dba:0x00400080
BBED> modify /x 0x00000000 offset 4192
 File: /u01/app/oracle/oradata/orcl/system01.dbf (1)
 Block: 128              Offsets: 4192 to 4703           Dba:0x00400080
BBED> sum apply

启动数据库

SQL> startup mount;
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size            2257352 bytes
Variable Size          478154296 bytes
Database Buffers      297795584 bytes
Redo Buffers            6791168 bytes
Database mounted.
SQL> alter database open; ##数据库打开
[oracle@DSI ~]$ tail -n 100 /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log
SMON: enabling cache recovery
Thu Jun 27 15:18:16 2019
ARC3 started with pid=25, OS id=8873 
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
ARC0: Becoming the 'no FAL' ARCH
ARC0: Becoming the 'no SRL' ARCH
ARC1: Becoming the heartbeat ARCH
Archived Log entry 253 added for thread 1 sequence 32 ID 0x5bac61e6 dest 1:
[8861] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:108417224 end:108417244 diff:20 (0 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is AL32UTF8
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC

ORA-600 [4194] 错误解析

ERROR:
    ORA-600 [4194] [a] [b]
VERSIONS:
    versions 6.0 to 10.1
DESCRIPTION:
    A mismatch has been detected between Redo records and rollback (Undo)
records.
    We are validating the Undo record number relating to the change being
applied against the maximum undo record number recorded in the undo block.
    This error is reported when the validation fails.
ARGUMENTS:
    Arg [a] Maximum Undo record number in Undo block
    Arg [b] Undo record number from Redo block
A mismatch has been detected between Redo records and rollback (Undo) records.
BBED> set file 1 block 128
    FILE#              1
    BLOCK#             128

BBED> p ktuxc
 struct ktuxcfbp[0], 12 bytes             @4192    
      struct ktufbuba, 8 bytes              @4192    
         ub4 kubadba                        @4192     0x0040022a
         ub2 kubaseq                        @4196     0x001d
         ub1 kubarec                        @4198     0x14
      sb2 ktufbext                          @4200     5
      sb2 ktufbspc                          @4202     2342

修改ub1 kubarec                        @4198     0x14
modify /x 24 offset 4198
sum apply
--修复ORA-600 [4194]
BBED> modify /x 00 offset 4168
BBED> modify /x 0x00000000 offset 4192
sum apply

ORA-600[4193]/[4194]错误总结
从上面测试可以得出:ORA-600[4194]/[4193],====>UNDO问题!
ORA-600[4193] :表示undo和redo不一致(Arg [a] Undo record seq number,Arg [b] Redo record seq number );
ORA-600[4194] :表示也是undo和redo不一致(Arg [a] Maximum Undo record number in Undo block,Arg [b] Undo record number from Redo block)

ORA-600[4193]/[4194]错误解决思路
方法一(推荐使用)

1.修改参数
undo_management= MANUAL
undo_tablespace= SYSTEM
2.打开数据库,删除当前undo空间,重建新undo空间
3.修改参数
undo_management= AUTO
undo_tablespace= UNDOTBSNEW
4.重新启动数据库

方法二(隐含参数)

1.利用隐含参数_offline_rollback_segments和_corrupted_rollback_segments屏蔽掉有问题的undo segment,然后打
开数据库,最后重建undo或者drop掉损坏的回滚段即可
undo_management='MANUAL'
*._offline_rollback_segments=('_SYSSMU1_2820145294$','_SYSSMU2_3242179461$','_SYSSMU3_2848625369$','_SYSSMU4_2009059248$','_SYSSMU5_2273177123$','_SYSSMU6_2776392018$','_SYSSMU7_3805255807$','_SYSSMU8_191510003$','_SYSSMU9_4104046564$','_SYSSMU10_2094815206$')
*._corrupted_rollback_segments=(_SYSSMU1$, _SYSSMU2$, _SYSSMU3$, _SYSSMU4$, _SYSSMU5$,_SYSSMU6$, _SYSSMU7$, _SYSSMU8$, _SYSSMU9$, _SYSSMU10$)

# strings system01.dbf | grep _SYSSMU | cut -d $ -f 1 | sort
启动db后,创建新的undo表空间,并切换,修改pfile,创建pfile,在正常启动,删除_corrupted_rollback_segments参数

2.继续可能出现ora-600[2662],需要推进scn
alter session set events '10015 trace name adjust_scn level 1';

方法三 BBEED
1.modify /x 00 offset 4168
2.modify /x 00000000 offset 4192

 

posted @ 2019-06-27 17:25  春困秋乏夏打盹  阅读(1005)  评论(1编辑  收藏  举报