O'Reilly logo

Oracle Parallel Processing by Sanjay Mishra, Tushar Mahapatra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PCM Lock Types

PCM locks are classified based on the following two criteria: lock granularity and a combination of lock acquisition and retention. Lock granularity refers to the number of data blocks protected by one PCM lock. Lock acquisition and retention refers to the method by which an instance acquires the locks. Locks may be acquired only once, at the time of instance startup, or they may be acquired and released as needed.

Lock Granularity

One PCM lock can protect one or more data blocks. The number of blocks covered by a PCM lock is referred to as the lock’s granularity . The greater the number of blocks covered by one lock, the coarser the granularity. The lesser the number of blocks covered by one lock, the finer the granularity. Based on granularity, PCM locking approaches may be classified as either hashed locking or fine-grained locking. With hashed locking, one PCM lock protects more than one block, whereas with fine-grained locking, one PCM lock protects only one block.

Hashed locking

Coarse granularity in locking increases the likelihood of lock contention because each lock protects many blocks. For a large transaction that’s accessing many blocks, the lock overhead may be less with coarse granularity locking because fewer locks may need to be acquired or converted. With coarse granularity locking, a hash function is used to associate locks to blocks. Therefore, this type of locking is referred to as hashed locking .

As you will see later in this chapter, PCM locks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required