In an Oracle Real Application Clusters (RAC) environment, multiple database instances run on different nodes but access the same database. To maintain data consistency and coordination between instances, Oracle uses an internal structure called the Global Resource Directory (GRD).
The GRD is an in-memory data structure distributed across all RAC instances that keeps track of where database blocks are cached and who currently owns them.
It plays a critical role in Oracle Cache Fusion, enabling instances to share blocks directly through the cluster interconnect instead of reading them from disk.
What Information Does the GRD Maintain?
The Global Resource Directory tracks several important details about database blocks:
• Which blocks are cached in which instance
• The current status of each block (Shared or Exclusive mode)
• Ownership information (which instance can modify the block)
• Lock and access metadata used by cluster services
These details are used by two important Oracle RAC services:
• Global Cache Service (GCS)
• Global Enqueue Service (GES)
Together they ensure data integrity and cache coherency across nodes.
How GRD Works in Oracle RAC
Let’s understand the process with a simple example.
Step 1: Instance A Reads a Block
Instance A reads Block X from disk and loads it into its buffer cache.
The GRD updates the information:
Block X → Held in Shared Mode by Instance A
Step 2: Instance B Wants to Update the Same Block
Now Instance B wants to update Block X.
GRD checks its metadata and finds:
Instance A already has Block X cached.
Instance B therefore requests Exclusive Access.
Step 3: GRD Coordinates the Transfer
The Global Cache Service (GCS) performs the following:
• Sends a message to Instance A
• Instance A ships the latest block to Instance B
• Instance A downgrades or releases its copy
• GRD updates the ownership information
Now:
Block X → Exclusive Mode with Instance B
What is Cache Fusion?
This entire process is called Cache Fusion.
Instead of writing blocks back to disk and reading them again, Oracle RAC transfers blocks directly between instances through the interconnect network.
This makes RAC much faster and more efficient.
Key Components Involved
1. Global Resource Directory (GRD)
The GRD stores metadata about all cluster resources such as:
• Block ownership
• Access mode
• Lock information
2. Global Cache Service (GCS)
GCS manages data block coordination across instances.
Responsibilities include:
• Block transfers
• Cache coherency
• Maintaining read/write access modes
3. Global Enqueue Service (GES)
GES manages non-cache resources, including:
• Library cache locks
• Dictionary locks
• Other enqueue mechanisms
Use Cases of GRD in Oracle RAC
1. Read Consistency Across Nodes
If multiple RAC nodes read the same data block, the GRD ensures each instance receives the correct block version without accessing disk repeatedly.
2. DML Operations Across Instances
Suppose:
Node 1 updates a block that Node 2 recently read.
GRD and GCS work together to:
• Transfer the block via Cache Fusion
• Grant exclusive access to Node 1
• Maintain data consistency
3. Parallel Queries Across RAC
Large parallel queries often run across multiple RAC nodes.
GRD ensures:
• Each node accesses the correct block
• Access modes are properly maintained
• No data conflicts occur
Important Considerations
1. GRD is Memory Based
The GRD resides in the SGA of each RAC instance and is distributed across nodes.
2. GRD is Not Persistent
GRD metadata is not stored on disk.
It is automatically rebuilt when the RAC instance starts.
3. Block Ping-Pong Issue
Frequent block transfers between nodes can create interconnect overhead.
This phenomenon is called Block Ping-Pong.
To reduce this issue, DBAs use techniques like:
• Instance affinity
• Table partitioning
• Sequence caching
• Application workload balancing
Conclusion
The Global Resource Directory (GRD) is a fundamental component of Oracle RAC that enables efficient communication and coordination between cluster nodes.
By tracking block ownership and coordinating access through GCS and GES, GRD ensures that:
• Data remains consistent across instances
• Blocks are transferred efficiently using Cache Fusion
• RAC environments maintain high availability and performance
Understanding GRD is essential for Oracle RAC DBAs, especially when troubleshooting performance issues like block contention or interconnect traffic.