标签:
在数据库的逻辑结构中,表空间将不同类型的数据分别组织在一起,如系统数据、用户数据、临时数据、回滚数据等。
在同一个表空间中,数据以数据库对象为单位组织在一起,一般情况下一个数据库对象对应一个段,一个表空间中包含多个段。
在段中存储数据库对象中的数据,数据所占用的存储空间以区为单位进行分配和回收。
一个数据库对象占用若干个区,所以段是由若干个区组成的。
当为数据库对象分配存储空间时,一次分配一个或多个区。
区是分配和回收存储空间的基本单位,一个区是由若干个连续的数据块组成的。
数据块是逻辑结构中的最小存储单位,是Oracle读写数据的基本单位。
当用户访问数据时,服务器进程首先将数据从数据块读到数据库高速缓存中,并存储在与数据块大小相同的缓冲区中,然后在缓冲区中对数据进行读写。
数据库中的数据在物理上是存储在磁盘上的,需要占用一定的操作系统块。
一个数据块是由若干个操作系统块组成的,因此,数据块的大小是操作系统块的整数倍。
数据库服务器对数据块的读写最终将转化为对多个操作系统块的读写。
段的管理
在表空间中,一个段一般代表一个数据库对象,对象的所有数据都存储在对应的段中。
一般情况下段不需要用户自己创建,在创建数据库对象将自动产生段。
为段所分配的空间就位于表空间的数据文件中,这些存储空间由若干个区组成。
段、区和数据块之间的关系如图所示。
段的类型
Oracle 11g支持10余种类型的段。
通过查询数据字典dba_segments ,可以得到当前数据库中已经存在的段类型。
下面是有关数据字典dba_segments的相关信息:
DBA_SEGMENTS
describes the storage allocated for all segments in the database.
Related View
USER_SEGMENTS
describes the storage allocated for the segments owned by the current user‘s objects. This view does not display the OWNER
, HEADER_FILE
, HEADER_BLOCK
, or RELATIVE_FNO
columns.
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Username of the segment owner |
|
|
|
Name, if any, of the segment |
|
|
|
Object Partition Name (Set to |
|
|
|
Type of segment:
|
|
|
|
Subtype of LOB segment: |
|
|
|
Name of the tablespace containing the segment |
|
|
|
ID of the file containing the segment header |
|
|
|
ID of the block containing the segment header |
|
|
|
Size, in bytes, of the segment |
|
|
|
Size, in Oracle blocks, of the segment |
|
|
|
Number of extents allocated to the segment |
|
|
|
Size in bytes requested for the initial extent of the segment at create time. (Oracle rounds the extent size to multiples of 5 blocks if the requested size is greater than 5 blocks.) |
|
|
|
Size in bytes of the next extent to be allocated to the segment |
|
|
|
Minimum number of extents allowed in the segment |
|
|
|
Maximum number of extents allowed in the segment |
|
|
|
Maximum number of blocks allowed in the segment |
|
|
|
Retention option for |
|
|
|
Minimum retention duration for |
|
|
|
Percent by which to increase the size of the next extent to be allocated |
|
|
|
Number of process freelists allocated to this segment |
|
|
|
Number of freelist groups allocated to this segment |
|
|
|
Relative file number of the segment header |
|
|
|
Buffer pool to be used for segment blocks:
|
|
|
|
Database Smart Flash Cache hint to be used for segment blocks:
Solaris and Oracle Linux functionality only. |
|
|
|
Cell flash cache hint to be used for segment blocks:
See Also: Oracle Exadata Storage Server Software documentation for more information |
|
|
|
Indicates whether the In-Memory Column Store (IM column store) is enabled ( |
|
|
|
Indicates the priority for In-Memory Column Store (IM column store) population:
|
|
|
|
Indicates how the IM column store is distributed in an Oracle Real Application Clusters (Oracle RAC) environment:
|
|
|
|
Indicates the duplicate setting for the IM column store in an Oracle RAC environment:
|
|
|
|
Indicates the compression level for the IM column store:
|
例如:
标签:
原文地址:http://www.cnblogs.com/jy627625/p/5576694.html