|
Oracle数据库如何保存表数据? |
Oracle Database uses a data segment in a tablespace to hold table data. Oracle 数据库使用表空间中的数据段保存表数据。 As explained in "User Segments", a segment contains extents made up of data blocks. 如"用户段"所述,段包含由数据块组成的扩展盘区。
The data segment for a table (or cluster data segment, when dealing with a table cluster) is located in either the default tablespace of the table owner or in a tablespace named in the CREATE TABLE statement. 表数据段(或涉及表簇时的簇数据段)位于表所有者的默认空间中,或CREATE TABLE 语句中所指定的表空间中。 |
||||||||||||||||||||||||||||
|
表空间、段、区、块的关系 |
|
||||||||||||||||||||||||||||
|
表空间tablespace |
– 表空间—表(索引,分区..)
– 表空间—段—extent—block –data file
|
||||||||||||||||||||||||||||
|
段segment |
|
||||||||||||||||||||||||||||
|
区extent |
|
||||||||||||||||||||||||||||
|
块block |
|
Table Organization表组织
|
表如何组织数据? ——堆 堆组织表? ——无序的行的集合 添加行时,数据的位置? ——放置在数据段中第一个可用空间空间. |
By default, a table is organized as a heap, which means that the database places rows where they fit best rather than in a user-specified order. 默认情况下,表按 堆的形式来组织数据,这意味着数据库将行存放在最适合他们的位置,而不是按用户指定的顺序来存放。 Thus, a heap-organized table is an unordered collection of rows. 因此,堆组织表是一个无序的行的集合。 As users add rows, the database places the rows in the first available free space in the data segment. Rows are not guaranteed to be retrieved in the order in which they were inserted. 当用户往其中添加行时,数据库将行置于在数据段中第一个可用的空闲空间。不能保证行按照插入它们的顺序进行检索。 |
|
Column order? ——列顺序对行都是相同的 例外? |
The column order is the same for all rows in a table. 列的顺序对于表中的所有行都是相同的。 The database usually stores columns in the order in which they were listed in the CREATE TABLE statement, but this order is not guaranteed. For example, if a table has a column of type LONG, then Oracle Database always stores this column last in the row. Also, if you add a new column to a table, then the new column becomes the last column stored. 通常,数据库按它们被列在CREATE TABLE 语句中的列顺序来存储列,但这个顺序是不保证的。 例如,如果表中有 LONG 类型的列,那么数据库总是将其存储到行中的最后一列。此外,如果向表中添加一个新列,则新列将被存储为最后一列 |
|
Virtual column
|



