Related knowledge of transactions

xiaoxiao2021-03-06  49

The user session is only a connection to the database to the database, and the user's operation of the database is performed by one of the sessions. The management of the transaction is more than just DBA tasks, and users who publish transactions can manage their own transactions.

The beginning of the transaction: The transaction in Oracle is encountered by the first SQL statement starts. DDL (Data Definition Language) DML (Data Manipulation Language)

The end of the transaction: • User Execute a CommT or Rollback statement · The user performs a DDL statement, such as Create, Drop, Rename, Alter. If the current transaction contains the DML statement that has already been executed, Oracle first submits the transaction, and then executes the DDL statement as a new transaction containing only one statement and submits. · The user actively disconnects to Oracle's connection. · User processes accidentally stop.

Work completed before committing transactions: • Generate the retreat entry of the transaction in the back of the SGA area. The original version of the data modified by the transaction is saved in the return entry. • Re-record the transaction is generated in the redo log cache in the SGA area. The transaction records modifications to the data block are described in the recording, and modifications to the data blocks in the retraction section are also described. The redo record in the cache is possible to write to the hard disk before transaction commit. · The transaction to the database is recorded in the database buffer in the SGA area. These modifications may also be written to the hard drive before transaction commit.

Work completed while submitting a transaction: • This transaction has been submitted in the internal transaction table in the retracted section specified in the transaction, and generates a unique SCN record in the internal transaction table for unique identity. . • The LGWR rear process writes the redo record in the SGA area to log cache. The SCN of the transaction will be written while writing redo logs. · Oracle service process release all record locks and table locks used by the transaction. • Oracle notifies the user's transaction commit completion. · Oracle marks the transaction as completed.

Retreat the work of retreating: • Oracle revokes all SQL statements to the database to the database by using the rollback entry in the retreat section. · All locks used by Oracle Service Process Release Series have successfully retired. · Oracle marks the transaction as completed

Servel Isolation Level: (Servers = Dedicated) Set Transaction Isolation Level Read CommittedSet Transaction Level Serializableset Transaction Read OnlySet Transaction Read Write

Alter session set isolation_level = serializablealter session set isolation_level = read commit

Read consistency work mechanism: Set the SCN: 10023 of the query statement when searching the data blocks required, if the SCN <= 10023 of the required data block is read. If the SCN> 10023 of the required data block, the query statement will obtain the original version of the corresponding data block from the retreat section (the SCN of the original version is also <= 10023), compare the SCN of the data block, query statement The data that only returns only before it starts to execute, ensuring that the dirty data blocks that do not submit transactions are not submitted, nor does it read the data blocks submitted after execution of the statement.

Define private return segments set Transaction use rollback segment xxx

转载请注明原文地址:https://www.9cbs.com/read-82569.html

New Post(0)