1. 程式人生 > 其它 >Oracle詞彙表(事務表(transaction table)”)

Oracle詞彙表(事務表(transaction table)”)

Transaction Table: Each undosegment header block(q.v.) has an area in it called the transaction table. When a transaction starts, it picks an undo segment to use then picks the oldest free entry (called a transaction table“slot”) from that segment header’s transaction table. This slot is the identifying marker for a transaction, and information about it is published in two ways – first as the transaction ID inv$transaction

, and secondly inv$lockwhere aTXlock is reported in mode 6 (exclusive) by the session running the transaction. Both locations identify the transaction by the triple: (undo segment number, slot number, sequence number). (The number of slots in atransaction tableis limited so each one has a sequence number stamped on it, and each time a slot is re-used the sequence number goes up by one). As a transaction starts, the “startSCN
” is one of the items written to the transaction table slot; when the transaction commits this is changed to the “commitSCN“.

Transaction Table Slot: a single row in aTransaction Table(q.v.) representing a single transaction. Since there are only a limited number of rows (slots) in a transaction table, part of the row data includes a“usage counter”

, known as the“sequence”. Atransaction idis then the combination of the undo segment number that the transaction table is in, the row (slot) number in the transaction table, and the sequence number of the row (slot). The parts of the transaction id can be seen in the viewv$transactionin the columns:xidusn,xidslot,xidsqn. In the latest versions of Oracle, the entire transaction id is also reported as araw(8)column calledxid.

Undo: (formerly known asrollback): information describing how to reverse out changes made to data blocks (including index blocks, bitmap file header blocks etc). Asingleundo recordis a description of how to reverse out a single“db block change”. Undo is stored inundo segments, which are created inundo tablespaces, and eachundo segment headerholds a“catalogue”(called thetransaction table) which shows where recent transactions wrote theirfirst undo record.

好的程式碼像粥一樣,都是用時間熬出來的