four.
How many
Free List
1. Master Free List or Segment Free List
Abbreviation for MFL, automatically generated when Segment is created, if we do not specify freeelists parameters when you create segment, or specify freelists = 1, all generate this MFL. MFL has only one for each segment (if Freelists> 1 is specified, it is not MFL, which will be explained in the Process Free List section). The MFL is equivalent to an idle space pool, and when a segment is created, the new Block is block and the new block of dynamic allocation to the MFL, all the space blocks in this pool are shared by all processes, and INSERT operations for this segment All processes may read this Free List, so when there are multiple processes to be insert data, it may appear on the MFL (MFL only allows one process to get a process for empty blocks, of course, In fact, the process of reading the empty block from the MFL is not simply needed, how much is needed, and after being inserted into the block directly into the block, the actual process is more complex, this process is in the process of requesting an air block process "Section will be described in detail). Thus, the concept of freeelist groups is launched, and the Freelist Groups parameter is set to be greater than 1 is set up multiple MFL, which is alleviated for MFL. More detailed content about FreeList Groups will be described in the "Super Master Free List" section.
2. Process Free List
If the process must read the empty block directly from the MFL, the contention of the MFL is solved by the Freelist Groups parameters (set multiple MFL), but it is clear that there is another idea to try not to let the process directly read MFL, no demand Naturally, it doesn't matter. This is the result of another level of Free List, which is the Process Free List, which is simply referred to as PFL. When we specify the storage parameter freeAlists> 1, the generated is PFL.
We have said that MFL is automatically generated when segment is created, so no matter whether there is PFL, there is still one MFL for each segment. That is, if we define Freelists equal to 2, then there will be a total of 3 freeelists in Segment Header Block, one of which is MFL, and 2 is PFL.
At this point, we can also verify through DUMP dump information.
Seg Lst :: flg: unused lhd: 0x00000000 LTL: 0x00000000
Seg Lst :: flg: unused lhd: 0x00000000 LTL: 0x00000000
Seg Lst :: flg: used lhd: 0x01c0008b LTL: 0x01C0008B
The back of the two Free List is both PFL, and one of the previous one is MFL.
As the name suggests, since it is named Process Free List, it is obvious that the idle blocks in this level of Free LIST can only be read by a process. Imagine, if the current system is up to 10 processes for a table, we set freeLists = 10, which will be able to use the free List for each process, undoubtedly Means we ease the contention of Free List.
Which PFL is used in a process, the algorithm inside the Oracle is: (p% NFL) 1 where P represents the Process ID of the DML operation process, which can be obtained from the V $ Process.PID field.
NFL represents the number of PFLs defined by freeAlists storage parameters.
There may be questions, if so, do you have multiple MFLs? Can we only need to set multiple PFLs? However, the fact is not the case, but please ask for a little, explain this problem in the "process request idle block process".
3. Transaction Free List
In Oracle's transaction is an important concept, each DML operation, the start of the transaction is automatic, and we can mark an end of a transaction through the COMMIT or ROLLBACK. A process (or a user session) has its own PFL, then a process may perform a lot of transactions, and then this level of Free List, which is Transaction Free List, referred to as TFL.
TFL is dynamically generated, only TFL is generated when the DML statement (such as delete or Update) reduces the block occupation to the PCTUSED parameter specified value, one TFL only belongs to a transaction, and one transaction will only have a TFL The idle block on the TFL of this transaction will not be used by other transactions until a transaction is not submitted. However, it can be used immediately (this idle block is called Previously Freed Blocks).
Each Segment can have 16 TFLs, and as long as there is a need to increase the number of TFLs, unless the restriction of Segment Header Block Size is reached. This transaction must wait for other transactions to submit and release TFL when there is no space to get its own TFL. Algorithm waiting for which transaction is: (p% NFL)
Where P represents the Process ID of the DML operation process, you can get from the V $ Process.PID field.
NFL represents the total number of TFLs.
Dump data block information via DUMP, we can see the following:
XCT LST :: FLG: Used LHD: 0x01C0008C LTL: 0x01C0008A Xid: 0x0008.01f.000003d2
The XID represents the Transaction ID, the meaning of the TRANSAction ID and the meaning of interest, and interested readers can view other information.
4. Super Master Free List or Segment Master Free List
This level of Free List will only appear when you set a plurality of FreeList Groups.
When we set freeelist group> 1, we will generate freeelist group block. After the Segment Header Block, it is assumed that we set up Storage (FreeElists 4 Freelist Groups 2), then the first block of the segment header block is Segment Header Block. , The second, and 3 blocks are freeelist group block.
First, there is a Free List in Segment Header Block, which is called Super Master Free List or Segment Master Free List.
And 1 MFL is stored in each Freelist Group Block, and there are still 4 PFLs, and the remaining space of each FreeList Group Block block is left to TFL. The algorithm for the process of free INSTANCE is (p% NFB) 1.
Where P represents the Process ID of the DML operation process, you can get from the V $ Process.PID field.
Nfb represents the number of freeelist groups defined by the freelist groups parameter.
The algorithm in the RAC environment is more complicated, and this article is not discussed.
Viewing the dump file for Freeelist Group Block can see the following:
FRMT: 0x02 Chkval: 0x0000 Type: 0x16 =
Data Segment Free List Block with free block country
Blocks in Free List = 5 CCNT = 0
Seg Lst :: flg: unused lhd: 0x00000000 LTL: 0x00000000
Seg Lst :: flg: unused lhd: 0x00000000 LTL: 0x00000000
Seg Lst :: flg: unused lhd: 0x00000000 LTL: 0x00000000
Seg Lst :: flg: used lhd: 0x01c00116 ltl: 0x01c0011a
Seg Lst :: flg: unused lhd: 0x00000000 LTL: 0x00000000