Rumah pangkalan data tutorial mysql Oracle的datablock的结构

Oracle的datablock的结构

Jun 07, 2016 pm 05:12 PM

先摘录一下官方文档,回头在弄一个dump的内容验证一下。 一、data block的格式 Data Block Format The Oracle data block format

先摘录一下官方文档,回头在弄一个dump的内容验证一下。

一、data block的格式

Data Block Format

The Oracle data block format is similar regardless of whether the data block contains table, index, or clustered data. Figure 2-2illustrates the format of a data block.

Figure 2-2 Data Block Format


Description of "Figure 2-2 Data Block Format"

Header (Common and Variable)

The header contains general block information, such as the block address and the type of segment (for example, data or index).

Table Directory

This portion of the data block contains information about the table having rows in this block.

Row Directory

This portion of the data block contains information about the actual rows in the block (including addresses for each row piece in the row data area).

After the space has been allocated in the row directory of a data block's overhead, this space is not reclaimed when the row is deleted. Therefore, a block that is currently empty but had up to 50 rows at one time continues to have 100 bytes allocated in the header for the row directory. Oracle reuses this space only when new rows are inserted in the block.

Overhead

The data block header, table directory, and row directory are referred to collectively as overhead. Some block overhead is fixed in size; the total block overhead size is variable. On average, the fixed and variable portions of data block overhead total 84 to 107 bytes.

Row Data

This portion of the data block contains table or index data. Rows can span blocks.

 

======== 顺便提了一下行链接和行迁移。

Row Chaining and Migrating

In two circumstances, the data for a row in a table may be too large to fit into a single data block. In the first case, the row is too large to fit into one data block when it is first inserted. In this case, Oracle stores the data for the row in a chain of data blocks (one or more) reserved for that segment. Row chaining most often occurs with large rows, such as rows that contain a column of datatype LONG or LONG RAW. Row chaining in these cases is unavoidable.

However, in the second case, a row that originally fit into one data block is updated so that the overall row length increases, and the block's free space is already completely filled. In this case, Oracle migrates the data for the entire row to a new data block, assuming the entire row can fit in a new block. Oracle preserves the original row piece of a migrated row to point to the new block containing the migrated row. The rowid of a migrated row does not change.

When a row is chained or migrated, I/O performance associated with this row decreases because Oracle must scan more than one data block to retrieve the information for the row.

 

二、记录的格式

Row Format and Size

Oracle stores each row of a database table containing data for less than 256 columns as one or more row pieces. If an entire row can be inserted into a single data block, then Oracle stores the row as one row piece. However, if all of a row's data cannot be inserted into a single data block or if an update to an existing row causes the row to outgrow its data block, then Oracle stores the row using multiple row pieces. A data block usually contains only one row piece for each row. When Oracle must store a row in more than one row piece, it is chained across multiple blocks.

When a table has more than 255 columns, rows that have data after the 255th column are likely to be chained within the same block. This is called intra-block chaining. A chained row's pieces are chained together using the rowids of the pieces. With intra-block chaining, users receive all the data in the same block. If the row fits in the block, users do not see an effect in I/O performance, because no extra I/O operation is required to retrieve the rest of the row.

Each row piece, chained or unchained, contains a row header and data for all or some of the row's columns. Individual columns can also span row pieces and, consequently, data blocks. Figure 5-3 shows the format of a row piece:

Figure 5-3 The Format of a Row Piece


Description of "Figure 5-3 The Format of a Row Piece"

The row header precedes the data and contains information about:

  • Row pieces

  • Chaining (for chained row pieces only)

  • Columns in the row piece

  • Cluster keys (for clustered data only)

  • A row fully contained in one block has at least 3 bytes of row header. After the row header information, each row contains column length and data. The column length requires 1 byte for columns that store 250 bytes or less, or 3 bytes for columns that store more than 250 bytes, and precedes the column data. Space required for column data depends on the datatype. If the datatype of a column is variable length, then the space required to hold a value can grow and shrink with updates to the data.

    To conserve space, a null in a column only stores the column length (zero). Oracle does not store data for the null column. Also, for trailing null columns, Oracle does not even store the column length.

    Kenyataan Laman Web ini
    Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn

    Alat AI Hot

    Undresser.AI Undress

    Undresser.AI Undress

    Apl berkuasa AI untuk mencipta foto bogel yang realistik

    AI Clothes Remover

    AI Clothes Remover

    Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

    Undress AI Tool

    Undress AI Tool

    Gambar buka pakaian secara percuma

    Clothoff.io

    Clothoff.io

    Penyingkiran pakaian AI

    AI Hentai Generator

    AI Hentai Generator

    Menjana ai hentai secara percuma.

    Artikel Panas

    R.E.P.O. Kristal tenaga dijelaskan dan apa yang mereka lakukan (kristal kuning)
    2 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
    Repo: Cara menghidupkan semula rakan sepasukan
    4 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island Adventure: Cara mendapatkan biji gergasi
    4 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌

    Alat panas

    Notepad++7.3.1

    Notepad++7.3.1

    Editor kod yang mudah digunakan dan percuma

    SublimeText3 versi Cina

    SublimeText3 versi Cina

    Versi Cina, sangat mudah digunakan

    Hantar Studio 13.0.1

    Hantar Studio 13.0.1

    Persekitaran pembangunan bersepadu PHP yang berkuasa

    Dreamweaver CS6

    Dreamweaver CS6

    Alat pembangunan web visual

    SublimeText3 versi Mac

    SublimeText3 versi Mac

    Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

    Kurangkan penggunaan memori MySQL di Docker Kurangkan penggunaan memori MySQL di Docker Mar 04, 2025 pm 03:52 PM

    Artikel ini meneroka mengoptimumkan penggunaan memori MySQL di Docker. Ia membincangkan teknik pemantauan (statistik Docker, skema prestasi, alat luaran) dan strategi konfigurasi. Ini termasuk had memori docker, swapping, dan cgroups, bersama -sama

    Cara menyelesaikan masalah MySQL tidak dapat membuka perpustakaan bersama Cara menyelesaikan masalah MySQL tidak dapat membuka perpustakaan bersama Mar 04, 2025 pm 04:01 PM

    Artikel ini menangani ralat "tidak dapat membuka perpustakaan kongsi" MySQL. Isu ini berpunca daripada ketidakupayaan MySQL untuk mencari perpustakaan bersama yang diperlukan (.so/.dll fail). Penyelesaian melibatkan mengesahkan pemasangan perpustakaan melalui pakej sistem m

    Bagaimana anda mengubah jadual di MySQL menggunakan pernyataan Alter Table? Bagaimana anda mengubah jadual di MySQL menggunakan pernyataan Alter Table? Mar 19, 2025 pm 03:51 PM

    Artikel ini membincangkan menggunakan pernyataan jadual Alter MySQL untuk mengubah suai jadual, termasuk menambah/menjatuhkan lajur, menamakan semula jadual/lajur, dan menukar jenis data lajur.

    Jalankan MySQL di Linux (dengan/tanpa bekas podman dengan phpmyadmin) Jalankan MySQL di Linux (dengan/tanpa bekas podman dengan phpmyadmin) Mar 04, 2025 pm 03:54 PM

    Artikel ini membandingkan memasang MySQL pada Linux secara langsung berbanding menggunakan bekas podman, dengan/tanpa phpmyadmin. Ia memperincikan langkah pemasangan untuk setiap kaedah, menekankan kelebihan Podman secara berasingan, mudah alih, dan kebolehulangan, tetapi juga

    Apa itu SQLite? Gambaran Keseluruhan Komprehensif Apa itu SQLite? Gambaran Keseluruhan Komprehensif Mar 04, 2025 pm 03:55 PM

    Artikel ini memberikan gambaran menyeluruh tentang SQLite, pangkalan data relasi tanpa server tanpa mandiri. Ia memperincikan kelebihan SQLITE (kesederhanaan, mudah alih, kemudahan penggunaan) dan kekurangan (batasan konkurensi, cabaran skalabiliti). C

    Menjalankan Pelbagai Versi MySQL di MacOS: Panduan Langkah demi Langkah Menjalankan Pelbagai Versi MySQL di MacOS: Panduan Langkah demi Langkah Mar 04, 2025 pm 03:49 PM

    Panduan ini menunjukkan pemasangan dan menguruskan pelbagai versi MySQL pada macOS menggunakan homebrew. Ia menekankan menggunakan homebrew untuk mengasingkan pemasangan, mencegah konflik. Pemasangan Butiran Artikel, Permulaan/Perhentian Perkhidmatan, dan PRA Terbaik

    Bagaimana saya mengkonfigurasi penyulitan SSL/TLS untuk sambungan MySQL? Bagaimana saya mengkonfigurasi penyulitan SSL/TLS untuk sambungan MySQL? Mar 18, 2025 pm 12:01 PM

    Artikel membincangkan mengkonfigurasi penyulitan SSL/TLS untuk MySQL, termasuk penjanaan sijil dan pengesahan. Isu utama menggunakan implikasi keselamatan sijil yang ditandatangani sendiri. [Kira-kira aksara: 159]

    Apakah beberapa alat GUI MySQL yang popular (mis., MySQL Workbench, phpmyadmin)? Apakah beberapa alat GUI MySQL yang popular (mis., MySQL Workbench, phpmyadmin)? Mar 21, 2025 pm 06:28 PM

    Artikel membincangkan alat MySQL GUI yang popular seperti MySQL Workbench dan PHPMyAdmin, membandingkan ciri dan kesesuaian mereka untuk pemula dan pengguna maju. [159 aksara]

    See all articles