Chapter 6 RAC Exam – Global Resource Management Concepts

Global Resource Background Processes
Atomic Control File to Memory Service (ACMS)
Atomic Control File to Memory Service (ACMS): In a RAC environment, the ACMS per- instance process is an agent that contributes to ensuring that a distributed SGA memory update is either globally committed on success or globally aborted if a failure occurs.
Global Resource Background Processes
Global Enqueue Service Monitor (LMON)
Global Enqueue Service Monitor (LMON): The LMON process monitors global enqueues and resources across the cluster and performs global enqueue recovery operations.
Global Resource Background Processes
Global Enqueue Service Daemon (LMD)
Global Enqueue Service Daemon (LMD): The LMD process manages incoming remote resource requests within each instance.
Global Resource Background Processes
Global Cache Service Process (LMS)
Global Cache Service Process (LMS): The LMS process maintains records of the data file statuses and each cached block by recording information in the GRD. The LMS process also controls the flow of messages to remote instances and manages global data block access and transmits block images between the buffer caches of different instances. This processing is part of the cache fusion feature.
Global Resource Background Processes
Instance Enqueue Process (LCK0)
Instance Enqueue Process (LCK0): The LCK0 process manages noncache fusion resource requests such as library and row cache requests.
Global Resource Background Processes
Global Cache/Enqueue Service Heartbeat Monitor (LMHB)
Global Cache/Enqueue Service Heartbeat Monitor (LMHB): LMHB monitors LMON, LMD, and LMSn processes to ensure that they are running normally without blocking or spinning.
Global Resource Background Processes
Result Cache Background Process (RCBG)
Result Cache Background Process (RCBG): This process is used for handling invalidation and other messages generated by server processes attached to other instances in Oracle RAC.
What is Remastering?
Remastering is the process of allocating control of the master metadata for a specific entity to another instance.

Remastering is not done immediately, it is done gradually, based on which instances are accessing which resources (hence the term “lazy”).

When an instance shuts down gracefully—meaning normal, immediate, or transactional— an optimized internal algorithm designed to minimize the remastering and subsequent concurrency control overheads.

What are two types of global resource coordination?
Global enqueue management
Global buffer cache management
What is Global enqueue management used for?
Global enqueue management, which is used for:
– Global enqueues
– Global instance locks
What is Global buffer cache management used for?
Global buffer cache management, which:
– *Is also known as cache fusion or global cache*
– Is a logical buffer cache spanning all instances
– Coordinates access to block images in the global cache
– Supports Parallel Query across the global cache
Explain the Global Enqueues process?
Processing starts in the requesting instance as follows:
1. A global enqueue request is made by a session.
2. The request is passed to LMD0 in the requesting instance.
3. The foreground waits for the request on event.
4. LMD0 determines the mastering instance.
5. LMD0 forwards the request to the mastering instance if required.
6. The mastering instance adds a new master resource if required.
– Process is made an owner, waiter, or converter as appropriate.
– Once the resource can be granted to the requestor, LMD0 in the mastering instance notifies LMD0 in the requesting instance.
7. When the resource is available, the foreground is posted by LMD0 in the requesting instance.
Explain what and how Instance Locks are used.
• Instance locks are used to represent which instance(s) has (have) control over an instance-wide structure:
– Row cache entries
– Library cache entries
– Result cache entries

• The owner, waiter, or converter on an instance lock is the LCK0 process.
– As long as the local LCK0 process in an instance owns the lock on a specific resource, any session in that instance can use the cached metadata, because it is considered current.
– If the local instance does not own the lock, then a request must be made for the lock and the *foreground waits on DFS Lock Handle wait event*.

What does Global cache management provide?
• A concurrency mechanism for multiple buffer caches
• An optimization of block access for reads
• An optimization of writes for dirty buffers
• A mechanism to optimize parallel queries
What are the Components of Global Cache Management?
• The LMSn processes
• Buffers
• Buffer headers
• Global Cache Master Resources
• Global Cache Shadow Resources
What are the 4 Global Cache Buffer States ?
Shared Current
Exclusive Current
Consistent Read
Past Image
Describe the Global Cache Buffer State of Shared Current
Shared Current: The buffer contains a block image that matches the one on disk. One or more instances may have images for the same block in SCUR state. After an instance has one in this state, cache fusion is used if another instance reads the same block for read purposes.
Describe the Global Cache Buffer State of Exclusive Current
Exclusive Current: The buffer contains a block image that is about to be updated, or has been updated. It may or may not have been written by the database writer. Only one instance may have an XCUR image for a block
Describe the Global Cache Buffer State of Consistent Read
Consistent Read: The buffer contains a block image that is consistent with an earlier point in time. This image may have been created in the same way as in single-instance databases, but copying a block into an available buffer and using undo to roll back the changes in order to create the older image. It may also get created by converting a block image from SCUR or PI.

– Consistent Read: CR
—— Built in the Instance
—— *Sent by cache fusion*
—— *Converted from SCUR or PI*

Describe the Global Cache Buffer State of Past Image
Past Image: The buffer contains a block image that was XCUR but then shipped to another instance using cache fusion. A later image of this block now exists in another buffer cache. Once DBWn writes the later image to disk from the other instance, the PI image becomes a CR image.

Past Image: PI
—— Converted from XCUR
—— Not normally written
—— *Converted to CR after later XCUR image is written*
—— *Multiple PI images may exist for same block in different buffer caches.*

What are the 6 Global Cache Management Scenarios for Single Block Reads
• Read from Disk
• Read – Read
• Read – Write
• Write – Write
• Write – Read
• Write to Disk
Explain the Global Cache Management Scenarios for “Read from Disk”
Read from Disk: Occurs when an I/O request occurs for a block that has no image in any buffer cache
Explain the Global Cache Management Scenarios for “Read – Read”
Read – Read: Occurs when a block image exists in at least one buffer cache in shared current state (SCUR), and another instance wishes to access the block for read
Explain the Global Cache Management Scenarios for “Read – Write”
Read – Write: Occurs when a block image exists in at least one buffer cache in shared current state (SCUR), and another instance wishes to access the block for update (XCUR)
Explain the Global Cache Management Scenarios for “Write – Write”
Write – Write: Occurs when a block image exists in one buffer cache in exclusive current state (XCUR), and another instance wishes to access the same block for write in exclusive current state (XCUR)
Explain the Global Cache Management Scenarios for “Write – Read”
Write – Read: Occurs when a block image exists in one buffer cache in exclusive current state (XCUR), and another instance wishes to access the block for read. The instance doing the read may get it in CR or in SCUR as will be described later.
Explain the Global Cache Management Scenarios for “Write to Disk”
Write to Disk: Occurs when DBWn writes a dirty buffer to disk. If the block was modified in multiple instances, then only the latest image will be written. This image will be (XCUR). All the older dirty images for the same block will be past images (PI).
What happens when multi-block read requests occur
– The instance doing the I/O must acquire resources for each block in the correct state
– This is done by LMSn coordination from the requesting instance to the LMSn on the mastering instance(s)
– *Different blocks in the same multi-block read may have
different mastering instances*
– *Dynamic remastering, described earlier, may help reduce the performance overhead*