Understanding the storage structure 2, understanding the Storage Structure

Source: Internet
Author: User

Understanding the storage structure 2, understanding the Storage Structure

Next http://blog.csdn.net/ashic/article/details/44117867
In the previous article, we dumped L1 L2 L3 blocks. Now let's take a look at the information they contain.

Content Note
L1 FIRST LEVEL BITMAP BLOCK
L2 SECOND LEVEL BITMAP BLOCK
L3 (segment header) PAGETABLE SEGMENT HEADER

We can see the Dump file through the above table.
In this tablespace with an uniform size of 1 MB, two L1 blocks in one partition, one L2 block and one L3 Block

In the first L1 Block
Dump of First Level Bitmap Block --------------------------------   nbits : 4 nranges: 1         parent dba:  0x01800082   poffset: 0        unformatted: 60      total: 64        first useful block: 4         owning instance : 1   instance ownership changed at 03/07/2015 17:19:38   Last successful Search 03/07/2015 17:19:38   Freeness Status:  nf1 0      nf2 0      nf3 0      nf4 0         Extent Map Block Offset: 4294967295    First free datablock : 4         Bitmap block lock opcode 9   Locker xid:     :  0x0006.020.00000594   Dealloc scn: 2275418.0    Flag: 0x00000021 (OBJD/-/-/-/-/HWM)   Inc #: 0 Objd: 77412   HWM Flag: HWM Set      Highwater::  0x01800084  ext#: 0      blk#: 4      ext size: 128     #blocks in seg. hdr's freelists: 0       #blocks below: 0       mapblk  0x00000000  offset: 0     

Parent dba: 0x01800082 table is to manage its L2 block location

You can use the DBMS_UTILITY.DATA_BLOCK_ADDRESS package to obtain the L1 block location.

sys@PROD>select dbms_utility.data_block_address_file(TO_NUMBER('&entervalue', 'XXXXXXXX')) file_id,dbms_utility.data_block_address_block(TO_NUMBER('&entervalue', 'XXXXXXXX')) block_id from dual;Enter value for entervalue: 01800082Enter value for entervalue: 01800082   FILE_ID   BLOCK_ID---------- ----------         6        130

Unformatted: 60 total: 64 first useful block: 4

Indicates that there are 60 unformatted blocks. L1 manages 64 data blocks in total. The first available data block is block 4, that is, Block 132 of file 6.

HWM Flag: HWM Set      Highwater::  0x01800084  ext#: 0      blk#: 4      ext size: 128   

The high water level is first set to 0x01800084, that is, the first available block in file 6, because the FAN table was TRUNCATE and no data was found in my test just now.

Note that the movement rule of the ASSM high water level line is: when the first line is inserted in the zone, the high water point is moved to the first L1 of the zone.
Block. After moving to the largest data block in the second L2 block, and so on

Ext #: 0 indicates the first partition.
Blk #: 4. Fourth Block
Ext size: 128 contains 128 blocks.

--------------------------------------------------------  DBA Ranges :  --------------------------------------------------------   0x01800080  Length: 64     Offset: 0         0:Metadata   1:Metadata   2:Metadata   3:Metadata   4:unformatted   5:unformatted   6:unformatted   7:unformatted   8:unformatted   9:unformatted   10:unformatted   11:unformatted   12:unformatted   13:unformatted   14:unformatted   15:unformatted   16:unformatted   17:unformatted   18:unformatted   19:unformatted   20:unformatted   21:unformatted   22:unformatted   23:unformatted   24:unformatted   25:unformatted   26:unformatted   27:unformatted   28:unformatted   29:unformatted   30:unformatted   31:unformatted   32:unformatted   33:unformatted   34:unformatted   35:unformatted   36:unformatted   37:unformatted   38:unformatted   39:unformatted   40:unformatted   41:unformatted   42:unformatted   43:unformatted   44:unformatted   45:unformatted   46:unformatted   47:unformatted   48:unformatted   49:unformatted   50:unformatted   51:unformatted   52:unformatted   53:unformatted   54:unformatted   55:unformatted   56:unformatted   57:unformatted   58:unformatted   59:unformatted   60:unformatted   61:unformatted   62:unformatted   63:unformatted  --------------------------------------------------------

0x01800080 indicates the location of the L1 Block
You can use the DBMS_UTILITY.DATA_BLOCK_ADDRESS package to obtain the L1 block location.

sys@PROD>set verify offsys@PROD>select dbms_utility.data_block_address_file(TO_NUMBER('&entervalue', 'XXXXXXXX')) file_id,dbms_utility.data_block_address_block(TO_NUMBER('&entervalue', 'XXXXXXXX')) block_id from dual;Enter value for entervalue: 01800080Enter value for entervalue: 01800080   FILE_ID   BLOCK_ID---------- ----------         6        128

