Example of all Oracle locks

Source: Internet
Author: User

The following articles mainly introduce the working mechanism of Oracle locks and the introduction of Oracle locks. The actual proportion of Oracle locks is still the majority. If you are curious about it, the following articles will unveil its mysteries. Hope you can learn from it.

0-none

1-null (NULL)

2-row-S (SS)

3-row-X (SX)

4-share (S)

5-S/Row-X (SSX)

6-exclusive (X)

0-None

1-NULL)

2-row sub-Sharing Mode SS)

3-row sharing mutex mode SX)

4-Shared Mode S)

5-row-Child shared mutex Mode

6-mutex mode X)

Type and description of Oracle locks caused by DML operations:

 
 
  1. Operation Lock Mode LMODE Lock Description  
  2. ------------------------- ---------- ------ -----------------  
  3. Select NULL 1 null  
  4. Select for update SS 2 sub share  
  5. Insert SX 3 sub exclusive  
  6. Update SX 3 sub exclusive  
  7. Delete SX 3 sub exclusive  
  8. Lock For Update SS 2 sub share  
  9. Lock Share S 4 share  
  10. Lock Exclusive X 6 exclusive  
  11. Lock Row Share SS 2 sub share  
  12. Lock Row Exclusive SX 3 sub exclusive  
  13. Lock Share Row Exclusive SSX 5 share/sub exclusive  
  14. Alter table X 6 exclusive  
  15. Drop table X 6 exclusive  
  16. Create Index S 4 share  
  17. Drop Index X 6 exclusive  
  18. Truncate table X 6 exclusive  
  19. -----------------------------------------------------------  

Compatibility of Oracle locks. YES indicates that locks can exist together, and NO indicates mutual exclusion.

 
 
  1. NULL SS SX S SSX X  
  2. ------ ---- ---- ---- ----- ----  
  3. NULL| YES YES YES YES YES YES  
  4. SS | YES YES YES YES YES NO  
  5. SX | YES YES YES NO NO NO  
  6. S | YES YES NO YES NO NO  
  7. SSX | YES YES NO NO NO NO  
  8. X | YES NO NO NO NO NO   

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.