[20190531]ORA-600 kokasgi1故障模拟与恢复.txt

--//昨天看链接:http://www.xifenfei.com/2019/05/ora-600-kokasgi1-recovery.html,google半天看到的还是惜分飞网站的链接.
--//既然他提到sys和system被人重命名,解决相对容易,通过测试说明问题.千万不要在生产系统做这样的测试.
--//再次提醒大家,下载oracle介质要选择官方网站并且要做md5sum,不对坚决不要使用!!一些工具下载也要注意检查里面的一些登录执行的sql脚本.
--//另外千万注意不要使用别人的电脑登录生产系统.以免口令外泄.
--//参考链接:http://blog.itpub.net/267265/viewspace-1085037/=>[20140221]login.sql与系统安全.txt
--//另外专业的修复不要找我,我不靠这个赚钱^_^.

1.环境:
[email protected]> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.模拟:
[email protected]> select rowid ,name from user$ where name like ‘SYS%‘;
ROWID              NAME
------------------ ----------------------------------------
AAAAAKAABAAAADRAAB SYS
AAAAAKAABAAAADUAAL SYSMAN
AAAAAKAABAAAADRAAG SYSTEM

[email protected]> @ rowid AAAAAKAABAAAADRAAB
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
        10          1        209          1   0x4000D1           1,209                alter system dump datafile 1 block 209 ;

[email protected]> @ rowid AAAAAKAABAAAADRAAG
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
        10          1        209          6   0x4000D1           1,209                alter system dump datafile 1 block 209 ;

[email protected]> update user$ set name=name||‘DW‘ where name in( ‘SYS‘,‘SYSTEM‘);
2 rows updated.

[email protected]> commit ;
Commit complete.

[email protected]> select rowid ,name from user$ where name like ‘SYS%‘;
ROWID              NAME
------------------ ----------------------------------------
AAAAAKAABAAAADRAAB SYSDW
AAAAAKAABAAAADUAAL SYSMAN
AAAAAKAABAAAADRAAG SYSTEMDW

[email protected]> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.

[email protected]> startup
ORACLE instance started.
Total System Global Area  643084288 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers                7487488 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Process ID: 55795
Session ID: 295 Serial number: 3

--//alert.log记录如下:
Errors in file /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_55795.trc  (incident=2920815):
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
Incident details in: /u01/app/oracle/diag/rdbms/book/book/incident/incdir_2920815/book_ora_55795_i2920815.trc
Incremental checkpoint up to RBA [0x49dc.94c1.0], current log tail at RBA [0x49dc.94ff.0]
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Errors in file /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_55795.trc:
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
Errors in file /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_55795.trc:
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
Error 600 happened during db open, shutting down database
USER (ospid: 55795): terminating the instance due to error 600
Instance terminated by USER, pid = 55795
ORA-1092 signalled during: ALTER DATABASE OPEN...
opiodr aborting process unknown ospid (55795) as a result of ORA-1092
Fri May 31 09:41:55 2019
ORA-1092 : opitsk aborting process

3.分析:
[email protected]> @ 10046on 12
old   1: alter session set events ‘10046 trace name context forever, level &1‘
new   1: alter session set events ‘10046 trace name context forever, level 12‘
Session altered.

[email protected]> alter database open ;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
Process ID: 55895
Session ID: 295 Serial number: 3

[email protected]> @ 10046off
ERROR:
ORA-03114: not connected to ORACLE

--//检查跟踪文件发现:
=====================
PARSING IN CURSOR #140302340540856 len=189 dep=1 uid=0 oct=3 lid=0 tim=1559267635846185 hv=186852205 ad=‘7d1df0b8‘ sqlid=‘2tkw12w5k68vd‘
select user#,password,datats#,tempts#,type#,defrole,resource$, ptime,decode(defschclass,NULL,‘DEFAULT_CONSUMER_GROUP‘,defschclass),spare1,spare4,ext_username,spare2 from user$ where name=:1
END OF STMT
PARSE #140302340540856:c=0,e=269,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=0,tim=1559267635846184
BINDS #140302340540856:
 Bind#0
  oacdty=01 mxl=32(03) mxlc=00 mal=00 scl=00 pre=00
  oacflg=18 fl2=0001 frm=01 csi=852 siz=32 off=0
  kxsbbbfp=7f9aaf2b4568  bln=32  avl=03  flg=05
  value="SYS"
