Every Oracle block belongs to a block class. Block classes are used to identify undo segment within redo records. Block classes are also used to produce more granular output in the V$WAITSTAT dynamic performance view.
The following table shows the block classes in Oracle 10.2
|
Block classes above 16 are reserved for undo segments. The block class is dependent on the undo segment number. Each undo segment has two block classes; one for the undo segment header and the other for undo segment blocks. The following table shows the first few block classes.
|
The block class is not stored on individual blocks within the database. However, it is used in a couple of diagnostic areas
This dynamic performance view returns wait statistics by block class. V$WAITSTAT is defined as follows
|
V$WAITSTAT is derived from X$KCBWAIT as follows
|
X$KCBWAIT has the following columns:
|
The INDX column of X$KCBWAIT is the block class
The block class is stored in the change record header. The block class also appears in redo log dump files
For example, for the start of a transaction the redo operation is 5.2. This operation updates the undo segment header. An unused slot is selected and updated to indicate that it is in use. The following is an example from a redo log dump
|
In the above example the class (CLS) is 23. From the table above, we can determine that this transaction is using undo segment number is 4. We can also see that the slot number (slt) is 0x001e (30 in decimal) and the sequence number (sqn) is 0x3bd (957 in decimal).
For this transaction, the XID will be
xid: 0x0004.01e.000003bd
Each subsequent change within the same transaction will specify the transaction ID
|
In the redo log dump file, the XID is stored in the ktudb structure. In the above example the XID is 0x0004.01e.000003bd
Every transaction ends with a COMMIT operation which is represented by a 5.4 redo operation. In the event of a ROLLBACK operation for the transaction being requested, the changes are rolled back in reverse order. The final operation of the rollback segment is a 5.4 redo operation which effectively performs a commit.
|
In the redo for the 5.4 operation, the transaction ID is specified by the block class (CLS - described above), the slot (slt) and the sequence number (sqn). This information can be used to identify the undo segment header and the changes to which this commit statement applies.