返回小栈
13_深入解析Oracle数据库bootstrap
orastar2020-03-23 14:25:54


作者简介:

作者简介:惠星星,现就职于北京海天起点,持有OCP 10g、OCP 11g、OCM 11g证书,并有长达10余年电力行业业务维护、数据库维护服务经验,擅长Oracle数据库性能优化、故障处理及Oracle Internal Research。


一、概念介绍



Oracle数据库中bootstrap是一组表,告诉我们其余的表在哪里。类似于数据字典的数据字典。它位于一个固定的位置--如磁盘驱动器上的引导记录。我们总能在一个已知的地点找到它。--by Tom Kyte

通常,Bootstrap是一种将计算机程序的前几条指令加载到活动内存中,然后使用它们来加载程序的其余部分的技术,Oracle中,Bootstrap指的是在打开数据库之前加载元数据(数据字典),Oracle数据库中object_id小于59(11g: 59,10g: 56)的为Bootstrap objects,其中包括表/索引/集群对象,Bootstrap objects包含数据库中最重要的元数据,是启动实例的必需对象。Bootstrap objects对象解析结果如下所示,

1 Bootstrap objects对象解析表


二、    数据库启动过程调试



STARTUP MOUNT;   

ALTER SESSION SET EVENTS '10046 TRACE NAMECONTEXT FOREVER,LEVEL 12';

ALTER DATABASE OPEN;

ALTER SESSION SET EVENTS '10046 TRACE NAMECONTEXT OFF';

SHOW PARAMETER USER_DUMP_DEST

ORADEBUG SETMYPID

ORADEBUG TRACEFILE_NAME

 

2 创建及查询Bootstrap$

---创建bootstrap对象: 59

[oracle@sourcedb ~]$ egrep -in '^create' /u01/app/oracle/diag/rdbms/epmsn/epmsn/trace/epmsn_ora_21827.trc

