Principles of in-depth analysis of Oracle data blocks

2010-12-27  来源:本站原创  分类:Database  人气:100 

Turn http://www.bitscn.com/pdb/oracle/200904/160356.html
Principles of in-depth analysis of Oracle data blocks data blocks (Oracle Data Blocks), the paper referred to as the "block" is the smallest unit of storage Oracle, Oracle data is stored in "block" in the. A block occupied by some disk space. Special attention is paid, where the "block" is Oracle's "data blocks", not the operating system "block."
Oracle time for each request, are in blocks. In other words, Oracle data per request is a multiple of the block. If Oracle is less than a piece of data requested, Oracle will read the entire block. Therefore, the "block" is the smallest unit of data in Oracle or read the basic unit.
The standard block size specified by the initialization parameter DB_BLOCK_SIZE. The size of the blocks with a standard known as standard block (Standard Block). The standard block size and the size of the block is called non-standard blocks of different block (Nonstandard Block). The same database, Oracle9i and above support both the same database using the standard blocks and non-standard block. Oracle allows you to specify five kinds of non-standard blocks (Nonstandard Block).
Each time the operating system I / O, when the operating system is based on the block as a unit; Oracle each execution of the I / O time, are based on Oracle's block as a unit.
Oracle data block size is generally a multiple operating system blocks.
The format of the data block (Data Block Format)
Block of data stored in the table and index data, regardless of what type of data stored, the format is the same block, block by the block header (header / Common and Variable), Table catalog (Table Directory), line catalog (Row Directory ), free space (Free Space) and the row of data (Row Data) of five parts,
As shown below.

Principles of in-depth analysis of Oracle data blocks

Block header (header / Common and Variable): the basic information storage block, such as: the physical address of the block, the block belongs to the type of segment (a segment or index segment.)
Table catalog (Table Directory): store the table information, that is: if some form of data is stored in the block, then the information about these tables will be stored in the "Table directory".
Line catalog (Row Directory): If there are rows of data block exists, then, these lines of information will be recorded line directory. This information includes the address line.
Rows of data (Row Data): a real table data and index data stored in the place. This part of the space is already occupied by rows of space.
Free space (Free Space): a block of free space is not used in the region, this area used to insert new rows and update rows that already exist.
Header information area (Overhead): We block header (header / Common and Variable), Table catalog (Table Directory), line catalog (Row Directory) together known as the head of the three-part information area (Overhead). Header information area does not store data, store it in the entire block of information. Area the size of the header information is variable. In general, the header information of 84 bytes between the size (bytes) to 107 bytes (bytes) between.
Block the use of free space when inserted into the database (INSERT) data, the block in the free space will be reduced; When the block to modify existing rows (UPDATE) when (the record length increases), the block The free space will be reduced.
DELETE statement and the UPDATE statement causes the block of free space increase. When using the DELETE statement to delete records in the block or use the UPDATE statement to change the value of the column values into a smaller time, Oracle will release part of the free space. Released free space is not necessarily continuous. Normally, Oracle does not block the free space is not contiguous to merge. Because the combined data block is not contiguous free space will affect the performance of the database. Only when the user data into (INSERT) or update (UPDATE) operations, but can not find contiguous free space when, Oracle will merge the data block is not contiguous free space.
Free space for the block, Oracle offers two management practices: automatic management, manual links, and line management line migration (Row Chaining and Migrating)
Line link (Row Chaining): If we insert into the database (INSERT) line of data, this line of data so large that a whole block of data storage is not the next line, Oracle will be divided into paragraphs, there is a row of data into several data block, a process called line link (Row Chaining). As shown below:

Principles of in-depth analysis of Oracle data blocks

If the row of data is an ordinary line, this line of data can be stored in a data block; if the row is a link line, this line of data stored in multiple data blocks.
Bank Transfer (Row Migrating): a record exists in the data block, the user perform UPDATE Update this record, the UPDATE operation so that the variable-length record, this time, Oracle in the data block to find, but could not find be able to accommodate Under this record the space, desperation, Oracle only the whole row of data to a new data block. Retain the original data block of a "pointer", the "pointer" points to the new data block. This moved the record ROWID remains unchanged. The principle line of migration as shown below:

Principles of in-depth analysis of Oracle data blocks

Link line or lines, whether migration will affect the performance of the database. Oracle at the time to read such a record, Oracle will scan multiple data blocks, performs more I / O.
Block, Oracle automatically manage the free space bitmap (bitmap) to manage and track data blocks, this block of space management is called "automatic management." Automatic management of the following benefits:
Easy to use ◆ ◆ ◆ better use of space can be adjusted in real time on the space of free space block users can manually manage PCTFREE, PCTUSED to adjust the block, the use of space, the management approach called managed manually. Relative to the automatic management of cumbersome manual management is not easy to grasp, easy to cause a waste of space in the block.
PCTFREE parameter specifies the smallest block of free space must be retained percentage of cases. The reason to set aside this space, because the UPDATE, you need the space. If the UPDATE, there is no free space, Oracle will allocate a new block, which will produce the line migration (Row Migrating).
PCTUSED is also used to set a percentage, when the space has been used in the block is less than the percentage of the time, this block is marked as active. Only valid blocks are allowed into the data.

相关文章
  • Principles of in-depth analysis of Oracle data blocks 2010-12-27

    Turn http://www.bitscn.com/pdb/oracle/200904/160356.html Principles of in-depth analysis of Oracle data blocks data blocks (Oracle Data Blocks), the paper referred to as the "block" is the smallest unit of storage Oracle, Oracle data is stored i

  • Principle of in-depth analysis of Oracle data blocks 2010-12-27

    Turn http://www.bitscn.com/pdb/oracle/200904/160356.html Principle of in-depth analysis of Oracle data blocks data blocks (Oracle Data Blocks), article referred to as "block" is the smallest unit of storage in Oracle, Oracle data is stored in &q

  • Summary of the concept of Oracle data blocks 2011-02-24

    Oracle data within the logical storage Oracle stored data, the smallest particle size (finest level of granularity) is called the data block (data block) (also called logical block (logical block), Oracle block (Oracle block) or page (page)). A data

  • oracle data blocks of learning and learning trac file 2010-05-29

    Today, the oracle of the data blocks to learn relevant knowledge, and here again on analysis of documents under the trac, 1 Create a table: SQL> create table block_test 2 (id varchar2 (4) primary key, 3 name varchar2 (20)) 4 tablespace test; Table cr

  • If you look at Oracle data blocks and the operating system block size 2011-09-14

    1, in the command window, execute: SQL> show parameter db_block_size NAME TYPE VALUE ------------------------------------ ----------- --- --------------------------- db_block_size integer 8192 2, 2, executed in the SQL window: / / Query instance db_b

  • Oracle data dictionary concept collection 2010-09-02

    Oracle data dictionary concept collection oracle database system is a complex software system. If you do not understand the principles of its internal structure and relationships, we can not design and write high-quality application software system,

  • Summary of the concept of Oracle data block (original) 2011-02-22

    Oracle data within the logical storage Oracle stored data, the smallest particle size (finest level of granularity) is called the data block (data block) (also called logical block (logical block), Oracle block (Oracle block) or page (page)). A data

  • Detailed optimization of three Oracle data Yard: partition dimensions and materialized views 2011-08-05

    We are doing a database project, the optimization of the freight yard of the data, about the only two principles: First, the data block storage, easy data dump and discipline; two is one of the treatment, lack of progress, the speed of data supply. T

  • oracle data synchronization technology 2011-08-30

    Transfer from: http://easthome51905758.blog.163.com/blog/static/3824148320114421112268/ Based on Oracle database technology, data synchronization can be divided into two categories: Oracle to provide their own data synchronization technology and thir

  • Oracle data types and storage methods 2010-06-28

    Oracle data types and stored Yuan Guangdong original overview of an example, a comprehensive and thorough analysis of oralce basic data types and their storage methods. ORACLE 10G basis to introduce oralce 10g introduces new data types. Oracle data t

  • Oracle data dictionary of basic commands (2) 2010-08-04

    1, ORACLE startup and shutdown 1, the stand-alone environment To enable or disable the ORACLE system must first switch to the ORACLE user, as su - oracle a, start the ORACLE system oracle> svrmgrl SVRMGR> connect internal SVRMGR> startup SVRMGR&g

  • ORACLE data integrity check 2010-08-07

    oracle system provided a total of 5 and the following constraints: 1, non-empty (not null) constraint: defined columns can not be empty. 2, the only (unique) constraint: each row in the table as defined in this column or the value of these columns ca

  • Memcached depth analysis of the (transfer) 2010-09-11

    Memcached depth analysis of the (transfer) February 11, 2009 Read Comments comment Memcached is danga.com (operating LiveJournal's engineering team) development of a distributed memory object caching system, used in the dynamic system to reduce datab

  • Taobao Open Source Key / Value structure of Technical Analysis of the data storage system Tair (Reprinted) 2010-09-15

    Taobao Open Source Key / Value structure of Technical Analysis of the data storage system Tair On I just posted on at 12:00 on September 8, 2010 Tair Taobao independently developed by the Key / Value structure of data storage systems, Taobao has a la

  • [Transfer] MySQL garbled depth analysis 2010-09-29

    MySQL garbled depth analysis I. Overview The company purchased a number of new PC, for better performance of the PC to a few database server upgrade, replace old machines. POS terminal software companies have set, background data storage is a MySQL 3

  • Oracle data types and storage 2010-11-08

    The second part of the value type § 2.1 number Number types are oralce numeric type, the stored value of the accuracy can reach 38. Number is a variable-length type, a length of 0-22 bytes. Range: 10e-130 - 10e 126 (not included) Number (p, s) P and

  • Oracle data types and storage (2) 2010-11-08

    The second part of the value type § 2.1 number Number types are oralce numeric type, the stored value of the accuracy can reach 38. Number is a variable-length type, a length of 0-22 bytes. Range: 10e-130 - 10e 126 (not included) Number (p, s) P and

  • Depth analysis of the database, the hot block problem (latch: cache buffers chains) 2010-11-28

    The definition of hot block Database hot block, from the simple to tell, that is, within a very short time a small amount of data too often block access. Definition looks always very simple, but actually in the database, we are going to observed prob

  • [Transfer] [Flash / Flex] <What can you do with bytes ?> Chapter Section X: Analysis of binary data 2011-04-25

    http://bbs.9ria.com/thread-81262-1-1.html News Type: Translation from the page: http://www.bytearray.org/wp-content/projects/wcydwb/Chapter% 202% 20 -% 20Everyday% 20bytes.pdf Information Original title: <What can you do with bytes ?>-Parsing binary

  • Oracle data types and storage (a) the character type 2010-08-26

    Oracle data types and storage methods Overview by example, a comprehensive and in-depth analysis of oralce basic data types and their storage. To ORACLE 10G basis, introduce oralce 10g introduces new data types. Oracle data types allow you to have a