Serializable isolation is suitable for environments:
■ With large databases and short transactions that update only a few rows
■ Where the chance that two concurrent transactions will modify the same rows is
■ Where relatively long-running transactions are primarily read only
Serializable isolation permits concurrent transactions to make only those database
changes they could have made if the transactions had been scheduled to run one after
another. Specifically, Oracle permits a serializable transaction to modify a data row
only if it can determine that prior changes to the row were made by transactions that
had committed when the serializable transaction began.
To make this determination efficiently, Oracle uses control information stored in the
data block that indicates which rows in the block contain committed and uncommitted
changes. In a sense, the block contains a recent history of transactions that affected
each row in the block. The amount of history that is retained is controlled by the
INITRANS parameter of CREATE TABLE and ALTER TABLE.
Under some circumstances, Oracle can have insufficient history information to
determine whether a row has been updated by a too recent transaction. This can occur
when many transactions concurrently modify the same data block, or do so in a very
short period. You can avoid this situation by setting higher values of INITRANS for
tables that will experience many transactions updating the same blocks. Doing so
enables Oracle to allocate sufficient storage in each block to record the history of
transactions that accessed the block.
Oracle generates an error when a serializable transaction tries to update or delete data
modified by a transaction that commits after the serializable transaction began:
ORA-08177: Cannot serialize access for this transaction .
When a serializable transaction fails with the Cannot serialize access error, the
application can take any of several actions:
■ Commit the work executed to that point
■ Execute additional (but different) statements (perhaps after rolling back to a
savepoint established earlier in the transaction)
■ Undo the entire transaction
2. Oracle 在数据块内存储了相关的控制信息，用于记录此块内数据行中所包含的变化。
即数据块内记录了近段时间内对本数据块内数据行进行了修改的事务信息 , 能记录多少条这样的记录
Oracle 将报错：事务不能串行化访问 .
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/10599713/viewspace-989000/，如需转载，请注明出处，否则将追究法律责任。