Transaction control
Transaction control
and isolation levels
and isolation levels
in Oracle
in Oracle
Evgeniya Kotzeva
Vereo Technologies
www.vereo.bg
academy.devbg.org www.devbg.org
Contents
Contents
• Transaction
Transaction control
control
• Data Concurrency and Consistency
Data Concurrency and Consistency
in a Multiuser Environment
in a Multiuser Environment
• Locking
Locking
Database Transaction
Database Transaction
A database transaction consists of one of
A database transaction consists of one of
the
the following:
following:
• DML statements which constitute one
DML statements which constitute one
consistent
consistent change to the data
change to the data
• One DDL statement
One DDL statement
• One DCL statement
One DCL statement
Oracle Transaction Types
Oracle Transaction Types
Type
Type Description
Description
Data manipulation
Data manipulation
language (DML
language (DML)
)
Consists of any number of DML
Consists of any number of DML
statements that the Oracle
statements that the Oracle
server treats as a single entity
server treats as a single entity
or a logical unit of work
or a logical unit of work
Data definition
Data definition
language
language
(DDL)
(DDL)
Consists of only one DDL
Consists of only one DDL
statement
statement
Data control language
Data control language
(DCL)
(DCL)
Consists of only one DCL
Consists of only one DCL
statement
statement
Transaction boundaries
Transaction boundaries
A transaction begins with
A transaction begins with
the first executable SQL
the first executable SQL
statement.
statement.
A transaction ends with
A transaction ends with
one of the following
one of the following
events:
events:
• A COMMIT or
A COMMIT or
ROLLBACK statement is
ROLLBACK statement is
issued
issued
• A DDL or DCL statement
A DDL or DCL statement
executes (automatic
executes (automatic
commit)
commit)
• The user exits
The user exits i
iSQL*Plus
SQL*Plus
• The system crashes
The system crashes
Advantages of COMMIT
Advantages of COMMIT
and ROLLBACK
and ROLLBACK
With COMMIT and ROLLBACK statements, you
With COMMIT and ROLLBACK statements, you
can:
can:
• Ensure data consistency
Ensure data consistency
• Preview data changes before making changes
Preview data changes before making changes
permanent
permanent
• Group logically related operations
Group logically related operations
Controlling transaction
Controlling transaction
COMMIT transaction
COMMIT transaction
Before
Before COMMIT
COMMIT
• generated rollback
generated rollback
segment records in buffers
segment records in buffers
in the SGA
in the SGA
• generated redo log entries
generated redo log entries
in the redo log buffer of
in the redo log buffer of
the SGA.
the SGA.
• The changes have been
The changes have been
made to the database
made to the database
buffers of the SGA.
buffers of the SGA.
After
After COMMIT
COMMIT
• The internal transaction
The internal transaction
table for the associated
table for the associated
rollback segment records
rollback segment records
updated with SCN
updated with SCN
• LGWR writes SGA redo
LGWR writes SGA redo
log entries to the online
log entries to the online
redo log file
redo log file
• Oracle releases locks
Oracle releases locks
• Oracle marks the
Oracle marks the
transaction complete.
transaction complete.
ROLLBACK transaction
ROLLBACK transaction
ROLLBACK
ROLLBACK
• Oracle undoes all
Oracle undoes all
transaction changes using
transaction changes using
the undo tablespace or
the undo tablespace or
rollback segments
rollback segments
• Oracle releases all the
Oracle releases all the
transaction’s locks of data
transaction’s locks of data
• The transaction ends
The transaction ends
ROLLBACK to SAVEPOINT
ROLLBACK to SAVEPOINT
• Oracle rolls back only the
Oracle rolls back only the
statements run after the
statements run after the
savepoint.
savepoint.
• Oracle preserves the
Oracle preserves the
specified savepoint, but all
specified savepoint, but all
savepoints that were
savepoints that were
established after the
established after the
specified one are lost
specified one are lost
• Oracle releases all table
Oracle releases all table
and row locks acquired
and row locks acquired
since that savepoint
since that savepoint
State of the Data
State of the Data
Before COMMIT or ROLLBACK
Before COMMIT or ROLLBACK
• The previous state of the data
The previous state of the data can be recovered
can be recovered.
.
• The current user
The current user can review
can review the results of the
the results of the
DML operations by using the SELECT statement.
DML operations by using the SELECT statement.
• Other users
Other users can not view
can not view the results of the DML
the results of the DML
statements by the current user.
statements by the current user.
• The affected rows
The affected rows are locked
are locked
• Other users
Other users cannot change
cannot change the data within the
the data within the
affected rows.
affected rows.
State of the Data after COMMIT
State of the Data after COMMIT
• Data changes are made
Data changes are made permanent
permanent in the
in the
database.
database.
• The previous state of the data
The previous state of the data is permanently lost
is permanently lost.
.
• All users
All users can view
can view the results.
the results.
• Locks on the affected rows
Locks on the affected rows are released
are released; those
; those
rows are available for other users to manipulate.
rows are available for other users to manipulate.
• All savepoints
All savepoints are erased
are erased.
.
Distributed database
Distributed database
• Distributed transaction
Distributed transaction is a transaction that
is a transaction that
includes one or more statements that update data
includes one or more statements that update data
on two or more distinct nodes of a distributed
on two or more distinct nodes of a distributed
database
database
• A
A two-phase commit
two-phase commit mechanism guarantees
mechanism guarantees the
the
data consistent in all nodes.
data consistent in all nodes.
Autonomous transaction
Autonomous transactions
s
• Autonomous transactions are independent
Autonomous transactions are independent
transactions that can be called from within another
transactions that can be called from within another
transaction
transaction
• An autonomous transaction lets you leave the
An autonomous transaction lets you leave the
context of the calling transaction
context of the calling transaction
• You can call autonomous transactions from within
You can call autonomous transactions from within
a PL/SQL block by using the pragma
a PL/SQL block by using the pragma
AUTONOMOUS_TRANSACTION.
AUTONOMOUS_TRANSACTION.
Data Concurrency and
Data Concurrency and
Consistency
Consistency
• Data concurrency
Data concurrency means that many users can
means that many users can
access data at the same time.
access data at the same time.
• Data consistency
Data consistency means that each user sees a
means that each user sees a
consistent view of the data, including visible
consistent view of the data, including visible
changes made by the user’s own transactions and
changes made by the user’s own transactions and
transactions of other users.
transactions of other users.
The isolation models prevents
The isolation models prevents
• Dirty reads
Dirty reads
• Nonrepeatable (fuzzy) reads
Nonrepeatable (fuzzy) reads
• Phantom reads
Phantom reads
Isolation levels (SQL92) controls
Isolation levels (SQL92) controls
Isolation
Isolation
Level
Level
Dirty
Dirty
Read
Read
Nonrepeatable
Nonrepeatable
Read
Read
Phantom
Phantom
Read
Read
Read
Read
uncommitted
uncommitted
Y
Y Y
Y Y
Y
Read committed
Read committed N
N Y
Y Y
Y
Repeatable read
Repeatable read N
N N
N Y
Y
Serializable
Serializable N
N N
N N
N
Oracle isolation levels
Oracle isolation levels
Read committed
Read committed Each query executed by a transaction
Each query executed by a transaction
sees only data that was committed
sees only data that was committed
before the query began (Oracle default
before the query began (Oracle default
isolation level)
isolation level)
Serializable
Serializable Serializable transactions see only those
Serializable transactions see only those
changes that were committed at the
changes that were committed at the
time the transaction began, plus its own
time the transaction began, plus its own
changes
changes
Read-only
Read-only The transaction sees only those
The transaction sees only those
changes that were committed at the
changes that were committed at the
time the transaction began and do not
time the transaction began and do not
allow any DML statement
allow any DML statement
Multiversion Concurrency Control
Multiversion Concurrency Control
• Statement-level read consistency
Statement-level read consistency
The data returned by a single query comes from a
The data returned by a single query comes from a
single point in time — the time that the query
single point in time — the time that the query
began
began
• Transaction-level read consistency
Transaction-level read consistency
When a transaction executes in serializable mode,
When a transaction executes in serializable mode,
all data accesses reflect the state of the database
all data accesses reflect the state of the database
as of the time the transaction began
as of the time the transaction began
Transactions and Read
Transactions and Read
Consistency
Consistency
“
“Snapshot too old”
Snapshot too old”
When commit or rollback has been executed,
When commit or rollback has been executed,
the pre-images can be overwritten
the pre-images can be overwritten even if
even if
they are needed to provide a read-
they are needed to provide a read-
consistent view to another query.
consistent view to another query.
"Snapshot too old" simply means that pre-
"Snapshot too old" simply means that pre-
images which the query needs to maintain a
images which the query needs to maintain a
read-consistent view have been overwritten.
read-consistent view have been overwritten.
Common recommendations
Common recommendations
Common recommendations to reduce the possibility of
Common recommendations to reduce the possibility of
"snapshot too old" are:
"snapshot too old" are:
• Keep transactions as fast as possible
Keep transactions as fast as possible
• Increase the size/number of rollback segments
Increase the size/number of rollback segments
• Do
Do not
not specify an OPTIMAL size for your rollback
specify an OPTIMAL size for your rollback
segments.
segments.
• Increase the size of UNDO_RETENTION parameter
Increase the size of UNDO_RETENTION parameter
(amount of committed undo information to retain in the database)
(amount of committed undo information to retain in the database)
• Avoid executing long-running queries when transactions
Avoid executing long-running queries when transactions
which update the table are also executing.
which update the table are also executing.
Set the Isolation Level
Set the Isolation Level
You can set the isolation level of a transaction by
You can set the isolation level of a transaction by
using
using one of these statements at the beginning of
one of these statements at the beginning of
a transaction:
a transaction:
• SET TRANSACTION ISOLATION LEVEL
SET TRANSACTION ISOLATION LEVEL
READ COMMITTED;
READ COMMITTED;
• SET TRANSACTION ISOLATION LEVEL
SET TRANSACTION ISOLATION LEVEL
SERIALIZABLE;
SERIALIZABLE;
• SET TRANSACTION ISOLATION LEVEL
SET TRANSACTION ISOLATION LEVEL
READ ONLY;
READ ONLY;
Serializable Transaction Failure
Serializable Transaction Failure
Modes of Locking
Modes of Locking
• Exclusive lock
Exclusive lock
The mode prevents the associates resource from
The mode prevents the associates resource from
being shared
being shared
• Share lock
Share lock
The mode allows the associated resource to be
The mode allows the associated resource to be
shared, depending on the operations involved
shared, depending on the operations involved
Deadlock
Deadlock
Types of Locks
Types of Locks
Lock
Lock Description
Description
DML locks
DML locks (data locks)
(data locks) DML locks protect data
DML locks protect data
For example, table locks lock
For example, table locks lock
entire tables, rowlocks lock
entire tables, rowlocks lock
selected rows.
selected rows.
DDL locks
DDL locks (dictionary
(dictionary locks)
locks) DDL locks protect the
DDL locks protect the
structure of schema objects
structure of schema objects
Internal locks
Internal locks and latches
and latches Internal locks and latches
Internal locks and latches
protect internal database
protect internal database
structures such as datafiles
structures such as datafiles
Table Locks
Table Locks
• RS: row share
RS: row share
• RX: row exclusive
RX: row exclusive
• S: share
S: share
• SRX: share row
SRX: share row
exclusive
exclusive
• X: exclusive
X: exclusive
Data Lock Escalation
Data Lock Escalation
• A transaction holds exclusive row locks for
A transaction holds exclusive row locks for
all rows inserted, updated, or deleted within
all rows inserted, updated, or deleted within
the transaction. Because row locks are
the transaction. Because row locks are
acquired at the highest degree of
acquired at the highest degree of
restrictiveness, no lock conversion is
restrictiveness, no lock conversion is
required or performed.
required or performed.
• Oracle automatically converts a table lock of
Oracle automatically converts a table lock of
lower restrictiveness to one of higher
lower restrictiveness to one of higher
restrictiveness as appropriate
restrictiveness as appropriate
MS SQL Isolation Levels
MS SQL Isolation Levels
Microsoft SQL Server 2005
Microsoft SQL Server 2005 Oracle
Oracle
SELECT ... WITH (UPDLOCK)
SELECT ... WITH (UPDLOCK) SELECT... FOR UPDATE
SELECT... FOR UPDATE
READ COMMITTED with
READ COMMITTED with
snapshots
snapshots
READ COMMITTED
READ COMMITTED
SNAPSHOT
SNAPSHOT SERIALIZABLE
SERIALIZABLE
SNAPSHOT
SNAPSHOT READ ONLY
READ ONLY
READ UNCOMMITTED
READ UNCOMMITTED No Equivalent
No Equivalent
READ COMMITTED with locking
READ COMMITTED with locking No Equivalent
No Equivalent
REPEATABLE READ
REPEATABLE READ No Equivalent
No Equivalent
SERIALIZABLE
SERIALIZABLE No Equivalent
No Equivalent
DB2 Isolation Levels
DB2 Isolation Levels
Isolation levels
Isolation levels
• Repeatable Read (RR)
Repeatable Read (RR)
• Read Stability (RS)
Read Stability (RS)
• Cursor Stability (CS)
Cursor Stability (CS)
• Uncommitted Read (UR)
Uncommitted Read (UR)
Levels of locking
Levels of locking
• Tablespace
Tablespace
• Table
Table
• Row
Row
Transactions in Oracle
Transactions in Oracle
Въпроси?
Въпроси?

