[Algorithm for maximum data file size supported by tablespace] [database limit] [data file

Source: Internet
Author: User
Tags types of tables
When db_block_size is set to different sizes in the local tablespace, the reserved data file header space is as follows :--?? Db_block_size2KB. the file header contains 32 data blocks, that is, 64KB. Db_block_size4KB. the file header contains 16 data blocks, that is, 64KB. Db_block_size8KB. the file header contains 8 data blocks, that is, 64KB. Db_block_s

When db_block_size is set to different sizes in the local tablespace, the reserved data file header space is as follows :--?? Db_block_size = 2 kb. the file header contains 32 data blocks, that is, 64 KB. 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_s

When db_block_size is set to different sizes in the local tablespace, the reserved data file header space is as follows :--??

Db_block_size = 2 kb. the file header contains 32 data blocks, that is, 64 KB.
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 ???

Extent management local uniform size 256 K -- allocate each extent with a minimum size of K blocks and a minimum size of 8.

Is each extent allocated with at least X blocks? Assume that db_block_size = 16 KB, and the file header retains 4 data blocks, that is, 64 KB.

4 M <= X * 64 k * 8

X> = 8

-- Each data file has a maximum of 4 MB blocks. Each bit in the reserved data block indicates the Usage Status of X blocks, and the data block needs to be stored in a status of 4 MB.

The maximum data file size supported by the tablespace algorithm:

In two cases: the ROWID record of smallfile tablespace and bigfile tablespacesmallfile tablespace stores the database object, the data file (file #), 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. -- 1 Byte = 8bit
Each group of characters represents a different meaning. The 18-bit maximum addressing space is "32 GB ".. --??
Parsing a row ID: OOOOOO. FFF. BBBBBB. RRR -- rowid structure 6-3-6-3
OOOOOO: 1-6 bits: Object id -- generally referred to as segment number
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
Max. Algorithm Remarks Lab Test
Maximum number of files in a tablespace 2 ^ 10 [1 K] Remove all 0 1023
Maximum number of data blocks per data file 2 ^ 22-1 [4 M] Remove all 0 4194304
Number of rows per BLOKC 2 ^ 16 [64 k] Remove all 0
Maximum number of database objects 2 ^ 32 [4G] Remove all 0

Each database can contain up to 64 K data files and a maximum of 64 K tablespaces, because each tablespace must contain at least one data file. -- How to calculate it ??

--The official document is 65533.

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 --??

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.

For Base64 encoding, a total of 18 bits represent the number of 80 bits. The calculation method is as follows:

32bit obj # + 32 bitfile & block # + 16bit row #

In this way, large file tablespace data files supportMaximum number of blocks: 2 ^ 32 = 4G.

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 = 32KB, 32KB * 4 M = 131072 M 128G bigfile tablespace set the maximum size allowed by the data file db_block_size = 2KB, 2KB * 4G = 8 T for different sizes of db_block_size
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.