Database restrictions such as the size of the data file header, ROWID, and maximum size of the data file

Source: Internet
Author: User
Tags types of tables
Learn step-by-step ORACLE and official documentation from EYGLE. When db_block_size is set in the local tablespace, the reserved data file header space corresponds to db_block_size2KB. the file header retains 32 data blocks, that is, 64KB. Db_block_size4KB. the file header contains 16 data blocks, that is, 64KB. Db_block_size8KB, File Header

Learn step-by-step ORACLE and official documentation from EYGLE. When db_block_size is set in the local tablespace for management, the reserved data file header space corresponds to the following: db_block_size = 2KB. the file header retains 32 data blocks, that is, 64KB. Db_block_size = 4 kb. the file header contains 16 data blocks, that is, 64 KB. Db_block_size = 8 KB, file header Protection

Learn step-by-step ORACLE and official documentation from EYGLE.
When db_block_size is set in the local tablespace for management, the reserved data file header space corresponds to the following: db_block_size = 2KB. the file header retains 32 data blocks, that is, 64KB.
Db_block_size = 4 kb. the file header contains 16 data blocks, that is, 64 KB.
Db_block_size = 8 KB. the file header contains 8 data blocks, that is, 64 KB.
Db_block_size = 16 KB. the file header contains 4 data blocks, that is, 64 KB.
Db_block_size = 32 KB. the file header contains four data blocks, that is, kb.
The default value is db_block_size = 8 KB. The eight data blocks in the ORACLE Data File Header are used as follows:
Data blocks 1 and 2 record the data file header information. 3-8: used to record the bitmap information of the extent-range. The information must be retained to 128 blocks in 11G ???
################################

The maximum number of data files in Oracle databases is limited (usually 64 K files ). -- From official documents

The maximum data file size supported by the tablespace algorithm:

There are two scenarios: smallfile tablespace and bigfile tablespace.
The rowid record of the smallfile tablespace is stored in the data file #, the database object, and the row number in the data block. These attributes are combined to form the oracle rowid.
Oracle rowid is divided into physical ROWID and logical ROWID.
The index organization table (IOTs) uses the logical ROWID, while other types of tables use the physical ROWID.
ROWID can uniquely identify a record. Therefore, the ROWID value is stored in the index. You can access the index to obtain the ROWID and then locate the record.

ROWID is Base64 encoded. A total of 18 bits represent the number of 80 bits, occupying 10 bytes.
Each group of characters represents a different meaning. The 18-bit maximum addressing space is "32 GB "..
Resolution of a row ID: OOOOOO. FFF. BBBBBB. RRR -- here, it is manually added for convenience of viewing
OOOOOO: 1-6 bits: Object id
FFF: 7-9 bits: File id
BBBBBB: 10-15 digits: block id
RRR: 16-18 bits: Row id
For Base64 encoding, a total of 18 bits represent the number of 80 bits. The calculation method is as follows:
32bit obj # + 10bit file # + 22bit block # + 16bit row #
Calculate the information about the data block through ROWID, see: http://blog.csdn.net/q947817003/article/details/11490051
Based on the ROWID of the small file tablespace, the maximum number of tablespaces, data files, and BOOCK rows is calculated as follows:
According to the composition of ROWID: --- Note: 2 ^ 10 represents the 10th power of 2, equal to 1024.
Maximum number of files in each tablespace: 2 ^ 10 1024, remove all 0 and full 1, usually 1022 --- The number of tests is 1023.See the change example of the ORACLE Data File FILE_ID and RELATIVE_FNO when the number of data files exceeds 1024.
Maximum number of data blocks per data file: filesize = block_size * 2 ^ 22, that is, 4 m ORACLE Blocks

The number of rows per BLOKC is: 2 ^ 16 65536, that is, each BLOCK can have a maximum of 65536 records

Each database can contain up to 65536-64 K data files ---- The official document is 65533.-Http://docs.oracle.com/cd/B19306_01/server.102/b14237/limits002.htm#i287915), supports up to 64 K tablespaces, because each tablespace needs to contain at least one data file. New questions:If the database has more than 1024 data files, How Does ORACLE use ROWID to locate the data files?-- For details, see the change example of the ORACLE Data File FILE_ID and RELATIVE_FNO when the number of data files exceeds 1024.

For more detailed database restrictions, see the official documentation: http://docs.oracle.com/cd/B19306_01/server.102/b14237/limits.htm#REFRN004
When smallfile tablespace is set to db_block_size of different sizes, the maximum data file size allowed is db_block_size = 2KB, 2KB * 4 M = 8192 M 8G.
Db_block_size = 4 kb, 4 kb * 4 M = 16384 M 16G
Db_block_size = 8 KB, 8 KB * 4 M = 32768 M 32G 8*1024*4 M = 8*4G = 32G
Db_block_size = 16 KB, 16 KB * 4 M = 65536 M 64G
Db_block_size = 32 KB, 32 KB * 4 M = 131072 M 128G
######################################## #################
The rowid of the bigfile tablespace is not required in the ROWID because the large file tablespace can only contain one file.
The ROWID format of the large file tablespace is:
OOOOOO. LLLLLLLLL. RRR
OOOOOO: 1-6 bits: Object id
LLLLLLLLL: 7-15 digits: block id
RRR: 16-18 bits: Row id
L represents the BLOCK number, instead of the file # + block # In the ROWID of the small file tablespace.
In this way, large file tablespace data files support Maximum number of blocks: 2bit. 2 ^ 32 = 4G.
Bigfile tablespace: set the maximum size of the data file db_block_size = 2KB, 2KB * 4G = 8 T when db_block_size is different.
Db_block_size = 4KB, 4KB * 4G = 16 T
Db_block_size = 8 KB, 8 KB * 4G = 32 T 8*1024*4G = 8*4 TB = 32 TB
Db_block_size = 16 KB, 16 KB * 4G = 64 T
Db_block_size = 32KB, 32KB * 4G = 128 TB

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.