How Oracle starts and shuts down-transaction commit or rollback

Source: Internet
Author: User
Tags closing tag


4. Business

4.1 Concept of the business

Starting with the first DML statement, either rollback or commit is the closing tag, and all previous DML operations (Insert,update,delete) are within the scope of the transaction.



4.2 Commit operations for a transaction

(1) First unlock a user and change the password

sql> alter user Scott account unlock;

User altered.

Sql> alter user Scott identified by Scott;

User altered.

(2) Connect to Scott Users
Sql> Conn Scott/scott;
Connected.

(3) Create a TT table
Sql> CREATE TABLE TT (
2 ID Number
3);

Sql> INSERT INTO TT values (1);

1 row created.

Sql> select * from TT;

Id
----------
1

Sql> INSERT INTO TT values (2);

1 row created.

Sql> select * from TT;

Id
----------
1
2

Sql> commit; --This is the end of a transaction

Commit complete.

---------------------------------this is another business.

sql> Update TT set id=3 where id=2;

1 row updated.

Sql> select * from TT;

Id
----------
1
3

sql> rollback; --this business ends here.

Rollback complete.

Sql> select * from TT;

Id
----------
1
2


Two questions:

(1). Committed transactions are not necessarily written on the disk inside
Not necessarily? Because the system reads and writes are asynchronous, the submitted data may still be in the dirty block list, when there are enough dirty blocks
The DBWN process will not write a batch of dirty block information into the disk.

(2). No committed transaction is not written to disk
Not necessarily? Because of the limited space of the dirty list, if a large number of changes are made to the data at one time, a lot of dirty blocks will be out of the dirty block
The length of the linked list, at which time the DBWN process writes the dirty block information to the disk, and if the user commits, the data is already written into the disk,
If the user does a rollback, then Oracle will use the Undo table space to roll back the old mirror to the previous
Restore the rest of the drive back to the disk.

How Oracle starts and shuts down-transaction commit or rollback

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.