Oracle transaction consistency?

I have a problem understanding read consistency in a database (Oracle).

Suppose I am a bank manager. The client has a lock (which I do not know) and is doing some modernization. Now, after he got the lock, I look at the account information and try to do something. But due to read consistency, I will see the data that existed before the client received the lock. So that this will not affect the source data that I receive, and the decisions that I am going to make during this period?

+3
source share
3 answers

The read consistency point is this: assume the client rolls back its changes? Or suppose these changes fail due to a constraint violation or some system failure?

Until the client has completed their changes, these changes do not exist. Any decision that you can make based on a read or dirty phantom reading will not have more validity than the scenario you are describing. Indeed, they are less important because the changes are incomplete and therefore inconsistent. A specific example: if client changes include making a deposit and withdrawing funds, how valid would your decision be if you looked at the account when they made a deposit but didn’t make a withdrawal yet?

: . , , ?

UNDO ( ). , , Oracle UNDO, , , .

, , - ORA-1555: snapshot too old. , UNDO, , , .

. Oracle . - .

+10

, , , .. UPDATE... WHERE.

, . column ORA_ROWSCN, .

+1

When a record is locked due to changes or an explicit lock statement, the record is written to the header of this block. This is called an ITL (list of interested transactions). When you come to read this block, your session sees this and knows where to go in order to get the read consistent copy from the rollback segment.

0
source

Source: https://habr.com/ru/post/1742580/


All Articles