Subscribe to Posts by Email

Subscriber Count

    696

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Number of locks that can acquire with parallel DML statements

Came across this good table while scrolling the documentation,

When you need to do a parallel DML and that involves partitions, give a serious thought about the DML locks that can acquire. Below table gives you a handy info for the same.

Source:- here

 

Type of Statement Coordinator Process Acquires: Each Parallel Execution Server Acquires:
Parallel UPDATE or DELETE into partitioned table; WHERE clause pruned to a subset of partitions or subpartitions 1 table lock SX
1 partition lock X for each pruned partition or subpartition
1 table lock SX
1 partition lock NULL for each pruned partition or subpartition owned by the query server process
1 partition-wait lock S for each pruned partition or subpartition owned by the query server process
Parallel row-migrating UPDATE into partitioned table; WHERE clause pruned to a subset of partitions or subpartitions 1 table lock SX
1 partition X lock for each pruned partition or subpartition
1 partition lock SX for all other partitions or subpartitions
1 table lock SX
1 partition lock NULL for each pruned partition or subpartition owned by the query server process
1 partition-wait lock S for each pruned partition owned by the query server process
1 partition lock SX for all other partitions or subpartitions
Parallel UPDATE, MERGE, DELETE, or INSERT into partitioned table 1 table lock SX
Partition locks X for all partitions or subpartitions
1 table lock SX
1 partition lock NULL for each partition or subpartition
1 partition-wait lock S for each partition or subpartition
Parallel INSERT into partitioned table; destination table with partition or subpartition clause 1 table lock SX
1 partition lock X for each specified partition or subpartition
1 table lock SX
1 partition lock NULL for each specified partition or subpartition
1 partition-wait lock S for each specified partition or subpartition
Parallel INSERT into nonpartitioned table 1 table lock X None

For example:-

Consider a table with 600 partitions running with a DOP of 100. Assume all partitions are involved in a parallel UPDATE or DELETE statement with no row-migrations.

The coordinator acquires:

  • 1 table lock SX
  • 600 partition locks X

Total server processes acquire:

  • 100 table locks SX
  • 600 partition locks NULL
  • 600 partition-wait locks S

-Hope this helps

Geek DBA

Comments are closed.