- Global Resource Directory ( GRD)
RAC uses the Cache Fusion architecture to simulate a global SGA across all cluster nodes.
Access to blocks in the buffer cache needs to be coordinated for read consistency and write access, and enqueues to shared resources are now global across the cluster.
These two main concepts are implemented in the Global Cache Service (GCS), for accessing the common buffer cache; and the Global Enqueue Service (GES), for managing enqueues in the cluster.
Both GCS and GES work transparently to applications. The meta structure used internally is the previously mentioned Global Resource Directory (GRD),
which is maintained by the GCS and GES processes. The GRD is distributed across all nodes in the cluster and part of the SGA,
which is why the SGA of a RAC database is larger than a single instance's equivalent.
GRD is like a in-memory database which contains details about all the blocks that are present in cache. GRD is stored in SGA. Typically GRD contains following and more information :
#Data Block Address This is the address of data block being modified
# Location of most current version of data block
# Modes of data block
# Roles of data block
# SCN number of data block
# Image of data block : Could be current image or past image.
- GLOBAL CACHE SERVICE (GCS)
Global Cache Service (GCS) is the main component of Oracle Cache Fusion technology.
This is represented by background process LMSn, there can be max 10 LMS process for an instance.
# These are the main fonctions of GCS : The main function of GCS is to track the status and location of data blocks. Status of data block means the mode and role of data block
# GCS is also responsible for block transfer between the instances.
# GCS is the main mechanism by which cache coherency among "multiple cache" is maintained.
#GCS used to be called Dynamic lock Manager (DLM) in the previous versions of the database
- Global Enqueue Service GES
Global Enqueue Service (GES) tracks the status of all Oracle enqueuing mechanism.
This involves all non-cache fusion intra instance operations. GES performs concurrency control on dictionary cache locks,
library cache locks and transactions. If performs this operation for resources that are accessed by more then once instance.
Enqueue services are also present in single instance database.
These are responsible for locking the rows on a table using different locking modes.
LMON : Global Enqueue Service Monitorw
LMD global enqueue service daemon
A block is the least addressable unit of a database and it's on the disk. There is only one copy of a block in the database.
When a user requests a row in the block, the server process loads the entire block from the disk to the buffer cache and returns it to the user.
In the buffer cache, the buffer can be in various states, depending on how it was retrieved. When a user requests a buffer, it can be retrieved in one of the two modes:
# Consistent Read (CR) mode: when the buffer is requested to be simply be selected; not updated
# Current mode : when then buffer is requested for the intention of modifying it, even if actually not updated, e.g. in case of SELECT FOR UPDATE.
# Past image : It means that the block has been modified (and therefore is not CR) but modified again in another instance (therefore not Exclusive Current)
each block in a RAC instance has two queues:
# Grant Queue - the queue where the requesters are queued for the locks to be granted in a certain mode
# Convert Queue - the queue where the granted requests are queued to be notified to the requesters
When a process requests a lock to be downgraded or upgraded on a buffer, it must put a request in the Grant Queue,
When the request is filled, the process is moved to the convert queue to let it know that its request has been satisfied.
The queues for a particular block are kept in only one instance. This instance is known as the Master Instance of the block A block has only one master instance.
When any instance requests a lock on a specific buffer, it contacts the LMS process of the master instance via its own LMS process
The Global Resource Directory (GRD) is replicated across all instances and holds the information on
which is the master instance of a specific block; not who holds the lock.
select b.dbablk, r.kjblmaster master_node from x$le l, x$kjbl r, x$bh b
where b.obj = DataObjectId
and b.le_addr = l.le_addr
and l.le_kjbl = r.kjbllockp