167:create table bootstrap$ (

252:CREATE ROLLBACK SEGMENT SYSTEM STORAGE(  INITIAL 112K NEXT 56K MINEXTENTS 1MAXEXTENTS 32765 OBJNO 0 EXTENTS (FILE 1 BLOCK 128))

259:CREATE CLUSTER C_OBJ#("OBJ#"NUMBER) PCTFREE 5 PCTUSED 40 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 136K NEXT 200K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 2 EXTENTS (FILE 1 BLOCK 144)) SIZE800

266:CREATE INDEX I_OBJ# ON CLUSTER C_OBJ#PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 3 EXTENTS (FILE 1 BLOCK 168))

276:CREATE TABLE TAB$("OBJ#"

283:CREATE TABLE CLU$("OBJ#"

290:CREATE CLUSTER C_TS#("TS#"NUMBER) PCTFREE 10 PCTUSED 40 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 6 EXTENTS (FILE 1 BLOCK 176))

297:CREATE INDEX I_TS# ON CLUSTER C_TS#PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 7 EXTENTS (FILE 1 BLOCK 184))

307:CREATE CLUSTERC_FILE#_BLOCK#("TS#" NUMBER,"SEGFILE#" NUMBER,"SEGBLOCK#"NUMBER) PCTFREE 10 PCTUSED 40 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 24K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 8 EXTENTS (FILE 1 BLOCK 192)) SIZE225

314:CREATE INDEX I_FILE#_BLOCK# ON CLUSTERC_FILE#_BLOCK# PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 9 EXTENTS (FILE 1 BLOCK 200))

324:CREATE CLUSTERC_USER#("USER#" NUMBER) PCTFREE 10 PCTUSED 40 INITRANS 2 MAXTRANS 255STORAGE (  INITIAL 64K NEXT 1024KMINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 10 EXTENTS (FILE 1 BLOCK208)) SIZE 372

331:CREATE INDEX I_USER# ON CLUSTER C_USER#PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 11 EXTENTS (FILE 1 BLOCK 216))

341:CREATE TABLE FET$("TS#" N

348:CREATE TABLE UET$("SEGFIL

355:CREATE TABLE SEG$("FILE#"

362:CREATE TABLE UNDO$("US#"

369:CREATE TABLE TS$("TS#" NU

376:CREATE TABLE FILE$("FILE#

383:CREATE TABLE OBJ$("OBJ#"

390:CREATE TABLE IND$("OBJ#"

397:CREATE TABLE ICOL$("OBJ#"

404:CREATE TABLE COL$("OBJ#"

411:CREATE TABLE USER$("USER#

418:CREATE TABLE PROXY_DATA$(

425:CREATE UNIQUE INDEX I_PROXY_DATA$ ONPROXY_DATA$(CLIENT#,PROXY#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 24 EXTENTS (FILE 1 BLOCK 256))

435:CREATE TABLE PROXY_ROLE_D

442:CREATE INDEX I_PROXY_ROLE_DATA$_1 ONPROXY_ROLE_DATA$(CLIENT#,PROXY#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 26 EXTENTS (FILE 1 BLOCK 272))

452:CREATE UNIQUE INDEXI_PROXY_ROLE_DATA$_2 ON PROXY_ROLE_DATA$(CLIENT#,PROXY#,ROLE#) PCTFREE 10INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 27 EXTENTS (FILE 1 BLOCK 280))

462:CREATE TABLE CON$("OWNER#

469:CREATE CLUSTER C_COBJ#("OBJ#"NUMBER) PCTFREE 0 PCTUSED 50 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 56K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 29 EXTENTS (FILE 1 BLOCK 296)) SIZE300

476:CREATE INDEX I_COBJ# ON CLUSTER C_COBJ#PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 30 EXTENTS (FILE 1 BLOCK 304))

486:CREATE TABLE CDEF$("CON#"

493:CREATE TABLE CCOL$("CON#"

500:CREATE INDEX I_TAB1 ON TAB$(BOBJ#)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 33 EXTENTS (FILE 1 BLOCK 312))

510:CREATE UNIQUE INDEX I_UNDO1 ONUNDO$(US#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 34 EXTENTS (FILE 1 BLOCK 320))

520:CREATE INDEX I_UNDO2 ON UNDO$(NAME)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 35 EXTENTS (FILE 1 BLOCK 328))

530:CREATE UNIQUE INDEX I_OBJ1 ONOBJ$(OBJ#,OWNER#,TYPE#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 36 EXTENTS (FILE 1 BLOCK 336))

540:CREATE UNIQUE INDEX I_OBJ2 ONOBJ$(OWNER#,NAME,NAMESPACE,REMOTEOWNER,LINKNAME,SUBNAME,TYPE#,SPARE3,OBJ#)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 16K NEXT 104K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 37 EXTENTS (FILE 1 BLOCK 344))

550:CREATE INDEX I_OBJ3 ON OBJ$(OID$)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 38 EXTENTS (FILE 1 BLOCK 352))

560:CREATE INDEX I_OBJ4 ONOBJ$(DATAOBJ#,TYPE#,OWNER#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 39 EXTENTS (FILE 1 BLOCK 360))

570:CREATE UNIQUE INDEX I_OBJ5 ONOBJ$(SPARE3,NAME,NAMESPACE,TYPE#,OWNER#,REMOTEOWNER,LINKNAME,SUBNAME,OBJ#)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 40 EXTENTS (FILE 1 BLOCK 368))

580:CREATE UNIQUE INDEX I_IND1 ONIND$(OBJ#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 41 EXTENTS (FILE 1 BLOCK 376))

592:CREATE INDEX I_ICOL1 ON ICOL$(OBJ#)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 42 EXTENTS (FILE 1 BLOCK 384))

602:CREATE UNIQUE INDEX I_FILE1 ONFILE$(FILE#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 43 EXTENTS (FILE 1 BLOCK 392))

612:CREATE UNIQUE INDEX I_FILE2 ONFILE$(TS#,RELFILE#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 44 EXTENTS (FILE 1 BLOCK 400))

622:CREATE UNIQUE INDEX I_TS1 ON TS$(NAME)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 45 EXTENTS (FILE 1 BLOCK 408))

632:CREATE UNIQUE INDEX I_USER1 ONUSER$(NAME) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 46 EXTENTS (FILE 1 BLOCK 416))

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

652:CREATE UNIQUE INDEX I_COL1 ONCOL$(OBJ#,NAME) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 32K NEXT 104K MINEXTENTS 1 MAXEXTENTS2147483645 PCTINCREASE 0 OBJNO 48 EXTENTS (FILE 1 BLOCK 432))

662:CREATE INDEX I_COL2 ON COL$(OBJ#,COL#)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 104K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 49 EXTENTS (FILE 1 BLOCK 440))

672:CREATE UNIQUE INDEX I_COL3 ONCOL$(OBJ#,INTCOL#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 32K NEXT 104K MINEXTENTS 1 MAXEXTENTS2147483645 PCTINCREASE 0 OBJNO 50 EXTENTS (FILE 1 BLOCK 448))

682:CREATE UNIQUE INDEX I_CON1 ONCON$(OWNER#,NAME) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 51 EXTENTS (FILE 1 BLOCK 456))

692:CREATE UNIQUE INDEX I_CON2 ONCON$(CON#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 52 EXTENTS (FILE 1 BLOCK 464))

702:CREATE UNIQUE INDEX I_CDEF1 ONCDEF$(CON#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 53 EXTENTS (FILE 1 BLOCK 472))

712:CREATE INDEX I_CDEF2 ON CDEF$(OBJ#)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 54 EXTENTS (FILE 1 BLOCK 480))

722:CREATE INDEX I_CDEF3 ON CDEF$(ROBJ#)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 55 EXTENTS (FILE 1 BLOCK 488))

732:CREATE INDEX I_CDEF4 ON CDEF$(ENABLED)PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0OBJNO 56 EXTENTS (FILE 1 BLOCK 496))

742:CREATE INDEX I_CCOL1 ONCCOL$(CON#,COL#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1MAXEXTENTS 2147483645 PCTINCREASE 0 OBJNO 57 EXTENTS (FILE 1 BLOCK 504))

752:CREATE UNIQUE INDEX I_CCOL2 ONCCOL$(CON#,INTCOL#) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (  INITIAL 64K NEXT 1024K MINEXTENTS 1 MAXEXTENTS2147483645 PCTINCREASE 0 OBJNO 58 EXTENTS (FILE 1 BLOCK 512))

[oracle@sourcedb ~]$ egrep -in '^create'/u01/app/oracle/diag/rdbms/epmsn/epmsn/trace/epmsn_ora_21827.trc|wc -l

59


*****查询extent占用情况

[oracle@sourcedb ~]$

set linesize 200 pagesize 200

col owner for a10

col segment_name for a20

col segment_type for a20

selectowner,segment_name,segment_type,EXTENT_ID,file_id,block_id,BLOCKS fromdba_extents where file_id=1 and 520 between block_id and block_id + blocks -1;

 

OWNER  SEGMENT_NAME          SEGMENT_TYPE  EXTENT_ID FILE_ID   BLOCK_ID           BLOCKS

------------------------------ -------------------- ---------- ---------- --------------------

SYS                      BOOTSTRAP$                       TABLE    0                           1                                                          520               8

 

SQL>


三、    bootstrap$对象解析



bootstrap$对象解析sql:

--bootstrap$表对象解析.sql   by 惠星星 2020.3.2

select line#,

      obj#,

      substr(sql_text, 1, 30) t_sql_1,

      case

        when substr(sql_text,8,instr(sql_text, ' ',1,2)-8)='ROLLBACK' then'SYSTEM'

        when substr(sql_text,8,instr(sql_text, ' ',1,2)-8) in('CLUSTER','TABLE') then substr(sql_text, instr(sql_text,'',1,2)+1,instr(sql_text,'(',1,1)-instr(sql_text,' ',1,2)-1)

        when substr(sql_text,8,instr(sql_text, ' ',1,2)-8)='INDEX' then substr(sql_text,instr(sql_text,' ',1,2)+1,instr(sql_text,' ',1,3)-instr(sql_text,' ',1,2)-1)

        when substr(sql_text,8,instr(sql_text, ' ',1,2)-8)='UNIQUE' thensubstr(sql_text, instr(sql_text,' ',1,3)+1,instr(sql_text,'',1,4)-instr(sql_text,' ',1,3)-1)

      else ''

      end name, 

      substr(sql_text,8,instr(sql_text, ' ',1,2)-8) type,

      case when instr(sql_text, 'OBJNO ')<>0 then substr(sql_text,instr(sql_text, 'OBJNO '), 8)   else ''end obj_no,

      case when instr(sql_text, 'TABNO ')<>0 then substr(sql_text,instr(sql_text, 'TABNO '), 7)   else ''end TABNO,

      --sql_text,

      case when instr(sql_text, 'TABNO ')<>0 then substr(sql_text,instr(sql_text, 'CLUSTER '), instr(sql_text, ')',-1)-instr(sql_text, 'CLUSTER')+1)   else '' end clus,

      case when instr(sql_text, 'FILE 1 ')<>0 then substr(sql_text,instr(sql_text, 'FILE 1 '), 6)   else ''end file#,

      case when instr(sql_text, 'BLOCK ')<>0 then substr(sql_text,instr(sql_text, 'BLOCK '), 9)   else ''end block#

 from bootstrap$  order by 2;


bootstrap$表对象解析结果:

请见,图1 Bootstrap objects对象解析表

      

四、    bbed解析bootstrap$表



BBED> set dba 1,520

                DBA                        0x00400208(4194824 1,520)

               

BBED> p ktetb

struct ktetb[0], 8 bytes                    @108     --extent map 表示从file#1,block# 521开始的7blocks

  ub4 ktetbdba                            @108      0x00400209 

  ub4 ktetbnbk                            @112      0x00000007

 

[oracle@sourcedb ~]$ ora_rdba0x00400209  

*******Welcome to use ora_rdba toolauthored by orastar.*******

*******weixin: xidoublestar*******

rdba is: 0x400209

datafile# is: 1

datablock is: 521

dump command:alter system dump datafile 1block 521;

[oracle@sourcedb ~]$

 

 

BBED> p ktemh

struct ktemh, 16 bytes                      @92     

  ub4 count_ktemh                  @92       0x00000001  --只有一个extent map

  ub4 next_ktemh                          @96       0x00000000 

  ub4 obj_ktemh                            @100      0x0000003b  --obj#: 59

  ub4 flag_ktemh                          @104      0x40000000

 

BBED>

 

BBED> p hwmark_ktech

struct hwmark_ktech, 32 bytes               @48     

  ub4 extno_ktehw                         @48       0x00000000

  ub4 blkno_ktehw                         @52       0x00000003

  ub4 extsize_ktehw                       @56       0x00000007

  ub4 blkaddr_ktehw @60  0x0040020c  --高水位 dba 1,524,全表扫描查询:524以下的block.

  ub4 mapblk_ktehw                        @64       0x00000000

  ub4 offset_ktehw                        @68       0x00000000

  ub4 flblks_ktehw                        @72       0x00000001

  ub4 blkcnt_ktehw                        @76       0x00000003

 

BBED>

 

[oracle@sourcedb ~]$ ora_rdba 0x0040020c

*******Welcome to use ora_rdba toolauthored by orastar.*******

*******weixin: xidoublestar*******

rdba is: 0x40020c

datafile# is: 1

datablock is: 524

dump command:alter system dump datafile 1block 524;

[oracle@sourcedb ~]$

 

 

 

BBED> set dba 1,521

                DBA                        0x00400209(4194825 1,521)

 

BBED> p kdbr

sb2 kdbr[0]                                 @86       8099

sb2 kdbr[1]                                 @88       7962

sb2 kdbr[2]                                 @90      7573

sb2 kdbr[3]                                 @92       7373

sb2 kdbr[4]                                 @94       6990

sb2 kdbr[5]                                 @96       6778

sb2 kdbr[6]                                 @98       6573

sb2 kdbr[7]                                 @100      5961

sb2 kdbr[8]                                 @102      5755

sb2 kdbr[9]                                 @104      5555

sb2 kdbr[10]                                @106      5334

sb2 kdbr[11]                                @108      5130

sb2 kdbr[12]                                @110      4847

sb2 kdbr[13]                                @112      4613

sb2 kdbr[14]                                @114      4366

sb2 kdbr[15]                                @116      3896

sb2 kdbr[16]                                @118      3688

sb2 kdbr[17]                                @120      3473

sb2 kdbr[18]                                @122      3193

sb2 kdbr[19]                                @124     2409

sb2 kdbr[20]                                @126      2204

sb2 kdbr[21]                                @128      1630

sb2 kdbr[22]                                @130      1421

sb2 kdbr[23]                          @132      1222    --该块中存储24行数据

BBED>

 

BBED> p *kdbr[23]     

rowdata[0]

----------

ub1 rowdata[0]                              @1290     0x2c

 

BBED> x /rccccc

rowdata[0]                                  @1290   

----------

flag@1290: 0x2c (KDRHFL, KDRHFF, KDRHFH)

lock@1291: 0x01

cols@1292:    3

 

col   0[2] @1293: ..

col   1[2] @1296: ..

col 2[189] @1299: CREATE INDEX I_TS# ON CLUSTER C_TS# PCTFREE 10INITRANS     --存储的sql语句

 2MAXTRANS 255 STORAGE (  INITIAL 64K NEXT1024K MINEXTENTS 1 MAXEXTENTS 2

147483645 PCTINCREASE 0 OBJNO 7 EXTENTS(FILE 1 BLOCK 184))

 

***********bootstrap$存储在哪行

select

dbms_rowid.rowid_object(rowid) object_id,

dbms_rowid.rowid_relative_fno(rowid)file_id,

dbms_rowid.rowid_block_number(rowid)block_id,

dbms_rowid.rowid_row_number(rowid) frombootstrap$ where line#=59;

 

BBED> set dba 1,522

                DBA                        0x0040020a(4194826 1,522)

 

BBED> p *kdbr[13]

rowdata[1959]

-------------

ub1 rowdata[1959]                           @3485     0x2c

 

BBED> x /rccccccccc

rowdata[1959]                               @3485   

-------------

flag@3485: 0x2c (KDRHFL, KDRHFF, KDRHFH)

lock@3486: 0x01

cols@3487:    3

 

col   0[2] @3488: .<

col   1[2] @3491: .<

col 2[272] @3494: CREATE TABLE BOOTSTRAP$("LINE#" NUMBER NOTNULL,"OBJ#"

NUMBER NOT NULL,"SQL_TEXT"VARCHAR2(4000) NOT NULL) PCTFREE 10 PCTUSED 40 I

NITRANS 1 MAXTRANS 255 STORAGE (  INITIAL 56K NEXT 1024K MINEXTENTS 1 MAXEX

TENTS 2147483645 PCTINCREASE 0 OBJNO 59EXTENTS (FILE 1 BLOCK 520))

 

BBED>

 

五、    bootstrap$的地址存储在哪?



bootstrap$的地址存储在file1,block1kcvfhrdb(offset96)中,kcvfhrdb结构每个数据文件头都有,但只有file 1有值,其它文件为(11.2.0.4以前)

BBED> set dba 1,1

BBED> p kcvfhrdb

ub4 kcvfhrdb                                @96       0x00400208

 

BBED> set dba 2,1

                DBA                        0x00800001(8388609 2,1)

 

BBED> p kcvfhrdb

ub4 kcvfhrdb                                @96       0x00000000

 

BBED> set dba 3,1

                DBA                        0x00c00001(12582913 3,1)

 

BBED> p kcvfhrdb

ub4 kcvfhrdb                                @96       0x00000000

 

BBED>

 

[oracle@sourcedb ~]$ ora_rdba 0x00400208

*******Welcome to use ora_rdba toolauthored by orastar.*******

*******weixin: xidoublestar*******

rdba is: 0x400208

datafile# is: 1

datablock is: 520

dump command:alter system dump datafile 1block 520;

[oracle@sourcedb ~]$


六、    说明



1、以上内容为个人多次测试结果,由于个人原因,如有分析不足之处还请见谅及指正。

     2、文章涉及内容,请勿在生产环境模拟。

 


纸上得来终觉浅,绝知此事要躬行。--陆游



感谢您的阅读,如果您觉得有所收获,也欢迎把文章分享给您的朋友。




0
0