global_name为空导致的数据库不能open—–使用DUL修复

联系:QQ(5163721)

标题:global_name为空导致的数据库不能open—–使用DUL修复

作者:Lunar©版权所有[文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.]

GLOBAL_NAME和props$对象介绍
global_name为空导致的数据库不能open—–使用gdb修复(中断oracle启动的部分监测功能)
global_name为空导致的数据库不能open—–使用dd修复(使用dd拷贝块的方式)
global_name为空导致的数据库不能open—使用BBED修复(bbed恢复update的数据)

这篇为第3种解决 global_name 为NULL导致数据库不能启动的方法。
即,使用DUL来直接修改一个block内部的数据的方法。

模拟损坏,将global_name置空:

SYS@lunarp>update global_name set global_name='';

1 row updated.

Elapsed: 00:00:00.45
SYS@lunarp>commit;

Commit complete.

Elapsed: 00:00:00.11
SYS@lunarp>select * from global_name; 

GLOBAL_NAME
------------------------------------------------------------------------------------------------------------------------------------------------------


Elapsed: 00:00:00.19
SYS@lunarp>

那么如何定位到是哪一个block呢?
答案是N中方法:
(1)使用ODU定位这行记录的dba地址
(2)对比其他大版本相同的正常库的相同行的数据
(3)查看报错的trace,找到改行数据的和block
。。。。。。
我们这里使用第二种,查看其他相同版本数据库的信息。具体的方法在第一篇《GLOBAL_NAME和props$对象介绍》 中已经介绍了,这里不再赘述。
首先报错的数据库的alert.log信息如下:

PARSING IN CURSOR #140086475835376 len=55 dep=1 uid=0 oct=3 lid=0 tim=1407167741390301 hv=1950821498 ad='7f2eaec8' sqlid='459f3z9u4fb3u'
select value$ from props$ where name = 'GLOBAL_DB_NAME'
END OF STMT
PARSE #140086475835376:c=1999,e=870,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=415205717,tim=1407167741390297
EXEC #140086475835376:c=0,e=32,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,plh=415205717,tim=1407167741390424
FETCH #140086475835376:c=0,e=44,p=0,cr=2,cu=0,mis=0,r=1,dep=1,og=4,plh=415205717,tim=1407167741390486
Incident 4937 created, dump file: /u01/app/oracle/diag/rdbms/lunarp/lunarp/incident/incdir_4937/lunarp_ora_12099_i4937.trc
ORA-00600: internal error code, arguments: [18062], [], [], [], [], [], [], [], [], [], [], []

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