EXEC #140302340540856:c=1000,e=472,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=1457651150,tim=1559267635846719
FETCH #140302340540856:c=0,e=9,p=0,cr=1,cu=0,mis=0,r=0,dep=1,og=4,plh=1457651150,tim=1559267635846747
STAT #140302340540856 id=1 cnt=0 pid=0 pos=1 obj=22 op=‘TABLE ACCESS BY INDEX ROWID USER$ (cr=1 pr=0 pw=0 time=9 us)‘
STAT #140302340540856 id=2 cnt=0 pid=1 pos=1 obj=46 op=‘INDEX UNIQUE SCAN I_USER1 (cr=1 pr=0 pw=0 time=8 us)‘
CLOSE #140302340540856:c=0,e=4,dep=1,type=0,tim=1559267635846793
Incident 2922415 created, dump file: /u01/app/oracle/diag/rdbms/book/book/incident/incdir_2922415/book_ora_55895_i2922415.trc
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []

ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [kokasgi1], [], [], [], [], [], [], [], [], [], [], []

*** 2019-05-31 09:53:56.717
USER (ospid: 55895): terminating the instance due to error 600
--//往前看可以发现如下:
=====================
PARSING IN CURSOR #140302340501536 len=189 dep=2 uid=0 oct=3 lid=0 tim=1559267635703833 hv=186852205 ad=‘7d1df0b8‘ sqlid=‘2tkw12w5k68vd‘
select user#,password,datats#,tempts#,type#,defrole,resource$, ptime,decode(defschclass,NULL,‘DEFAULT_CONSUMER_GROUP‘,defschclass),spare1,spare4,ext_username,spare2 from user$ where name=:1
END OF STMT
PARSE #140302340501536:c=0,e=633,p=0,cr=0,cu=0,mis=1,r=0,dep=2,og=4,plh=0,tim=1559267635703831
BINDS #140302340501536:
 Bind#0
  oacdty=01 mxl=32(05) mxlc=00 mal=00 scl=00 pre=00
  oacflg=18 fl2=0001 frm=01 csi=852 siz=32 off=0
  kxsbbbfp=7f9aaf2aabd0  bln=32  avl=05  flg=05
  value="SYSDW"
EXEC #140302340501536:c=999,e=1015,p=0,cr=0,cu=0,mis=1,r=0,dep=2,og=4,plh=1457651150,tim=1559267635704985
WAIT #140302340501536: nam=‘db file sequential read‘ ela= 11 file#=1 block#=417 blocks=1 obj#=46 tim=1559267635705054
FETCH #140302340501536:c=0,e=83,p=1,cr=2,cu=0,mis=0,r=1,dep=2,og=4,plh=1457651150,tim=1559267635705108
STAT #140302340501536 id=1 cnt=1 pid=0 pos=1 obj=22 op=‘TABLE ACCESS BY INDEX ROWID USER$ (cr=2 pr=1 pw=0 time=76 us)‘
STAT #140302340501536 id=2 cnt=1 pid=1 pos=1 obj=46 op=‘INDEX UNIQUE SCAN I_USER1 (cr=1 pr=1 pw=0 time=67 us)‘
CLOSE #140302340501536:c=0,e=7,dep=2,type=0,tim=1559267635705213
=====================
--//dba = 1,417 是索引I_USER1.也就是修复要禁用这个索引.

4.bbed观察:
BBED> set dba 1,417
        DBA             0x004001a1 (4194721 1,417)

BBED> find /c SYSDW TOP
 File: /mnt/ramdisk/book/system01.dbf (1)
 Block: 417                                                  Offsets: 5864 to 5927                                               Dba:0x004001a1
------------------------------------------------------------------------------------------------------------------------------------------------
 53595344 57000200 4000d100 06085359 5354454d 44570000 004000d2 00100448 49533500 00004000 d2000f0b 4a415641 5f444550 4c4f5900 00004000 d500010a
<64 bytes per line>

BBED> x /rc *kd_off[87]
rowdata[4]                                  @5855
----------
[email protected]:     0x00 (NONE)
[email protected]:     0x02
keydata[6]:    0x00  0x40  0x00  0xd1  0x00  0x01
data key:
col    0[5] @5864: SYSDW

