数据文件头块保留大小、ROWID、数据文件最大大小等数据库限制的
学习自EYGLE循序渐进ORACLE及官方文档。 本地管理表空间中设置不同大小的db_block_size时数据文件头保留空间对应如下: db_block_size=2KB,文件头保留32个数据块,即64KB。 db_block_size=4KB,文件头保留16个数据块,即64KB。 db_block_size=8KB,文件头保
学习自EYGLE循序渐进ORACLE及官方文档。本地管理表空间中设置不同大小的db_block_size时数据文件头保留空间对应如下:
db_block_size=2KB,文件头保留32个数据块,即64KB。db_block_size=4KB,文件头保留16个数据块,即64KB。
db_block_size=8KB,文件头保留8个数据块,即64KB。
db_block_size=16KB,文件头保留4个数据块,即64KB。
db_block_size=32KB,文件头保留4个数据块,即128KB。
默认是db_block_size=8KB,此时 ORACLE数据文件头的8个数据块作用是:
数据块1和2记录数据文件头信息。3-8用于记录extent-区间的位图信息 --11G中要保留到128个块???
################################
Oracle数据库中的数据文件的最大数量是有限的(通常为64K文件)。--来自官方文档
表空间支持的最大数据文件大小的算法:
分两种情况:smallfile tablespace与bigfile tablespacesmallfile tablespace的ROWID
记录存储所在数据文件(file#),所属数据库对象,所在数据块中的行号,这些属性合并起来构成了ORACLE ROWID.ORACLE ROWID分为物理ROWID,逻辑ROWID。
索引组织表(IOTs)使用逻辑ROWID,其它类型的表使用物理ROWID。
ROWID可以惟一标识一条记录,所以索引中存储了ROWID的值,通过访问索引,得到ROWID,再定位到记录。
ROWID采用Base64编码,共18位代表80位二进制数,占用10个字节。
每组字符代表不同的含义,18位最大寻址空间“32G”。。
对一条行ID的解析:OOOOOO.FFF.BBBBBB.RRR --其中.是为了方便观看手动增加
OOOOOO: 1-6位:对象id
FFF: 7-9位:文件id
BBBBBB: 10-15位:块id
RRR: 16-18位:行id
对于Base64编码,共18位代表80位二进制数,计算方法是:
32bit obj# + 10bit file# + 22bit block# + 16bit row#
通过ROWID计算数据块的相关信息,详见:http://blog.csdn.net/q947817003/article/details/11490051
根据small file tablespace的ROWID,计算出表空间、数据文件、BOOCK中行最大数如下:
根据ROWID的构成: ---注:2^10这种写法代表2的10次方,等于1024.
每个表空间最大文件数: 2^10 1024 ,去掉全0和全1 通常1022个 ---实验测试出是1023个,见:数据文件个数大于1024时ORACLE数据文件FILE_ID及RELATIVE_FNO的变化示例
每数据文件最大数据块数量:filesize=block_size*2^22 ,也就是4M个ORACLE BLOCK
每个BLOKC中行数是: 2^16 65536,也就是每个BLOCK最多65536条记录
每个数据库最多65536个-64K个数据文件(实验测试出是65534----官方文档上是65533-http://docs.oracle.com/cd/B19306_01/server.102/b14237/limits002.htm#i287915),最多支持64K个表空间,因为每个表空间最少需要包含一个数据文件。引出新问题:如果数据库有大于1024个数据文件,ORACLE如何通过ROWID定位数据文件呢?
--详见:数据文件个数大于1024时ORACLE数据文件FILE_ID及RELATIVE_FNO的变化示例
smallfile tablespace设置不同大小的db_block_size时数据文件允许的最大大小
db_block_size=2KB,2KB*4M=8192M 8Gdb_block_size=4KB,4KB*4M=16384M 16G
db_block_size=8KB,8KB*4M=32768M 32G 8*1024*4M=8*4G=32G
db_block_size=16KB,16KB*4M=65536M 64G
db_block_size=32KB,32KB*4M=131072M 128G
#########################################################
BIGFILE表空间的ROWID
因为大文件表空间只能包含一个文件,所以ROWID中不需要file#-文件ID。大文件表空间的ROWID格式为:
OOOOOO.LLLLLLLLL.RRR
OOOOOO: 1-6位:对象id
LLLLLLLLL: 7-15位:块id
RRR: 16-18位:行id
L代表BLOCK号,代替了小文件表空间中ROWID中的file# + block#的位置.
这样大文件表空间的数据文件支持的BLOCK数量最多是:2bit. 2^32=4G.
bigfile tablespace设置不同大小的db_block_size时数据文件允许的最大大小
db_block_size=2KB,2KB*4G= 8Tdb_block_size=4KB,4KB*4G= 16T
db_block_size=8KB,8KB*4G= 32T 8*1024*4G=8*4TB=32TB
db_block_size=16KB,16KB*4G= 64T
db_block_size=32KB,32KB*4G=128TB

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

The MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.

MySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.

SQL commands in MySQL can be divided into categories such as DDL, DML, DQL, DCL, etc., and are used to create, modify, delete databases and tables, insert, update, delete data, and perform complex query operations. 1. Basic usage includes CREATETABLE creation table, INSERTINTO insert data, and SELECT query data. 2. Advanced usage involves JOIN for table joins, subqueries and GROUPBY for data aggregation. 3. Common errors such as syntax errors, data type mismatch and permission problems can be debugged through syntax checking, data type conversion and permission management. 4. Performance optimization suggestions include using indexes, avoiding full table scanning, optimizing JOIN operations and using transactions to ensure data consistency.

InnoDB achieves atomicity through undolog, consistency and isolation through locking mechanism and MVCC, and persistence through redolog. 1) Atomicity: Use undolog to record the original data to ensure that the transaction can be rolled back. 2) Consistency: Ensure the data consistency through row-level locking and MVCC. 3) Isolation: Supports multiple isolation levels, and REPEATABLEREAD is used by default. 4) Persistence: Use redolog to record modifications to ensure that data is saved for a long time.

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

InnoDB effectively prevents phantom reading through Next-KeyLocking mechanism. 1) Next-KeyLocking combines row lock and gap lock to lock records and their gaps to prevent new records from being inserted. 2) In practical applications, by optimizing query and adjusting isolation levels, lock competition can be reduced and concurrency performance can be improved.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment