Structure of Oracle Data Rows

In order to save disk storage space, the Oracle system uses a special data row structure.

Oracle data rows are stored in data blocks, and each data block can store multiple data rows. Each data row is stored in a data block in the form of a variable-length record. Usually the columns in a row are stored in the order in which they are defined, and empty columns at the end are not stored. But non-ending empty columns require one byte of storage length.

Row header: used to store the number of columns in the row, link information and row lock status

Row data: consists of a series of column lengths and column values. For each column in a row of data, the Oracle server stores the length of the column and the actual value of the column.

Column length: The general column length requires one byte. But if the column length exceeds 250 bytes, the column length will be 3 bytes.

Column value: The actual value of the column is stored immediately after the column length bytes

For example, the length of the ENAME column in the EMP table under the scott user is 10 characters (bytes), and in the last row of column 10-1, the value of the ENAME column recorded with EMPNO 7902 is FORD, which is only 4 characters long. At this time, Oracle stores this column of the data row in this way: the column length is 4 and only one byte is occupied, the column value is only 4 bytes, and the total is only 5 bytes. From this example, we can see that Oracle's data storage is very compact.

There is also no space required between adjacent rows of data in an Oracle system. Each row in the data block has a slot in the row directory, this directory slot points to the starting address of the data row

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326526911&siteId=291194637