--//rowid = 0x00  0x40  0x00  0xd1  0x00  0x01 ,dba 0x004000d1=4194513
--//4194513= alter system dump datafile 1 block 209

BBED> set dba 1,209
        DBA             0x004000d1 (4194513 1,209)

BBED> p kdbt
struct kdbt[0], 4 bytes                     @106
   sb2 kdbtoffs                             @106      0
   sb2 kdbtnrow                             @108      21
struct kdbt[1], 4 bytes                     @110
   sb2 kdbtoffs                             @110      21
   sb2 kdbtnrow                             @112      22
--//SYS.user$是CLUSTER TABLE中的一个表.

BBED> x /rcncnnttttncnnnnnccnnncct *kdbr[22]
rowdata[173]                                @3074
------------
[email protected]: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
[email protected]: 0x02
[email protected]:   22
[email protected]:    1
col    0[5] @3078: SYSDW
col    1[2] @3084: 1
col   2[16] @3087: 8A8F025737A9097A
col    3[1] @3104: 0
col    4[2] @3106: 3
col    5[7] @3109: 2013-08-24 11:37:40
col    6[7] @3117: 2017-02-15 08:35:57
col    7[7] @3125: 2013-08-24 12:07:04
col    8[7] @3133: 2013-08-24 12:07:04
col    9[1] @3141: 0
col   10[0] @3143: *NULL*
col   11[2] @3144: 1
col   12[0] @3147: *NULL*
col   13[0] @3148: *NULL*
col   14[1] @3149: 0
col   15[1] @3151: 0
col  16[22] @3153: DEFAULT_CONSUMER_GROUP
col   17[0] @3176: *NULL*
col   18[1] @3177: 0
col   19[0] @3179: *NULL*
col   20[0] @3180: *NULL*
col  21[62] @3181: S:757313FFE2E6EF9A6335E271A6AC31A5183587AB5A50C8C99611A375F95E

BBED> x /rcncnnttttncnnnnnccnnncct *kdbr[27]
rowdata[0]                                  @2901
----------
[email protected]: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
[email protected]: 0x02
[email protected]:   22
[email protected]:    5

col    0[8] @2905: SYSTEMDW
col    1[2] @2914: 1
col   2[16] @2917: 2D594E86F93B17A1
col    3[1] @2934: 0
col    4[2] @2936: 3
col    5[7] @2939: 2013-08-24 11:37:40
col    6[7] @2947: 2019-02-28 09:14:04
col    7[7] @2955: 2016-08-24 11:45:42
col    8[7] @2963: 2013-08-24 12:07:04
col    9[1] @2971: 0
col   10[0] @2973: *NULL*
col   11[2] @2974: 1
col   12[0] @2977: *NULL*
col   13[0] @2978: *NULL*
col   14[1] @2979: 0
col   15[1] @2981: 0
col  16[22] @2983: DEFAULT_CONSUMER_GROUP
col   17[0] @3006: *NULL*
col   18[1] @3007: 0
col   19[0] @3009: *NULL*
col   20[0] @3010: *NULL*
col  21[62] @3011: S:71B503269929F92E4BC275D2B9EBAB760C5C6D3A6BC4BD408F5EB6A0CF63

--//找到原来的位置.
BBED> set offset 7000
        OFFSET          7000

BBED> find /c SYS curr
 File: /mnt/ramdisk/book/system01.dbf (1)
 Block: 209                                                  Offsets: 7413 to 7476                                               Dba:0x004000d1
------------------------------------------------------------------------------------------------------------------------------------------------
 53595354 454d02c1 02104434 44463739 33314142 31333045 33370180 02c10407 78710818 0c262907 78710818 0c2629ff ff0180ff 02c102ff ff018001 80164445
 <64 bytes per line>

BBED> dump /v
 File: /mnt/ramdisk/book/system01.dbf (1)
 Block: 209                               Offsets: 7413 to 7476                            Dba:0x004000d1
-----------------------------------------------------------------------------------------------------------
 53595354 454d02c1 02104434 44463739 33314142 31333045 33370180 02c10407 l SYSTEM....D4DF7931AB130E37......
 78710818 0c262907 78710818 0c2629ff ff0180ff 02c102ff ff018001 80164445 l xq...&).xq...&)...............DE
 <32 bytes per line>
