邏輯表空間管理結構(Logical Storage Structures)
Logical Storage Hierarchy
邏輯儲存層級Figure 12-2 shows the relationships among data blocks, extents, and segments within a tablespace. In this example, a segment has two extents stored in different data files.
圖12-2顯示了表空間在資料塊,區和段之間的關係,例如,一個段有兩個區被儲存在不同的資料檔案上。
Figure 12-2 Segments, Extents, and Data Blocks Within a Tablespace
This graphic depicts the relationship between a Tablespace, Segment, Datafiles, Extents, and Data Blocks.
The tablespace holds one Segment of 96 Kb. The segment is divided into one extent of 24 Kb and another of 72 Kb, each of which is in a separate datafile. The 72 Kb extent maps to 12 rows of 2 Kb blocks, with 3 2 Kb blocks in each row. The 24 Kb extent maps to 12 2 Kb blocks.
這張圖描述Lee表空間、段、資料檔案、區和資料塊之間的關係。表空間擁有的一個96KB的段,這個段被分成了一個24KB的區和一個72KB的區,每一個都是區分屬於一個單獨的資料檔案,72KB的區對映成了12行每行3個2KB的塊。24KB的區對映成了一個12行每行一個2KB的塊。
At the finest level of granularity, Oracle Database stores data in data blocks. One logical data block corresponds to a specific number of bytes of physical disk space, for example, 2 KB. Data blocks are the smallest units of storage that Oracle Database can use or allocate.
orale存放資料的最小單位是資料塊。一個邏輯的資料塊與指定數量的物理磁碟空間是一致的,例如,2KB的資料塊是oracle資料庫能夠使用的最小的儲存單位。
An extent is a set of logically contiguous data blocks allocated for storing a specific type of information. In Figure 12-2, the 24 KB extent has 12 data blocks, while the 72 KB extent has 36 data blocks.
一個區是邏輯相鄰的被分配用來執行指定型別資訊的資料塊的集合。在圖12-2中,24KB的區有12個資料塊,而72KB的區有36個資料塊。
A segment is a set of extents allocated for a specific database object, such as a table. For example, the data for the employees table is stored in its owndata segment, whereas each index for employees is stored in its own index segment. Every database object that consumes storage consists of a single segment.
段是被分配儲存指定資料庫物件的區的集合,例如表。例如,employees表的資料被儲存在他自己的資料段中,而每個employees的索引都被儲存在他自己的索引段中,每個消耗儲存的資料庫物件都是有單個的段構成的。
Each segment belongs to one and only one tablespace. Thus, all extents for a segment are stored in the same tablespace. Within a tablespace, a segment can include extents from multiple data files, as shown in Figure 12-2. For example, one extent for a segment may be stored in users01.dbf, while another is stored in users02.dbf. A single extent can never span data files.
每個段只屬於一個表空間,因此,所有的區都被儲存在相同的表空間中,在表空間中,段可以包含多個資料檔案的區,就像12-2中顯示的那樣,例如,一個段的區或許被儲存在users01.dbf中,而另外一個區被儲存在users02.dbf中。單個的區只能在一個datafile中。
Logical Space Management
oracle必須使用邏輯的空間管理去追蹤和分配表空間的區。當一個資料庫物件需要一個區,資料庫逆序有發現和提供它的方法,同樣的,當一個物件不再需要一個區,資料庫必須有方法釋放這個區。
Oracle Database manages space within a tablespace based on the type that you create. You can create either of the following types of tablespaces:
oracle資料庫根據建立表空間的型別管理空間。可以建立下列空間型別中的任一種:
-
Locally managed tablespaces (default)
本地管理的表空間(預設)The database uses bitmaps in the tablespaces themselves to manage extents. Thus, locally managed tablespaces have a part of the tablespace set aside for a bitmap. Within a tablespace, the database can manage segments with automatic segment space management (ASSM) or manual segment space management (MSSM).
-
Dictionary-managed tablespaces
基於字典管理的表空間The database uses the data dictionary to manage extents
Figure 12-3 shows the alternatives for logical space management in a tablespace.
表12-3顯示了兩種表空間的邏輯管理方式
Locally Managed Tablespaces
A locally managed tablespace maintains a bitmap in the data file header to track free and used space in the data file body. Each bit corresponds to a group of blocks. When space is allocated or freed, Oracle Database changes the bitmap values to reflect the new status of the blocks.本地管理的空間會在資料檔案的頭部維護點陣圖去追蹤資料檔案體部的空間是空還是非空。每一點都會對應一組塊。當空間被分配或是被釋放,oracle會改變點陣圖的值去反應塊的一個最新的狀態。
The following graphic is a conceptual representation of bitmap-managed storage. A 1 in the header refers to used space, whereas a 0 refers to free space.
下個圖是一個點陣圖管理儲存的概念圖。頭部的1代表已被用的空間,而0代表的是不用的空間。
This graphic shows a data file with the following numbers in its header: 1 0 0 1 0 1. The data file contains three rows of extents. The first five blocks are mostly full; the second 7 blocks are mostly empty; the next 7 blocks are mostly empty; the next 5 blocks are mostly full; the next 4 blocks are mostly empty; the next 8 blocks are mostly full.
這個圖顯示了資料檔案頭部的number號:1 0 0 1 0 1。
資料檔案包含了三行的區。前五個塊是滿的,後7個塊是空的;下一行的7個塊是空的,後五個塊是滿的,下4個塊是空的,下8個塊是滿的。
A locally managed tablespace has the following advantages:
-
Avoids using the data dictionary to manage extents
Recursive operations can occur in dictionary-managed tablespaces if consuming or releasing space in an extent results in another operation that consumes or releases space in a data dictionary table or undo segment.
避免使用資料字典去管理區
在基於字典管理的表空間,如果佔用或是釋放區的空間會導致資料字典表和undo段的空間的佔用和釋放
-
Tracks adjacent free space automatically
In this way, the database eliminates the need to coalesce free extents.
這樣的話,資料庫會評估需要整合的空閒區
-
Determines the size of locally managed extents automatically
Alternatively, all extents can have the same size in a locally managed tablespace and override object storage options.
作為一種選擇,所有的在本地管理的表空的區都會有相同的大小並且覆蓋物件儲存的選項。
note:
Oracle strongly recommends the use of locally managed tablespaces with Automatic Segment Space Management.
oracle強烈推薦使用本地管理的ASSM的表空間,oracle強烈推薦
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29802484/viewspace-1870677/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle的邏輯結構(表空間、段、區間、塊)——表空間Oracle
- 資料庫邏輯結構:表空間、段、區、塊的字典資料庫
- Oracle的邏輯結構(表空間、段、區間、塊)——Oracle資料塊(二)Oracle
- Oracle 19c Concepts(12):Logical Storage StructuresOracleStruct
- InnoDB的邏輯儲存結構是什麼,表空間組成包括哪些?
- dataguard之邏輯備庫表空間不足
- Physical Storage StructuresStruct
- 本地管理表空間的bitmap結構測試
- 擴充套件邏輯卷空間套件
- PostgreSQL:邏輯結構SQL
- oracle 邏輯結構Oracle
- innodb表空間儲存結構
- LVM(logical volume manager) 邏輯卷管理器LVM
- lvm收縮邏輯卷空間LVM
- Oracle的UNDO表空間管理總結Oracle
- oracle的邏輯結構Oracle
- 【TABLESPACE】Oracle 表空間結構說明Oracle
- Oracle基礎結構之表空間Oracle
- Linux LVM Logical Volume Management 邏輯卷的管理LinuxLVM
- 將字典管理表空間轉換為本地管理表空間
- Oracle表空間管理Oracle
- Oracle 表空間管理Oracle
- ASM表空間管理ASM
- SQL Server中TempDB管理(version store的邏輯結構)SQLServer
- 3:Oracle體系結構(邏輯結構)Oracle
- 管理表空間(表空間的屬性)轉貼
- 表空間管理之bigfile表空間設定
- 遷移SYSTEM表空間為本地管理表空間
- Oracle 本地表空間管理與字典表空間管理Oracle
- Oracle OCP(41):邏輯結構Oracle
- [zt] Oracle的邏輯結構Oracle
- Oracle 邏輯結構簡介Oracle
- Linux 系統 LVM(Logical Volume Manager)邏輯卷管理LinuxLVM
- LVM(logical volume manager) 邏輯卷管理器(轉帖)LVM
- 達夢表空間管理注意事項總結
- Oracle undo 表空間管理Oracle
- Oracle 表空間的管理Oracle
- oracle undo表空間管理Oracle