[oracle@lunar ~]$ ps -ef|grep LOCAL=YES
oracle   12183 12142  0 08:03 ?        00:00:00 oraclelunarp (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   12211 12186  0 08:08 pts/5    00:00:00 grep LOCAL=YES
[oracle@lunar ~]$ 

可以看到,当前global_name已经被置空了:

[oracle@lunar dul]$ ./dul

Data UnLoader: 10.2.0.5.28 - Internal Only - on Wed Mar  5 00:05:17 2014
with 64-bit io functions

Copyright (c) 1994 2014 Bernard van Duijnen All rights reserved.

 Strictly Oracle Internal Use Only


DUL: Warning: Recreating file "dul.log"
Found db_id = 2464578389
Found db_name = LUNAR
DUL> 
DUL> bootstrap;
Probing file = 1, block = 520
. unloading table                BOOTSTRAP$
DUL: Warning: block number is non zero but marked deferred trying to process it anyhow
      60 rows unloaded
DUL: Warning: Dictionary cache DC_BOOTSTRAP is empty
Reading BOOTSTRAP.dat 60 entries loaded
Parsing Bootstrap$ contents
Generating dict.ddl for version 10
 OBJ$: segobjno 18, file 1 block 240
 TAB$: segobjno 2, tabno 1, file 1  block 144
 COL$: segobjno 2, tabno 5, file 1  block 144
 USER$: segobjno 10, tabno 1, file 1  block 208
Running generated file "@dict.ddl" to unload the dictionary tables
. unloading table                      OBJ$   18308 rows unloaded
. unloading table                      TAB$    2084 rows unloaded
. unloading table                      COL$   73656 rows unloaded
. unloading table                     USER$      42 rows unloaded
Reading USER.dat 42 entries loaded
Reading OBJ.dat 18308 entries loaded and sorted 18308 entries
Reading TAB.dat 2084 entries loaded
Reading COL.dat 73656 entries loaded and sorted 73656 entries
Reading BOOTSTRAP.dat 60 entries loaded

DUL: Warning: Recreating file "dict.ddl"
Generating dict.ddl for version 10
 OBJ$: segobjno 18, file 1 block 240
 TAB$: segobjno 2, tabno 1, file 1  block 144
 COL$: segobjno 2, tabno 5, file 1  block 144
 USER$: segobjno 10, tabno 1, file 1  block 208
 TABPART$: segobjno 568, file 1 block 3872
 INDPART$: segobjno 573, file 1 block 3912
 TABCOMPART$: segobjno 590, file 1 block 4056
 INDCOMPART$: segobjno 595, file 1 block 4096
 TABSUBPART$: segobjno 580, file 1 block 3976
 INDSUBPART$: segobjno 585, file 1 block 4016
 IND$: segobjno 2, tabno 3, file 1  block 144
 ICOL$: segobjno 2, tabno 4, file 1  block 144
 LOB$: segobjno 2, tabno 6, file 1  block 144
 COLTYPE$: segobjno 2, tabno 7, file 1  block 144
 TYPE$: segobjno 495, tabno 1, file 1  block 3344
 COLLECTION$: segobjno 495, tabno 2, file 1  block 3344
 ATTRIBUTE$: segobjno 495, tabno 3, file 1  block 3344
 LOBFRAG$: segobjno 601, file 1 block 4144
 LOBCOMPPART$: segobjno 604, file 1 block 4168
 UNDO$: segobjno 15, file 1 block 224
 TS$: segobjno 6, tabno 2, file 1  block 176
 PROPS$: segobjno 98, file 1 block 800
Running generated file "@dict.ddl" to unload the dictionary tables
. unloading table                      OBJ$
DUL: Warning: Recreating file "OBJ.ctl"
   18308 rows unloaded
. unloading table                      TAB$
DUL: Warning: Recreating file "TAB.ctl"
    2084 rows unloaded
. unloading table                      COL$
DUL: Warning: Recreating file "COL.ctl"
   73656 rows unloaded
. unloading table                     USER$
DUL: Warning: Recreating file "USER.ctl"
      42 rows unloaded
. unloading table                  TABPART$     119 rows unloaded
. unloading table                  INDPART$     136 rows unloaded
. unloading table               TABCOMPART$       1 row  unloaded
. unloading table               INDCOMPART$       0 rows unloaded
. unloading table               TABSUBPART$      32 rows unloaded
. unloading table               INDSUBPART$       0 rows unloaded
. unloading table                      IND$    2689 rows unloaded
. unloading table                     ICOL$    5826 rows unloaded
. unloading table                      LOB$     286 rows unloaded
. unloading table                  COLTYPE$    1654 rows unloaded
. unloading table                     TYPE$    1999 rows unloaded
. unloading table               COLLECTION$     687 rows unloaded
. unloading table                ATTRIBUTE$    7750 rows unloaded
. unloading table                  LOBFRAG$       1 row  unloaded
. unloading table              LOBCOMPPART$       0 rows unloaded
. unloading table                     UNDO$      11 rows unloaded
. unloading table                       TS$       7 rows unloaded
. unloading table                    PROPS$      36 rows unloaded
Reading USER.dat 42 entries loaded
Reading OBJ.dat 18308 entries loaded and sorted 18308 entries
Reading TAB.dat 2084 entries loaded
Reading COL.dat 73656 entries loaded and sorted 73656 entries
Reading TABPART.dat 119 entries loaded and sorted 119 entries
Reading TABCOMPART.dat 1 entries loaded and sorted 1 entries
Reading TABSUBPART.dat 32 entries loaded and sorted 32 entries
Reading INDPART.dat 136 entries loaded and sorted 136 entries
Reading INDCOMPART.dat 0 entries loaded and sorted 0 entries
Reading INDSUBPART.dat 0 entries loaded and sorted 0 entries
Reading IND.dat 2689 entries loaded
Reading LOB.dat 286 entries loaded
Reading ICOL.dat 5826 entries loaded
Reading COLTYPE.dat 1654 entries loaded
Reading TYPE.dat 1999 entries loaded
Reading ATTRIBUTE.dat 7750 entries loaded
Reading COLLECTION.dat 687 entries loaded
Reading BOOTSTRAP.dat 60 entries loaded
Reading LOBFRAG.dat 1 entries loaded and sorted 1 entries
Reading LOBCOMPPART.dat 0 entries loaded and sorted 0 entries
Reading UNDO.dat 11 entries loaded
Reading TS.dat 7 entries loaded
Reading PROPS.dat 36 entries loaded
Database character set is AL32UTF8
Database national character set is AL16UTF16
DUL> 
。。。。。。。。。。。。。。。。。。。
。。。。。。。。。。。。。。。。。。。。。。
    .   struct row   [31] with 9 members
    .   {
04159     kdrhf         tflag    = 0X2C = 0X2C (--H-FL--)
04160     ub1           lock     = 0X02 = 2
04161     ub1           ccnt     = 0X03 = 3
    .     struct col   [0] with 2 members
    .     {
04162       ub1           slen     = 0X0E = 14
04163              data     = HEX '474c4f42414c5f44425f4e414d45' = "GLOBAL_DB_NAME"
    .     }
    .     struct col   [1] with 1 member
    .     {
04177       ub1           slen     = 0XFF = 255
    .     }
    .     struct col   [2] with 2 members
    .     {
04178       ub1           slen     = 0X14 = 20
04179              data     = HEX '476c6f62616c206461746162617365206e616d65' = "Global database name"
    .     }
    .   }
DUL> 

现在修改

DUL> update set row[31].col[1].slen=5;

DUL: Warning: Automatic checksum fix checksum set to 0xd556
DUL> update set row[31].col[1].data='LUNAR';

DUL: Warning: Automatic checksum fix checksum set to 0xed1c

修改后的数据如下:

DUL> dump row[31];
    .   struct row   [31] with 9 members
    .   {
04159     kdrhf         tflag    = 0X2C = 0X2C (--H-FL--)
04160     ub1           lock     = 0X02 = 2
04161     ub1           ccnt     = 0X03 = 3
    .     struct col   [0] with 2 members
    .     {
04162       ub1           slen     = 0X0E = 14
04163              data     = HEX '474c4f42414c5f44425f4e414d45' = "GLOBAL_DB_NAME"
    .     }
    .     struct col   [1] with 2 members
    .     {
04177       ub1           slen     = 0X05 = 5
04178              data     = HEX '4c554e4152' = "LUNAR"
    .     }
    .     struct col   [2] with 2 members
    .     {
04183       ub1           slen     = 0X0F = 15
04184              data     = HEX '6c206461746162617365206e616d65' = "l database name"
    .     }
    .   }
DUL> 

直接启动数据库:

SYS@lunarp>startup
Welcome Lunar's oracle world!

Love you , baby !

ORACLE instance started.

Total System Global Area  626327552 bytes
Fixed Size                  2230952 bytes
Variable Size             243271000 bytes
Database Buffers          373293056 bytes
Redo Buffers                7532544 bytes
Database mounted.
Welcome Lunar's oracle world!

Love you , baby !

Database opened.
SYS@lunarp>
此条目发表在 DUL ODU 分类目录,贴了 , , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>