--//7413-5 = 7408
BBED> set offset +6
        OFFSET          7419

BBED> find /c SYS
 File: /mnt/ramdisk/book/system01.dbf (1)
 Block: 209                                                  Offsets: 7948 to 8011                                               Dba:0x004000d1
------------------------------------------------------------------------------------------------------------------------------------------------
 53595302 c1021044 34433530 31363038 36423244 43364101 8002c104 07787108 180c2629 07787108 180c2629 ffff0180 ff02c102 ffff0180 01801644 45464155

<64 bytes per line>

BBED> dump /v
 File: /mnt/ramdisk/book/system01.dbf (1)
 Block: 209                               Offsets: 7948 to 8011                            Dba:0x004000d1
-----------------------------------------------------------------------------------------------------------
 53595302 c1021044 34433530 31363038 36423244 43364101 8002c104 07787108 l SYS....D4C5016086B2DC6A......xq.
 180c2629 07787108 180c2629 ffff0180 ff02c102 ffff0180 01801644 45464155 l ..&).xq...&)...............DEFAU
 <32 bytes per line>
--//7948-5  = 7943

BBED> x /rcncnnttttncnnnnnccnnncct offset 7408
rowdata[4507]                               @7408
-------------
[email protected]: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
[email protected]: 0x02
[email protected]:   22
[email protected]:    5
col    0[6] @7412: SYSTEM
col    1[2] @7419: 1
col   2[16] @7422: D4DF7931AB130E37
col    3[1] @7439: 0
col    4[2] @7441: 3
col    5[7] @7444: 2013-08-24 11:37:40
col    6[7] @7452: 2013-08-24 11:37:40
col    7[0] @7460: *NULL*
col    8[0] @7461: *NULL*
col    9[1] @7462: 0
col   10[0] @7464: *NULL*
col   11[2] @7465: 1
col   12[0] @7468: *NULL*
col   13[0] @7469: *NULL*
col   14[1] @7470: 0
col   15[1] @7472: 0
col  16[22] @7474: DEFAULT_CONSUMER_GROUP
col   17[0] @7497: *NULL*
col   18[1] @7498: 0
col   19[0] @7500: *NULL*
col   20[0] @7501: *NULL*
col  21[62] @7502: S:5E9BBAFD8CE1E16065CAF66B09741B79CC45E9EBAAB3F99F34BF5FCE5445

BBED> x /rcncnnttttncnnnnnccnnncct offset 7943
rowdata[5042]                               @7943
-------------
[email protected]: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
[email protected]: 0x02
[email protected]:   22
[email protected]:    1

col    0[3] @7947: SYS
col    1[2] @7951: 1
col   2[16] @7954: D4C5016086B2DC6A
col    3[1] @7971: 0
col    4[2] @7973: 3
col    5[7] @7976: 2013-08-24 11:37:40
col    6[7] @7984: 2013-08-24 11:37:40
col    7[0] @7992: *NULL*
col    8[0] @7993: *NULL*
col    9[1] @7994: 0
col   10[0] @7996: *NULL*
col   11[2] @7997: 1
col   12[0] @8000: *NULL*
col   13[0] @8001: *NULL*
col   14[1] @8002: 0
col   15[1] @8004: 0
col  16[22] @8006: DEFAULT_CONSUMER_GROUP
col   17[0] @8029: *NULL*
col   18[1] @8030: 0
col   19[0] @8032: *NULL*
col   20[0] @8033: *NULL*
col  21[62] @8034: S:52F9294AFEF93815CFC0D8F13BA88B935944095E6CD1101ECE75290A383E

--//可以发现2条记录的偏移在7408,7943.kdbr记录的是相对偏移从kdbh位置开始,要减去92.
BBED> p kdbh
struct kdbh, 14 bytes                       @92
   ub1 kdbhflag                             @92       0x00 (NONE)
   sb1 kdbhntab                             @93       2
   sb2 kdbhnrow                             @94       43
   sb2 kdbhfrre                             @96      -1
   sb2 kdbhfsbo                             @98       108
   sb2 kdbhfseo                             @100      2809
   sb2 kdbhavsp                             @102      5516
   sb2 kdbhtosp                             @104      5516

