oracle一致读增大,Oracle一致读的一些细节

[参考]一致读的步骤

1. Read the Data Block.

2. Read the Row Header.

3. Check the Lock Byte todetermine whether theres an ITL entry.

4. Read the ITL entry to determinethe Transaction ID (Xid).

5. Read the Transaction Tableusing the Transaction ID. If the transaction has been committed and has aSystem Commit Number less than the querys System Change Number, update thestatus of the block (block cleanout) and start over at step 1.

第5步细分

---IF 在TransactionTable 中根据Transaction ID 找到transaction

-----------IF transaction 已经commit

----------------------IF queryscn>commit scn

------------------------------------则接受该块,进行clean out,返回1

------------------------ELSEIFquery scn

-------------------------------------则进行一致性读,从第6步向后执行

------------ELSEIF transaction 没有commit

------------------------也进行一致性读,从第6步向后执行

---ELSEIF 在Transaction Table 中没有找到transaction(undoheader中的transaction slot被覆盖了,也说明事务已经提交,因为只有提交后所在的transaction slot才能被覆盖。这样query scn则去比较control scn。在该回滚段上control scn以前的transaction都已经被提交,也就是事务表中所能找到的最小的commit scn了)

------------IF query scn

-----------------------则无法知道query scn和commit scn得大小关系,出现ORA-01555错误

------------IF queryscn>control scn

-----------------------则query scn肯定>commit scn

------------------------------------则接受该块,进行clean out,并将block 中ITL标记上“U”,表示“upper bound commit” ,并返回1

6. Read the last undo block (Uba).

7. Compare the block transactionID with the transaction table transaction ID. If the Transaction ID in the undoblock doesnt equal the Transaction ID from the Transaction Table, then issueORA-1555, Snapshot Too Old. 表示回滚段中回滚信息被覆盖,无法为一致读提供必需的beforeimage。

8. If the Transaction IDs areidentical, make a copy of the data block in memory. Starting with the head undoentry, apply the changes to the copied data block.

9. If the tail undo entry (theactual first undo entry in the chain, or the last in the chain goingbackwards!) indicates another data block address, read the indicated undo blockinto memory and repeat steps 7 and 8 until the undo entries dont contain a valuefor the data block address.

10. When theres no previous datablock address, the transaction has been completely undone.

11. If the undo entry contains:

a. a pointer to a previoustransaction undo block address, read the Transaction ID in the previoustransaction undo block header and read the appropriate Transaction Table entry.Return to step 5.

b. an ITL record, restore the ITLrecord to the data block. Return to step 4.

出现1555的时候,首先判断是哪个原因导致,可以设置event;如果因为transaction slot被覆盖导致,则增加回滚段数目;如果因为回滚信息被覆盖,则增加回滚大大小。1555错误比较复杂,通常需要考虑很多问题。

event = 1555 trace nameprocessstate forever, level 10

That will give you a process statedump for any process that gets an ORA-1555 error. The dump will show you whichblock the process was trying to rollback to its snapshot SCN. If its a rollbacksegment header block, then you have your proof. see more from

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值