The block number can be calculated directly without a package.

We can continue to see that 64 data blocks are managed in L1 blocks, that is, 128 ~ 191
Use> 75%, 50%-75%, 25%-50%, and <25% to mark block usage
Currently, 64 blocks managed in L1 are 0 ~ Block 3 is a metadata block, which is 128,129,130,131 blocks.
4 ~ 63 The 60 blocks are data blocks and the status is unformatted and not formatted.

What is unformatted?

As we mentioned in the previous article, in the initial scenario, the table ID and segment ID are the same.

scott@PROD>select object_id,data_object_id from dba_objects where object_name='FAN'; OBJECT_ID DATA_OBJECT_ID---------- --------------     77411          77411

The table ID does not change once it is created, but the segment ID changes. For example, after Truncate

scott@PROD>truncate table fan;Table truncated.scott@PROD>select object_id,data_object_id from dba_objects where object_name='FAN'; OBJECT_ID DATA_OBJECT_ID---------- --------------     77411          77412

After the segment ID is different from the table ID, the formatted block is the segment ID recorded in the block.
What is not formatted is the same as the segment ID before truncate.
You can dump an unformatted Quick View of seg/obj. After comparison, you will know that I will not do the experiment.

Continue reading L2 Blocks

The second L1 is similar to the first L1.

Dump of Second Level Bitmap Block   number: 2       nfree: 2       ffree: 0      pdba:     0x01800083    Inc #: 0 Objd: 77412  opcode:4  xid:   L1 Ranges :  --------------------------------------------------------   0x01800080  Free: 5 Inst: 1    0x01800081  Free: 5 Inst: 1   --------------------------------------------------------

The address 0x01800083 of the pdba block, that is, the address of the L3 block, and the address of the L1 block are recorded in the L2 block.
Here Free: 5. I don't know what it means. Tell me what it means.

L3 Block
Extent Control Header  -----------------------------------------------------------------  Extent Header:: spare1: 0      spare2: 0      #extents: 1      #blocks: 128                     last map  0x00000000  #maps: 0      offset: 2716        Highwater::  0x018000c0  ext#: 0      blk#: 4      ext size: 128     #blocks in seg. hdr's freelists: 0       #blocks below: 0       mapblk  0x00000000  offset: 0                        Unlocked  --------------------------------------------------------  Low HighWater Mark :       Highwater::  0x01800084  ext#: 0      blk#: 4      ext size: 128     #blocks in seg. hdr's freelists: 0       #blocks below: 0       mapblk  0x00000000  offset: 0       Level 1 BMB for High HWM block: 0x01800080  Level 1 BMB for Low HWM block: 0x01800080

Please note that Highwater: 0x018000c0 Low HighWater Mark
: 0x01800084 low and high waterline

The formatted block when it is below the low-height waterline.
The block between the low and high levels may be formatted or not
Introduction to an official document


In short, what you should remember is that during full table scanning, the system usually reads to the low and high watermark lines, and then reads the formatted blocks between the low and high based on the bitmap to avoid unformatted blocks.
The simplest way to view the high-water line is to dump the segment header.

sys@PROD>select header_file,header_block from dba_segments where segment_name='FAN' and owner='SCOTT';HEADER_FILE HEADER_BLOCK----------- ------------          6          131

The preceding command can be used to easily find the field header.

--------------------------------------------------------  Segment Type: 1 nl2: 1      blksz: 8192   fbsz: 0        L2 Array start offset:  0x00001434  First Level 3 BMB:  0x00000000  L2 Hint for inserts:  0x01800082  Last Level 1 BMB:  0x01800081  Last Level II BMB:  0x01800082  Last Level III BMB:  0x00000000     Map Header:: next  0x00000000  #extents: 1    obj#: 77412  flag: 0x10000000  Inc # 0 
Content Note
First Level 3 BMB: 0x00000000 Large databases, ultra-large zones, and ultra-large blocks
Last Level 1 BMB: 0x01800081 Last L1 BMB address
Last Level ii bmb: 0x01800082 Last L2 BMB address
Last Level iii bmb: 0x0000000 The last L3 BMB address
Extent Map  -----------------------------------------------------------------   0x01800080  length: 128   

Region information recorded in L3
The first area starts from 0x01800080, but it should be noted that the full table scan is read by Oracle, not the area map here.
But below

Auxillary Map  --------------------------------------------------------   Extent 0     :  L1 dba:  0x01800080 Data dba:  0x01800084  --------------------------------------------------------   Second Level Bitmap block DBAs    --------------------------------------------------------   DBA 1:   0x01800082

Zone 0 the first L1 is 0x01800080 the first non-Metadata data block is 0x01800084
During full Oracle scanning, the dba search area is followed by "Data DBA. However, there is no area length, so the map information of the area above is still to be read.

Related Article

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.