--//7408 - 92 = 7316 , name=‘SYSTEM‘的记录偏移
--//7943 - 92 = 7851 , name=‘SYS‘的记录偏移

BBED> assign kdbr[22]=7851
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
sb2 kdbr[0]                                 @158      7851

BBED> assign kdbr[27]=7316
sb2 kdbr[0]                                 @168      7316

BBED> x /rcncnnttttncnnnnnccnnncct *kdbr[27]
rowdata[4507]                               @7408
-------------
[email protected]: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
[email protected]: 0x02
[email protected]:   22
[email protected]:    5

col    0[6] @7412: SYSTEM
col    1[2] @7419: 1
col   2[16] @7422: D4DF7931AB130E37
col    3[1] @7439: 0
col    4[2] @7441: 3
col    5[7] @7444: 2013-08-24 11:37:40
col    6[7] @7452: 2013-08-24 11:37:40
col    7[0] @7460: *NULL*
col    8[0] @7461: *NULL*
col    9[1] @7462: 0
col   10[0] @7464: *NULL*
col   11[2] @7465: 1
col   12[0] @7468: *NULL*
col   13[0] @7469: *NULL*
col   14[1] @7470: 0
col   15[1] @7472: 0
col  16[22] @7474: DEFAULT_CONSUMER_GROUP
col   17[0] @7497: *NULL*
col   18[1] @7498: 0
col   19[0] @7500: *NULL*
col   20[0] @7501: *NULL*
col  21[62] @7502: S:5E9BBAFD8CE1E16065CAF66B09741B79CC45E9EBAAB3F99F34BF5FCE5445

BBED> x /rcncnnttttncnnnnnccnnncct *kdbr[22]
rowdata[5042]                               @7943
-------------
[email protected]: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
[email protected]: 0x02
[email protected]:   22
[email protected]:    1

col    0[3] @7947: SYS
col    1[2] @7951: 1
col   2[16] @7954: D4C5016086B2DC6A
col    3[1] @7971: 0
col    4[2] @7973: 3
col    5[7] @7976: 2013-08-24 11:37:40
col    6[7] @7984: 2013-08-24 11:37:40
col    7[0] @7992: *NULL*
col    8[0] @7993: *NULL*
col    9[1] @7994: 0
col   10[0] @7996: *NULL*
col   11[2] @7997: 1
col   12[0] @8000: *NULL*
col   13[0] @8001: *NULL*
col   14[1] @8002: 0
col   15[1] @8004: 0
col  16[22] @8006: DEFAULT_CONSUMER_GROUP
col   17[0] @8029: *NULL*
col   18[1] @8030: 0
col   19[0] @8032: *NULL*
col   20[0] @8033: *NULL*
col  21[62] @8034: S:52F9294AFEF93815CFC0D8F13BA88B935944095E6CD1101ECE75290A383E

--OK,修改正确!!

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

--//必须禁用索引,从别的机器获得如下信息.注意版本一定要一致.
[email protected]> select rowid x,a.* from bootstrap$ a where sql_text like ‘%I_USER%‘;
X                                     LINE#         OBJ# SQL_TEXT
------------------------------ ------------ ------------ ------------------------------------------------------------
AAAAA7AABAAAAIKAAM                       11           11 CREATE INDEX I_USER# ON CLUSTER C_USER# PCTFREE 10 INITRANS
                                                         2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS
                                                         1 MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 11 EXTENTS (FILE
                                                          1 BLOCK 216))

AAAAA7AABAAAAIKAAT                       46           46 CREATE UNIQUE INDEX I_USER1 ON USER$(NAME) PCTFREE 10 INITRA
                                                         NS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTEN
                                                         TS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 46 EXTENTS (F
                                                         ILE 1 BLOCK 416))

AAAAA7AABAAAAIKAAU                       47           47 CREATE UNIQUE INDEX I_USER2 ON USER$(USER#,TYPE#,SPARE1,SPAR
                                                         E2) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64
                                                         K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
                                                         0 OBJNO 47 EXTENTS (FILE 1 BLOCK 424))

[email protected]> @ rowid AAAAA7AABAAAAIKAAT
      OBJECT         FILE        BLOCK          ROW ROWID_DBA            DBA                  TEXT
