On the lock and latch of Oracle

Source: Internet
Author: User

First, let's talk about what they have in common: they are essentially exclusive locks on resources that are caused by concurrency (if the database has only one session, it's not locked).

Then focus on the different points:

First of all, their purpose is different, enqueue (that is, lock,oracle official documents mixed with these two nouns, in the waiting event, you can see a lot of enqueue, in fact, lock) is to solve the business level of data contention, and latch is to resolve the contention of memory resources.

Second, they run in a different way, enqueue in a queuing way, first-come first-served, and latch competition is almost disorderly, in a random way, first to not necessarily first, have to rely on the Rob, and it also a time slice rotation way, will not always occupy, immediately not run out, time film one to also.

Third, the duration of the session is different, enqueue may hold longer depending on the business situation, while the latch is usually very short. Four, the cause is not the same, enqueue too much is usually a business design problem, and latch too much, is generally a database-level problem (such as not using binding variables, table or index hot block, etc.).

See more Highlights: http://www.bianceng.cn/database/Oracle/

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.