This is an excerpt from the bestselling book
Oracle Grid & Real Application Clusters. To get immediate
access to the code depot of working RAC scripts, buy it
directly from the publisher and save more than 30%.
Multi-node Oracle RAC systems
are comprised of multiple instances with each instance residing on
an individual node or server. Each Oracle instance in the cluster
has a dedicated set of memory structures including background
processes and system global areas (SGA) that exist irrespective of
another node?s instance. Thus, each node?s instance has its local
buffer cache. When applications or users connect and process their
SQL operations, they primarily connect to one of the nodes. When the
user processes fetch and access data blocks, the scope of such
activity is confined to the SGA of the connected instance.
However, as the database is
mounted with multiple instances, data blocks may exist on any of the
instances or any instance may fetch the data blocks as needed by the
user processes. In other words, when a user process is looking for a
set of data blocks to satisfy the SQL operation requirement, the
same set of blocks or some of the blocks may already be available in
another node?s instance. This highlights an important fact of a RAC
system. As opposed to a single stand-alone Oracle instance, there
are multiple server locations in a RAC system where data blocks
reside. Thus, there are several cache buffers dealing with the same
physical database objects.
This is where the method of
cache fusion plays a key role. For all practical purposes, multiple
buffer caches join and act as if they were a single entity. As shown
in Figure 7.1, cache buffers from three nodes are fused together to
form a single entity and share data blocks. Maintaining consistency
among the cached versions of data blocks in multiple instances is
called cache coherency. Cache fusion treats multiple buffer caches
as one joint global cache, solving data consistency issues
internally, without any impact on the application code or design.
Figure 7.1: Global Cache ? Cache
Fusion in a three-node cluster
Benefits of Cache Fusion
Oracle RAC, with its multiple
instances, is able to provide more resources through multiple system
global areas (SGA). Cache fusion technology makes it easier to
process a very high number of concurrent users and SQL operations
without compromising data consistency. It adheres to Oracle?s
multi-version consistency model and ensures data integrity and data
consistency across the instances.
Cache fusion in 9i, implemented
fully, creates an environment where users are able to utilize any
instance in the cluster without giving undue preference for a
particular instance. There is no need for the extra effort of
partitioning data access across nodes, as required in earlier
versions of parallel servers. Load balancing is more effective in
such an environment.
As a result, very high
scalability of database performance can be achieved simply by adding
nodes to the cluster. RAC also enables better database capacity
planning and conserves capital investment by consolidating many
databases on a single large database, thus reducing administrative
overhead.
Another advantage realized with
cache fusion technology is that applications no longer need to be
partitioned according to data access patterns. This was necessary in
earlier versions of Oracle parallel databases in order to avoid or
reduce data-block pinging. A scalable application on a single-node
Oracle server will be just as flexible on a multi-node RAC, even in
different workload situations.
However, scalability performance
may be better with a workload of minimal cross-instance block
transfers (OLTP operations) compared to a workload of large
cross-instance block transfers. Where there is a large
cross-instance transfer of resources, there is a certain overhead
due to lock conversions and block transfers from one cache to
another.
The advantage of improved load
balancing can be used to leverage application performance. User
connections can randomly access any instance in the cluster.
Depending on the node capacity, instances can be balanced
effectively. Contention for server resources, such as the CPU and
memory, is reduced.