------------ ------------ ------------ ------------ -------------------- -------------------- ----------------------------------------
          59            1          522           19   0x40020A           1,522                alter system dump datafile 1 block 522 ;
--//继续修改:

BBED> set dba 1,522
        DBA             0x0040020a (4194826 1,522)

BBED> x /rnnc *kdbr[19]
rowdata[228]                                @1754
------------
[email protected]: 0x2c (KDRHFL, KDRHFF, KDRHFH)
[email protected]: 0x01
[email protected]:    3

col    0[2] @1757: 46
col    1[2] @1760: 46
col  2[197] @1763: CREATE UNIQUE INDEX I_USER1 ON USER$(NAME) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS
 2147483645 PCTINCREASE 0 OBJNO 46 EXTENTS (FILE 1 BLOCK 416))

--//修改标识flag=0x3c 表示删除.

BBED> assign offset 1754=0x3c;
ub1 rowdata[0]                              @1754     0x3c

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

4.测试:
[email protected]> startup
ORACLE instance started.
Total System Global Area  643084288 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers                7487488 bytes
Database mounted.
Database opened.

[email protected]> connect system/oracle
ERROR:
ORA-00604: error occurred at recursive SQL level 1
ORA-00607: Internal error occurred while making a change to a data block
ORA-00600: internal error code, arguments: [kdBlkCheckError], [1], [209], [6110], [], [], [], [], [], [], [], []
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
--//必须修复该块.正好前一阵子做tab$删除恢复时,别人提醒参数_db_always_check_system_ts=false,可以跳过检查.测试看看,

[email protected]> alter system set "_db_always_check_system_ts"=false ;
System altered.

[email protected]> startup mount
ORACLE instance started.
Total System Global Area  643084288 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers                7487488 bytes
Database mounted.

