为什么 Oracle 数据库 block 和操作系统 block 的大小不同?我搜索了Oracle网站,但没有找到满意的答案。
最佳答案
数据库 block 是逻辑存储单元,操作系统 block 是物理存储单元。它们的大小不必不同,但只要逻辑 block 大小等于或大于物理 block 大小,并且是物理 block 大小的倍数,它们就可以不同。这使得 Oracle 能够检索最佳数量的数据,而不管底层硬件如何,因此可以提高效率并减少开销。
Data Blocks and Operating System Blocks
At the physical level, database data is stored in disk files made up of operating system blocks. An operating system block is the minimum unit of data that the operating system can read or write. In contrast, an Oracle block is a logical storage structure whose size and structure are not known to the operating system.
...
The database requests data in multiples of data blocks, not operating system blocks.
When the database requests a data block, the operating system translates this operation into a requests for data in permanent storage. The logical separation of data blocks from operating system blocks has the following implications:
Applications do not need to determine the physical addresses of data on disk.
Database data can be striped or mirrored on multiple physical disks.
If the database block size is different from the operating system block size, then ensure that the database block size is a multiple of the operating system block size.
...
A larger data block size provides greater efficiency in disk and memory I/O (access and storage of data). Therefore, consider specifying a block size larger than your operating system block size if the following conditions exist:
Oracle Database is on a large computer system with a large amount of memory and fast disk drives. For example, databases controlled by mainframe computers with vast hardware resources typically use a data block size of 4K or greater.
The operating system that runs Oracle Database uses a small operating system block size. For example, if the operating system block size is 1K and the default data block size matches this, the database may be performing an excessive amount of disk I/O during normal operation. For best performance in this case, a database block should consist of multiple operating system blocks.
关于oracle11g - Oracle 11g 数据库管理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19182866/