Oracle-Data Block

Source: Internet
Author: User

Basic Relationship: Database---Table space---data segment---partition---data block


Data block
Block Block is the smallest unit of data information that Oracle stores. This is the smallest unit in the Oracle environment. Oracle is also a block of data to block differences in the storage structure of different operating systems. Whether it is a Windows environment or a unix/linux environment, their operating system storage structure and manner, even the way the characters are arranged are different. Oracle uses data blocks to mask these differences, and all data operations take action on the Oracle block, which is equivalent to a level of abstraction.

In fact, all Oracle's operations and spatial allocation of data are actually for block blocks. We search for a row from the data table, and in reality Oracle reads the block of data from the memory buffer (or hard disk) to that row, and then returns the specified row of data on that block. The small unit of data manipulation, whether in the buffer or on the hard disk, is the data block.

Third, the data block is the size, when a database is established, the parameters are set. Note that in Oracle database parameters, only the data block size parameters are not modified after the library is built. the size of the data block, in a database can support multiple, but generally not much significance, will give management and debugging a certain burden.

the size of the data block is an integer multiple of the operating system's data block, and Oracle defaults to 8K and several 4k,16k,32k. The size of the data block is set according to the different types of systems. If the data block settings are large, then there are more rows of data to be read at one time, the corresponding to the SGA memory consumption is relatively large, the specific query-induced swap-out may be more. If the settings are too small, frequent IO logical physical reads can also cause performance problems.
-----The relevant parameter is Db_block_size, view the block size.
Sql>show parameter db_block_size;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Db_block_size integer 8192//1024x8
Note:
1, db_block_size as the minimum operating unit of the database, is specified when the database is created, after the database is created can not be modified.to modify the db_block_size, you need to rebuild the database. It is generally possible to exp the data, then rebuild the database, specify the new db_block_size, and then imp the data into the database.
2, Db_block_size is generally set as a multiple of the operating system block, that is, 2k,4k,8k,16k or 32K, but its size is generally affected by database use. For online transactions, it is characterized by a large transaction volume, but the amount of data per transaction is small, so db_block_size set the dot is enough, generally 4K or 8K, set too big a read out of the data is partially useless, will slow down the database reading and writing time, while adding unnecessary IO operations. And for the data Warehouse and ERP applications, each transaction processing data is very large, so db_block_size general settings are relatively large, generally 8k,16k or 32K, at this time if db_block_size small, then I/O naturally more, consumption is too large.
3, a little bit of db_block_size on the performance of the index has improved a certain extent. Because Db_block_size is relatively large, a db_block can index more rows at a time.
4, for the row relatively big words, such as a db_block put not a row, the database when reading data need to do row link, thus affecting read performance. This can be avoided by db_block_size larger words at this time.

Initialization parameter db_file_multiblock_read_count is used to constrain the behavior of Oracle for multi-block reads, so-called multi-block reads, that is, when Oracle can read multiple blocks of data at one time I/O, it completes the reading of the data with minimal I/O.
Db_file_multiblock_read_count settings are affected by the OS's maximum IO capability, which means that if your system has limited hardware IO capabilities, even large db_file_multiblock_read_count can be useless.
------Initialize the parameter db_file_multiblock_read_count to see the read of the I/O completion data.
Sql>show parameter db_file_multiblock_read_count;
NAME TYPE VALUE
-------------------------------------------------------
Db_file_multiblock_read_count Integer 32

Sql>alter session set DB_FILE_MULTIBLOCK_READ_COUNT=256;
The session has changed.

Sql>show parameter db_file;
NAME TYPE VALUE
-----------------------------------------------------
Db_file_multiblock_read_count Integer 128


Oracle-Data Block

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.