[email protected]> alter database open ;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00604: error occurred at recursive SQL level 2
ORA-01578: ORACLE data block corrupted (file # 1, block # 209)
ORA-01110: data file 1: ‘/mnt/ramdisk/book/system01.dbf‘
Process ID: 56447
Session ID: 295 Serial number: 3
--//昏,已经标志坏块.

BBED> set dba 1,209
        DBA             0x004000d1 (4194513 1,209)

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/system01.dbf
BLOCK = 209

Block Checking: DBA = 4194513, Block Type = KTB-managed data block
Found block already marked corrupted

BBED> p  kcbh.seq_kcbh
ub1 seq_kcbh                                @14       0xff

BBED> assign kcbh.seq_kcbh = 0x01

BBED> p tailchk
ub4 tailchk                                 @8188     0x000006ff

BBED> assign tailchk=0x00000601
ub4 tailchk                                 @8188     0x00000601

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

BBED> verify
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/system01.dbf
BLOCK = 209

Block Checking: DBA = 4194513, Block Type = KTB-managed data block
data header at 0x1414e5c
kdbchk: the amount of space used is not equal to block size
        used=2548 fsc=0 avsp=5516 dtl=8096
Block 209 failed with check code 6110

--//继续看看参数_db_always_check_system_ts=false是否有效.
[email protected]> connect system/oracle
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.

[email protected]> connect system/manager
Connected.
--//昏,修复有问题,指向最早的位置,不过应该不影响使用.

[email protected]> @ bbvi 1 209
BVI_COMMAND
----------------------------------------------------------------------------------------------------
bvi -b 1712128 -s 8192 /mnt/ramdisk/book/system01.dbf
xxd -c16 -g 2 -s 1712128 -l 8192 /mnt/ramdisk/book/system01.dbf
dd if=/mnt/ramdisk/book/system01.dbf bs=8192 skip=209 count=1 of=1_209.dd conv=notrunc 2>/dev/null
od -j 1712128 -N 8192 -t x1 -v /mnt/ramdisk/book/system01.dbf
hexdump -s 1712128 -n 8192 -C -v /mnt/ramdisk/book/system01.dbf
alter system dump datafile ‘/mnt/ramdisk/book/system01.dbf‘ block 209;
alter session set events ‘immediate trace name set_tsn_p1 level 1‘;
alter session set events ‘immediate trace name buffer level 4194513‘;
9 rows selected.

$ dd if=/mnt/ramdisk/book/system01.dbf bs=8192 skip=209 count=1 of=1_209.dd conv=notrunc 2>/dev/null

$ strings -td -3 1_209.dd  | grep SYS
   2276 SYSTEM
   2433 SYSTEM
   2591 SYSTEM
   2748 SYSTEM
   2906 SYSTEMDW
   3079 SYSDW
   3249 SYSTEM
   3420 SYSTEM
   3592 SYSTEM
   3763 SYSTEM
   3935 SYSTEM
   4106 SYSTEM
   4278 SYSTEM
   4449 SYSTEM
   4621 SYSTEM
   4792 SYSTEM
   4964 SYSTEM
   5135 SYS
   5303 SYSTEM
   5475 SYS
   5644 GATHER_SYSTEM_STATISTICS
   7413 SYSTEM
   7948 SYS

BBED> x /rcncnnttttncnnnnnccnnncct offset 5298
rowdata[3027]                               @5298
-------------
[email protected]: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
[email protected]: 0x02
[email protected]:   22
[email protected]:    5

col    0[6] @5302: SYSTEM
col    1[2] @5309: 1
col   2[16] @5312: 2D594E86F93B17A1
col    3[1] @5329: 0
col    4[2] @5331: 3
col    5[7] @5334: 2013-08-24 11:37:40
col    6[7] @5342: 2015-11-24 09:13:26
col    7[7] @5350: 2013-08-24 12:07:04
col    8[7] @5358: 2013-08-24 12:07:04
col    9[1] @5366: 0
col   10[0] @5368: *NULL*
col   11[2] @5369: 1
col   12[0] @5372: *NULL*
col   13[0] @5373: *NULL*
col   14[2] @5374: 9
~~~~~~~~~~~~~~~~~~~~
col   15[1] @5377: 0
col  16[22] @5379: DEFAULT_CONSUMER_GROUP
col   17[0] @5402: *NULL*
col   18[1] @5403: 0
col   19[0] @5405: *NULL*
col   20[0] @5406: *NULL*
col  21[62] @5407: S:574F64CF334589628C7754569B8C88C0A2000C907997A2E079AD97B2B0E3

BBED> x /rcncnnttttncnnnnnccnnncct offset 4959
rowdata[2688]                               @4959
-------------
[email protected]: 0x6c (KDRHFL, KDRHFF, KDRHFH, KDRHFC)
[email protected]: 0x00
[email protected]:   22
[email protected]:    5

col    0[6] @4963: SYSTEM
col    1[2] @4970: 1
col   2[16] @4973: 2D594E86F93B17A1
col    3[1] @4990: 0
col    4[2] @4992: 3
col    5[7] @4995: 2013-08-24 11:37:40
col    6[7] @5003: 2015-11-24 09:13:26
col    7[7] @5011: 2013-08-24 12:07:04
col    8[7] @5019: 2013-08-24 12:07:04
col    9[1] @5027: 0
col   10[0] @5029: *NULL*
col   11[2] @5030: 1
col   12[0] @5033: *NULL*
col   13[0] @5034: *NULL*
col   14[1] @5035: 0
~~~~~~~~~~~~~~~~~~~~~
col   15[1] @5037: 0
col  16[22] @5039: DEFAULT_CONSUMER_GROUP
col   17[0] @5062: *NULL*
col   18[1] @5063: 0
col   19[0] @5065: *NULL*
col   20[0] @5066: *NULL*
col  21[62] @5067: S:574F64CF334589628C7754569B8C88C0A2000C907997A2E079AD97B2B0E3

--//一些块没有恢复,不想做了,对应索引也没有修正,下午继续看看.

原文地址:https://www.cnblogs.com/lfree/p/10958331.html

时间: 2024-08-02 00:40:58

[20190531]ORA-600 kokasgi1故障模拟与恢复.txt的相关文章

[20190531]ORA-600 kokasgi1故障模拟与恢复(后续).txt

--//http://blog.itpub.net/267265/viewspace-2646340/=>[20190531]ORA-600 kokasgi1故障模拟与恢复.txt--//后续有一些恢复没做,补充测试看看. --//先更正链接http://blog.itpub.net/267265/viewspace-2646340/的一些错误:--//1.前面做坏块恢复时,少写了执行步骤:.BBED> assign kcbh.seq_kcbh = 0x01--//2.使用system用户登录

偶遇问题之ORA 600 [kkpoxgsoh1

alert.log中报错,查看如下: Fri Jul 18 09:25:50 2014 Errors in file /apps/oracle/diag/rdbms/smsrac/smsrac2/trace/smsrac2_ora_15454.trc  (incident=16321): ORA-00600: 内部错误代码, 参数: [kkpoxgsoh1], [0], [], [], [], [], [], [], [], [], [], [] Incident details in: /ap

07 : mysql备份恢复(1) - mysqldump命令使用

注意: mysql不同引擎备份方法不同.我们先来回忆一下和备份有关的知识点. 1.存储引擎(1)InnoDB(默认使用引擎,也是企业常用的) 热备 独立表空间(每个表一个表空间) redo:重做日志,用来前滚 undo:回滚日志,用来回滚(未提交的事务) 行级别锁,基于索引来实现的,GAP锁 支持事务.(2)MyISAM 温备 三个文件构成 表级锁 2.二进制日志(1)记录的是什么? DDL.DCL这些种类语句,记录的就是操作语句 DML:他记录的已提交的事务日志,并支持多种格式记录(row.s

Linux 部署CA数字证书服务

CA数字证书服务 CA Certificate Authority 数字证书授权中心 被通信双方信任的,独立的第三方机构 负责证书颁发,验证,撤销等管理 PKI公钥基础设施 一套标准的密钥管理平台 通过公钥加密,数字证书技术确保信息安全 PKI体系的基础组成 权威认证机构(CA) 数字证书库,密钥备份及恢复系统 证书作废系统,应用接口 OpenSSL加密/解密工具 对称加密: - enc 算法 -e -in 输入文件 -out 输出文件 #加密 - enc 算法 -d -in 输入文件 -out

windows命令提示符常用命令

首先,打开"运行"对话框(Win+R),输入cmd,打开控制台命令窗口... { 也可以通过cmd /c 命令 和 cmd /k 命令的方式来直接运行命令 注:/c表示执行完命令后关闭cmd窗口:/k表示执行完命令后保留cmd窗口 } # 控制台命令窗口中一些技巧 [1].复制内容:右键弹出快捷菜单,选择"标记(K)",然后选中所需复制的内容,然后右键即可 [2].粘贴内容:右键弹出快捷菜单,选择"粘贴(P)" [3].在文件夹空白处按住Shif

Zabbix自定义key监控docker

一.需求场景在某些docker容器中运行着java,容器提供API供监控调用.需要监控服务运行是否正常和容器内JVM使用情况. 二.想法编写监控脚本,使用自定义key的方式添加到Zabbix中. 三.实践1.编写服务监控脚本 #!/bin/bash interval_time=600 service_port_file=/script/tmp/service_port.txt #Gener_service_port tee > ${service_port_file} << EOF ap

Oracle 10.2.0.5 RMAN迁移并升级11.2.0.4一例

一.环境介绍 1. 源数据库环境 操作系统版本: OEL 5.4 x64数据库版本  : 10.2.0.5 x64数据库sid名 : orcl Oracle 10g 10.2.0.5(64bit)安装目录如下: 数据库软件:/u01/app/oracle/product/10.2.0/db_1数据库文件:/u01/app/oracle/oradata/orcl 归档目录:/u01/archivelog RMAN目录:/backup/dbbak/orabak 背景:一个老oracle10g数据库,

ADRCI

ADRCI工具是Oracle11g才推出的新工具,主要用来管理alert文件.trace文件.dump文件.健康监事报告等. 这一篇简单介绍ADRCI工具. 用过11g的人都会发现,11g中alert文件以及trace文件的存放位置都发生了变化.从原来的ORACLE_BASE/admin/INSTANCE_NAME目录变成了ORACLE_BASE/diag/rdbms/DBNAME/INSTANCE_NAME目录. Oracle之所以修改了这个跨越多个版本都没有修改过的参数设置,就是因为Orac

Oracle 通过ADR工具 收集ORA-600错误信息

 问题描述: 2014-06-10 在点检数据库预警文件时,出现Ora -00600 错误,并且Rman L1 备份失败,查询相关资料,得知是Bug:9835218.于是,提SR寻求Oracle 官方技术支持. Oracle回复如下: Your Service Request has been submitted as anORA-600/ORA-7445 issue based on the problem type you chose when logging the SR. Additio