I. Summary of use of rollback segments: 1.1Seq Sequence Value: Step 1: Each rollback block header has a SEQ value. When the transaction extends to the new area, the SEQ in the new area is the SEQ plus 1 in the previous area. For example, Step 2: Step 3: commit transaction B
I. Summary of use of rollback segments: 1.1Seq Sequence Value: Step 1: Each rollback block header has a SEQ value. When the transaction extends to the new area, the SEQ in the new area is the SEQ plus 1 in the previous area. For example, Step 2: Step 3: commit transaction B
I. Summary of the use of rollback segments:
1.1 Seq Sequence Value:
In the block header of each rollback block, there is a SEQ value. When the transaction is extended to the new area, the SEQ of the new area is the SEQ of the previous area plus 1. For example:
Step 2:
Step 4: transaction A releases A new update statement, which occupies the rollback block and starts to grow:
Transaction A grew, occupying 83, 84, 85, 86, and 87 blocks. However, when it reached 88 blocks, it was found that the sequence values of 88 and 89 blocks were also 10, not smaller than their own sequence values, transaction A skips 88 and 89 blocks. The Sequence Value of 90 blocks is less than 10, and transaction A occupies 90 blocks.
Step 5:
Transaction A continues to grow. When transaction A is extended to the next region, the sequence value of the Hong Kong VM in the next block is 11:
Conclusion: only when the sequence value allocated for a transaction block is greater than the Sequence Value of the block itself can the transaction occupy this block. In the previous example, transaction B has committed the block. It will be occupied only when another transaction is committed from the end zone to Zone 0.
Extend ):
Transaction A continues to grow and has occupied zone 0. Transaction A requests A new rollback block. As transaction Z starts from zone 1 and is A Hong Kong server, Zone 1 has an "active transaction". At this time, Oracle allocates A new zone as Zone 1, the old zone 1 is changed to zone 2, as shown below:
Even if there is still free old zone 2 after the old Zone 1, the new zone 1 will still be allocated here.
Ii. rollback and submission:
2.1 rollback:
If a transaction is rolled back, the procedure is:
From the above steps, we can see that the rollback order is the opposite of the operation order. If you delete 1, 2, 3, 4, 5 Records, and then roll back, Oracle will go forward from the back, insert 5, 4, 3, 2, and 1 records in sequence.
2.2 submit:
After the transaction is committed, the Transaction Status column in the transaction table is set to non-active. This transaction cannot be rolled back, because the rollback must first go to the transaction table to find the end block of the transaction rollback chain.
However, after the transaction is committed, although the transaction table indicates that the transaction is a non-active transaction, but the information in the rollback block is still there, although it cannot be rolled back, however, the information in these rollback blocks can still be read before being overwritten.
In this regard, we can find a transaction, commit the transaction, and then DUMP the rollback block it occupies. According to the rollback segment cycle usage principle, these rollback records will be overwritten only when they are in the next loop.
3. Manually construct CR blocks:
3.1 query magic:
The PL/SQL process is successfully completed.
Submitted.
10 rows have been selected.
This error is sometimes returned when the query is executed for a long time.
3.2 SCN:
You can see SCN in almost all places. In transaction tables, rollback records in rollback blocks, data blocks, log files, and so on, we have mentioned that in the cursor, records also contain the SCN when the cursor is opened.
3.3 construct CR blocks:
3. In the flash query, if the requested SCN is smaller than the block SCN, the CR block must also be constructed.
AAAB3LAAFAAAf/pAAA 131049 j 10
...
Let's start to construct CR blocks. First, let's talk about the structure of CR blocks at the end of the commit:
Column 6: SCN/Fsc, virtual host, is the SCN information of the transaction. 0x01 transactions are committed at the end, so the column is 0.
18> select scn, to_char (scn, 'xxxxxxxxxx') from (select dbms_flashback.get_system_change_number
SCN from dual );
Here we will talk about the construction process of CR blocks. In this process, we have seldom used transaction tables. Here, ITL is important and we rely on it to roll back. However, Oracle still needs to read the transaction table at the beginning of the CR block construction. This can be seen from the "touchpoint" In X $ BH. Each time a query is released that generates a CR block, the TCH column in the rollback segment header is increased. ITL is the block header of each data block. It is for blocks, while the transaction table is for transactions.
During Rollback, Oracle must read the transaction table because a transaction may involve many Rollback records and many Rollback blocks. These Rollback records are linked together, the UBA record at the end of the rollback chain can be found only in the transaction table. Therefore, rollback must start from the end of the rollback chain.
This article is from the "ye shaochen" blog. Please keep this source