Transaction Control for database learning and database learning transactions

Source: Internet
Author: User

Transaction Control for database learning and database learning transactions

Transaction Overview:
1. transactions are databasesConcurrency ControlAndRestoration TechnologyBasic Unit;
2. transactions have four features: atomicity, consistency, isolation, and durability;
3. transactions are a collection of database operations and are composed of a group of related SQL statements;
Oracle transaction isolation level:
Oracle Database provides two levels of isolation for transactions.
1,Read commited:
(1) The query operation performed by each firm can only obtain data that has been committed before the query starts (not before the transaction starts.
(2) It can prevent loss of modifications and dirty reads, but cannot prevent repeated reads.
(3) If the data is locked, wait for other transactions to unlock;
2,Serializable:
(1) Each transaction can only see the data submitted before the transaction starts;
(2) Prevents Loss of modifications, dirty reads, and non-repeated reads;
(3) If the data is locked, no wait and an error is returned;
3,Read-only:
(1) Each transaction can only see the data submitted before the transaction starts, and cannot add, delete, modify, or delete the data in the transaction;
You can refer to the Manual for details on how to modify the transaction isolation level;

Oracle transaction processing:
In the Oracle database,Transaction commitThere are two methods:
One way is to execute the commit command;
The other method is that the system automatically submits a specific operation:
When you execute the create, alter, drop, rename, revoke, grant, connect, disconnect, and other commands, the system will automatically submit them.
Transaction rollback:
If you only want to cancel some operations in the transaction, instead of canceling all operations, you can set a storage point within the transaction to divide a large transaction into several components, in this way, the transaction can be rolled back to the specified storage point.
You can use the savepoint statement to set the save point..

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.