One, Oracle's transactions:
Refers to a series of actions for data manipulation. That is, the task of a transaction is to transform a database from one state to another, unlike a file system, which is a database-specific use.
There are four major characteristics of transactions (ACID):
1, atomicity (atomicity),
All tasks in the transaction either succeed or fail altogether. Cannot be partial success, partial failure. For example, bank transfer, A to B transfer 200 yuan, a account balance of 200 yuan, B account balance more than 200 yuan. Cannot appear a account less 200 yuan and B account balance not more than 200 yuan.
2, consistency (consistency),
A transaction transforms a database from a consistent state into the next consistent state.
such as transfers, A and B accounts have successfully updated the balance, the transfer operation is successful, if any one operation occurs and the other does not occur, it will result in inconsistent data, and the use of transactions to ensure data consistency.
3, Isolation (isolation),
The impact of a transaction is not visible to other transactions until the transaction is committed to the database. such as transfer, when the balance of a account is reduced, because the account has not been updated, the transaction is not submitted, other users in view a account, will not see a account balance has been reduced, only when the transfer successfully completed, will see the effect, This makes the transaction appear as if it were serially executed.
4, persistence (durability),
Once a transaction is committed, the changes it makes are permanent.
The database uses its recovery mechanism to ensure that changes made in the transaction are not lost.
Several situations where the transaction ends:
1, the transaction is committed or rolled back when the Commit,rollback statement is encountered.
2, when the user exits the Oracle tool,
3, when the machine fails or the system crashes.
Second, the management of affairs
Commit, commit from the last commit or rollback, all current changes, and release all locks
Rollback, rollback from last commit or rollback, all current changes, and release all locks
Rollback to savepoint, rollback changes to a saved savepoint and frees all locks within that range
SavePoint, establish a savepoint that allows partial rollback operations to be completed.
Set transaction, which allows you to start a read-only or read-write reply, establish an isolation level, or assign the current transaction to a specific rollback segment
Lock table, which allows the use of a specific pattern to lock the entire database table, overrides the default row-level lock,
Commit a transaction using commit:
Oracle's Business