Oracle Database Transaction Features and usage instructions, oracle Database
Oracle Database transactions
1. What is a transaction?
A transaction in a database is a logical unit of work. A transaction is composed of one or more SQL statements that complete a group of related behaviors, the transaction mechanism ensures that all the operations performed by this SQL statement are either successfully executed, and the whole unit of work is completed or not executed.
For example, online transfer is typically handled by transactions to ensure data consistency.
2. Transaction Features
① Atomicity: All SQL statements contained in a transaction are an execution whole, which is inseparable, either done or not done.
② Consistency: at the beginning of the transaction, the data in the database is consistent, and at the end of the transaction, the data in the database should also be consistent.
③ Isolation refers to the ability of the database to allow multiple concurrent transactions to read, write, and modify the data in it at the same time. Isolation can prevent concurrent execution of transactions, data inconsistency caused by cross-execution of their operation commands.
④ Durability: after a transaction ends, it has a permanent impact on the database. Even if the system encounters a fault, data will not be lost.
To operate a group of SQL statements into transactions, the database management system must ensure the Atomicity, consistency, Isolation, and Durability of these operations ), this is the ACID feature.