Transactions-in-Oracle-Evgenya-Kotzeva (2).ppt

  • 1.
    Transaction control Transaction control andisolation levels and isolation levels in Oracle in Oracle Evgeniya Kotzeva Vereo Technologies www.vereo.bg academy.devbg.org www.devbg.org
  • 2.
    Contents Contents • Transaction Transaction control control •Data Concurrency and Consistency Data Concurrency and Consistency in a Multiuser Environment in a Multiuser Environment • Locking Locking
  • 3.
    Database Transaction Database Transaction Adatabase transaction consists of one of A database transaction consists of one of the the following: following: • DML statements which constitute one DML statements which constitute one consistent consistent change to the data change to the data • One DDL statement One DDL statement • One DCL statement One DCL statement
  • 4.
    Oracle Transaction Types OracleTransaction Types Type Type Description Description Data manipulation Data manipulation language (DML language (DML) ) Consists of any number of DML Consists of any number of DML statements that the Oracle statements that the Oracle server treats as a single entity server treats as a single entity or a logical unit of work or a logical unit of work Data definition Data definition language language (DDL) (DDL) Consists of only one DDL Consists of only one DDL statement statement Data control language Data control language (DCL) (DCL) Consists of only one DCL Consists of only one DCL statement statement
  • 5.
    Transaction boundaries Transaction boundaries Atransaction begins with A transaction begins with the first executable SQL the first executable SQL statement. statement. A transaction ends with A transaction ends with one of the following one of the following events: events: • A COMMIT or A COMMIT or ROLLBACK statement is ROLLBACK statement is issued issued • A DDL or DCL statement A DDL or DCL statement executes (automatic executes (automatic commit) commit) • The user exits The user exits i iSQL*Plus SQL*Plus • The system crashes The system crashes
  • 6.
    Advantages of COMMIT Advantagesof COMMIT and ROLLBACK and ROLLBACK With COMMIT and ROLLBACK statements, you With COMMIT and ROLLBACK statements, you can: can: • Ensure data consistency Ensure data consistency • Preview data changes before making changes Preview data changes before making changes permanent permanent • Group logically related operations Group logically related operations
  • 7.
  • 8.
    COMMIT transaction COMMIT transaction Before BeforeCOMMIT COMMIT • generated rollback generated rollback segment records in buffers segment records in buffers in the SGA in the SGA • generated redo log entries generated redo log entries in the redo log buffer of in the redo log buffer of the SGA. the SGA. • The changes have been The changes have been made to the database made to the database buffers of the SGA. buffers of the SGA. After After COMMIT COMMIT • The internal transaction The internal transaction table for the associated table for the associated rollback segment records rollback segment records updated with SCN updated with SCN • LGWR writes SGA redo LGWR writes SGA redo log entries to the online log entries to the online redo log file redo log file • Oracle releases locks Oracle releases locks • Oracle marks the Oracle marks the transaction complete. transaction complete.
  • 9.
    ROLLBACK transaction ROLLBACK transaction ROLLBACK ROLLBACK •Oracle undoes all Oracle undoes all transaction changes using transaction changes using the undo tablespace or the undo tablespace or rollback segments rollback segments • Oracle releases all the Oracle releases all the transaction’s locks of data transaction’s locks of data • The transaction ends The transaction ends ROLLBACK to SAVEPOINT ROLLBACK to SAVEPOINT • Oracle rolls back only the Oracle rolls back only the statements run after the statements run after the savepoint. savepoint. • Oracle preserves the Oracle preserves the specified savepoint, but all specified savepoint, but all savepoints that were savepoints that were established after the established after the specified one are lost specified one are lost • Oracle releases all table Oracle releases all table and row locks acquired and row locks acquired since that savepoint since that savepoint
  • 10.
    State of theData State of the Data Before COMMIT or ROLLBACK Before COMMIT or ROLLBACK • The previous state of the data The previous state of the data can be recovered can be recovered. . • The current user The current user can review can review the results of the the results of the DML operations by using the SELECT statement. DML operations by using the SELECT statement. • Other users Other users can not view can not view the results of the DML the results of the DML statements by the current user. statements by the current user. • The affected rows The affected rows are locked are locked • Other users Other users cannot change cannot change the data within the the data within the affected rows. affected rows.
  • 11.
    State of theData after COMMIT State of the Data after COMMIT • Data changes are made Data changes are made permanent permanent in the in the database. database. • The previous state of the data The previous state of the data is permanently lost is permanently lost. . • All users All users can view can view the results. the results. • Locks on the affected rows Locks on the affected rows are released are released; those ; those rows are available for other users to manipulate. rows are available for other users to manipulate. • All savepoints All savepoints are erased are erased. .
  • 12.
    Distributed database Distributed database •Distributed transaction Distributed transaction is a transaction that is a transaction that includes one or more statements that update data includes one or more statements that update data on two or more distinct nodes of a distributed on two or more distinct nodes of a distributed database database • A A two-phase commit two-phase commit mechanism guarantees mechanism guarantees the the data consistent in all nodes. data consistent in all nodes.
  • 13.
    Autonomous transaction Autonomous transactions s •Autonomous transactions are independent Autonomous transactions are independent transactions that can be called from within another transactions that can be called from within another transaction transaction • An autonomous transaction lets you leave the An autonomous transaction lets you leave the context of the calling transaction context of the calling transaction • You can call autonomous transactions from within You can call autonomous transactions from within a PL/SQL block by using the pragma a PL/SQL block by using the pragma AUTONOMOUS_TRANSACTION. AUTONOMOUS_TRANSACTION.
  • 14.
    Data Concurrency and DataConcurrency and Consistency Consistency • Data concurrency Data concurrency means that many users can means that many users can access data at the same time. access data at the same time. • Data consistency Data consistency means that each user sees a means that each user sees a consistent view of the data, including visible consistent view of the data, including visible changes made by the user’s own transactions and changes made by the user’s own transactions and transactions of other users. transactions of other users.
  • 15.
    The isolation modelsprevents The isolation models prevents • Dirty reads Dirty reads • Nonrepeatable (fuzzy) reads Nonrepeatable (fuzzy) reads • Phantom reads Phantom reads
  • 16.
    Isolation levels (SQL92)controls Isolation levels (SQL92) controls Isolation Isolation Level Level Dirty Dirty Read Read Nonrepeatable Nonrepeatable Read Read Phantom Phantom Read Read Read Read uncommitted uncommitted Y Y Y Y Y Y Read committed Read committed N N Y Y Y Y Repeatable read Repeatable read N N N N Y Y Serializable Serializable N N N N N N
  • 17.
    Oracle isolation levels Oracleisolation levels Read committed Read committed Each query executed by a transaction Each query executed by a transaction sees only data that was committed sees only data that was committed before the query began (Oracle default before the query began (Oracle default isolation level) isolation level) Serializable Serializable Serializable transactions see only those Serializable transactions see only those changes that were committed at the changes that were committed at the time the transaction began, plus its own time the transaction began, plus its own changes changes Read-only Read-only The transaction sees only those The transaction sees only those changes that were committed at the changes that were committed at the time the transaction began and do not time the transaction began and do not allow any DML statement allow any DML statement
  • 18.
    Multiversion Concurrency Control MultiversionConcurrency Control • Statement-level read consistency Statement-level read consistency The data returned by a single query comes from a The data returned by a single query comes from a single point in time — the time that the query single point in time — the time that the query began began • Transaction-level read consistency Transaction-level read consistency When a transaction executes in serializable mode, When a transaction executes in serializable mode, all data accesses reflect the state of the database all data accesses reflect the state of the database as of the time the transaction began as of the time the transaction began
  • 19.
    Transactions and Read Transactionsand Read Consistency Consistency
  • 20.
    “ “Snapshot too old” Snapshottoo old” When commit or rollback has been executed, When commit or rollback has been executed, the pre-images can be overwritten the pre-images can be overwritten even if even if they are needed to provide a read- they are needed to provide a read- consistent view to another query. consistent view to another query. "Snapshot too old" simply means that pre- "Snapshot too old" simply means that pre- images which the query needs to maintain a images which the query needs to maintain a read-consistent view have been overwritten. read-consistent view have been overwritten.
  • 21.
    Common recommendations Common recommendations Commonrecommendations to reduce the possibility of Common recommendations to reduce the possibility of "snapshot too old" are: "snapshot too old" are: • Keep transactions as fast as possible Keep transactions as fast as possible • Increase the size/number of rollback segments Increase the size/number of rollback segments • Do Do not not specify an OPTIMAL size for your rollback specify an OPTIMAL size for your rollback segments. segments. • Increase the size of UNDO_RETENTION parameter Increase the size of UNDO_RETENTION parameter (amount of committed undo information to retain in the database) (amount of committed undo information to retain in the database) • Avoid executing long-running queries when transactions Avoid executing long-running queries when transactions which update the table are also executing. which update the table are also executing.
  • 22.
    Set the IsolationLevel Set the Isolation Level You can set the isolation level of a transaction by You can set the isolation level of a transaction by using using one of these statements at the beginning of one of these statements at the beginning of a transaction: a transaction: • SET TRANSACTION ISOLATION LEVEL SET TRANSACTION ISOLATION LEVEL READ COMMITTED; READ COMMITTED; • SET TRANSACTION ISOLATION LEVEL SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; SERIALIZABLE; • SET TRANSACTION ISOLATION LEVEL SET TRANSACTION ISOLATION LEVEL READ ONLY; READ ONLY;
  • 23.
  • 24.
    Modes of Locking Modesof Locking • Exclusive lock Exclusive lock The mode prevents the associates resource from The mode prevents the associates resource from being shared being shared • Share lock Share lock The mode allows the associated resource to be The mode allows the associated resource to be shared, depending on the operations involved shared, depending on the operations involved
  • 25.
  • 26.
    Types of Locks Typesof Locks Lock Lock Description Description DML locks DML locks (data locks) (data locks) DML locks protect data DML locks protect data For example, table locks lock For example, table locks lock entire tables, rowlocks lock entire tables, rowlocks lock selected rows. selected rows. DDL locks DDL locks (dictionary (dictionary locks) locks) DDL locks protect the DDL locks protect the structure of schema objects structure of schema objects Internal locks Internal locks and latches and latches Internal locks and latches Internal locks and latches protect internal database protect internal database structures such as datafiles structures such as datafiles
  • 27.
    Table Locks Table Locks •RS: row share RS: row share • RX: row exclusive RX: row exclusive • S: share S: share • SRX: share row SRX: share row exclusive exclusive • X: exclusive X: exclusive
  • 28.
    Data Lock Escalation DataLock Escalation • A transaction holds exclusive row locks for A transaction holds exclusive row locks for all rows inserted, updated, or deleted within all rows inserted, updated, or deleted within the transaction. Because row locks are the transaction. Because row locks are acquired at the highest degree of acquired at the highest degree of restrictiveness, no lock conversion is restrictiveness, no lock conversion is required or performed. required or performed. • Oracle automatically converts a table lock of Oracle automatically converts a table lock of lower restrictiveness to one of higher lower restrictiveness to one of higher restrictiveness as appropriate restrictiveness as appropriate
  • 29.
    MS SQL IsolationLevels MS SQL Isolation Levels Microsoft SQL Server 2005 Microsoft SQL Server 2005 Oracle Oracle SELECT ... WITH (UPDLOCK) SELECT ... WITH (UPDLOCK) SELECT... FOR UPDATE SELECT... FOR UPDATE READ COMMITTED with READ COMMITTED with snapshots snapshots READ COMMITTED READ COMMITTED SNAPSHOT SNAPSHOT SERIALIZABLE SERIALIZABLE SNAPSHOT SNAPSHOT READ ONLY READ ONLY READ UNCOMMITTED READ UNCOMMITTED No Equivalent No Equivalent READ COMMITTED with locking READ COMMITTED with locking No Equivalent No Equivalent REPEATABLE READ REPEATABLE READ No Equivalent No Equivalent SERIALIZABLE SERIALIZABLE No Equivalent No Equivalent
  • 30.
    DB2 Isolation Levels DB2Isolation Levels Isolation levels Isolation levels • Repeatable Read (RR) Repeatable Read (RR) • Read Stability (RS) Read Stability (RS) • Cursor Stability (CS) Cursor Stability (CS) • Uncommitted Read (UR) Uncommitted Read (UR) Levels of locking Levels of locking • Tablespace Tablespace • Table Table • Row Row
  • 31.
    Transactions in Oracle Transactionsin Oracle Въпроси? Въпроси?