How to use bbed to view the root DBA and bootstrap$ of the system file header

Source: Internet
Author: User
Tags count dba header reset backup

Database version 11.2.0.4

The experiment idea is:--The trace information of the database open, can refer to: http://blog.csdn.net/q947817003/article/details/17025489

File#1 block#1==>root dba==>struct Ktetb

That is, start with the system's data file header: File#1 block#1 to locate the root DBA, and then within the block of the root DBA, find the location of the block described by struct KTETB, and then view the contents of the block specified in struct KTETB ( Content of bootstrap$)

1. Use the Dump data file header to view the root DBA

The DUMP data file header is visible with the following information: --specific methods see: http://blog.csdn.net/q947817003/article/details/16369041

Creation at scn:0x0000.00000015 11/14/2013 14:24:22

Backup taken at scn:0x0000.00000000 01/01/1988 00:00:00 thread:0

Reset Logs Count:0x318f5cd7 scn:0x0000.00000001

Prev Reset Logs count:0x0 scn:0x0000.00000000

Recovered at 11/15/2013 10:50:16

status:0x2004 root dba:0x00400208 chkpt cnt:67 ctl cnt:66

##########

Only system has the root DBA, which is used to locate the bootstrap$, storing a binary number in the 16 binary, where 10bit is the data file number, and bit is the block number.

CTL CNT is a copy of the control file that is used to identify whether the control file is from a backup.

about root dba: at the system file header, Oracle stores a root DBA:

Root dba:this field only occurs in data file #1, and is the location of blocks required during bootstrapping the data dic Tionary (bootstrap$).

Before ORACLE 10g, Root dba:0x004001a1, pointing to the file 1 Block 417 object, the DUMP 417 object could find that the end point was file 1 Block 377.

ORACLE 10G is root dba:0x00400179, pointing to file 1 Block 377

ORACLE 11G Root dba:0x00400208, pointing to file 1 block 520

################

in 11G, Root dba:0x00400208 is calculated as follows: --A byte 8bit, a 16 binary can be used to represent the 4bit binary

First, the binary value of each byte corresponds to the following:

00000000 01000000 00000010 00001000

First 10bit file Number: 0000000001

Rear 22bit block Number: 0000000000001000001000

The corresponding 10-binary file number and block number is: NO. 520 block of 1th file

bys@ bys3>select bit_to_number (' 0000000001 ') from dual;

Bit_to_number (' 0000000001 ')

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

1

bys@ bys3>select bit_to_number (' 0000000000001000001000 ') from dual;

Bit_to_number (' 0000000000001000001000 ')

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

520

####################################################################

2. Use bbed to view the root DBA's point

[Oracle@bys3 ~]$ Cat PAR.BBD

blocksize=8192

Listfile=bbedfile.txt

Mode=edit

[Oracle@bys3 ~]$ Cat Bbedfile.txt

1/U01/ORADATA/BYS3/SYSTEM01.DBF 524288000

2/U01/ORADATA/BYS3/SYSAUX01.DBF 340787200

3/U01/ORADATA/BYS3/UNDOTBS01.DBF 209715200

4/U01/ORADATA/BYS3/USER01.DBF 52428800

[Oracle@bys3 ~]$ bbed PARFILE=PAR.BBD

Password:

Bbed:release 2.0.0.0.0-limited Production on Fri Nov 29 09:22:04 2013

Copyright (c) 1982, Oracle and/or its affiliates. All rights reserved.

************* !!! For Oracle Internal with only!!! ***************

Bbed> Show All

file# 1

block# 1

OFFSET 0

DBA 0x00400001 (4194305 1,1)

Filename/u01/oradata/bys3/system01.dbf

Bifile BIFILE.BBD

ListFile Bbedfile.txt

BLOCKSIZE 8192

MODE Edit

EDIT Unrecoverable

IBase Dec

Obase Dec

WIDTH 80

COUNT 512

LOGFILE LOG.BBD

SPOOL No

bbed> map/v---intercept section

File:/u01/oradata/bys3/system01.dbf (1)

Block:1 dba:0x00400001

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

Data File Header

struct KCVFH, 860 bytes @0

struct KCVFHBFH, Bytes @0

struct Kcvfhhdr, Bytes @20

UB4 Kcvfhrdb @96

struct Kcvfhcrs, 8 bytes @100

UB4 KCVFHCRT @108

UB4 KCVFHRLC @112

bbed> Print Kcvfhrdb---Kcvfhrdb is the specific block location that the root DBA points to

UB4 Kcvfhrdb @96 0x00400208

Oracle leads to read this place: file# 1 block# 520

How does 0x00400208 convert to a specific file number and block number? ---as detailed in the previous step or: http://blog.csdn.net/q947817003/article/details/16996475 first bar

Examples of approximate methods of calculation are as follows:

DBA (data block address) ===file# (10bit) +block# (22bit) ==32bit

The two characters in the 16 binary represent 1bytes,

dba=0x00400001====> conversion to binary is: 00000000 01000000 00000000 00000001

file#=00000000-----File No.

Block#=000000 00000000 00000001--> block

The calculations here are:

0x00400208 first convert to binary: 00000000 01000000 00000010 00001000

Data file number is: 0000000001 data block number is: 0000000000001000001000

bys@ bys3>select bit_to_number (' 0000000001 ') from dual;

Bit_to_number (' 0000000001 ')

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

1

bys@ bys3>select bit_to_number (' 0000000000001000001000 ') from dual;

Bit_to_number (' 0000000000001000001000 ')

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

520

##################################################################################################

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.