RAC FAQ For Interview
RAC FAQ For Interview
RAC stands for Real Application Clusters. It allows multiple nodes in a clustered system
to mount and open a single database that resides on shared disk storage. Should a single
system fail (node), the database service will still be available on the remaining nodes.
A non-RAC database is only available on a single system. If that system fails, the
database service will be down (single point of failure).
The Oracle Clusterware comprises several background processes that facilitate cluster
operations. The Cluster Synchronization Service (CSS), Event Management (EVM), and
Oracle Cluster components communicate with other cluster component layers in the other
instances within the same cluster database environment. These components are also the
main communication links between the Oracle Clusterware high availability components
and the Oracle Database. In addition, these components monitor and manage database
operations
The following list describes the functions of some of the major Oracle Clusterware
components. This list includes these components which are processes on Unix and Linux
operating systems or services on Windows.
Each instance has a buffer cache in its System Global Area (SGA). Using Cache Fusion,
Oracle RAC environments logically combine each instance's buffer cache to enable
the instances to process data as if the data resided on a logically combined, single
cache.
(The SGA size requirements for Oracle RAC are greater than the SGA
requirements for single-instance Oracle databases due to Cache Fusion.)
To ensure that each Oracle RAC database instance obtains the block that it needs to
satisfy a query or transaction, Oracle RAC instances use two processes, the Global Cache
Service (GCS) and the Global Enqueue Service (GES). The GCS and GES maintain
records of the statuses of each data file and each cached block using a Global Resource
Directory (GRD). The GRD contents are distributed across all of the active instances,
which effectively increases the size of the System Global Area for an Oracle RAC
instance.
After one instance caches data, any other instance within the same cluster database can
acquire a block image from another instance in the same database faster than by reading
the block from disk. Therefore, Cache Fusion moves current blocks between instances
rather than re-reading the blocks from disk. When a consistent block is needed or a
changed block is required on another instance, Cache Fusion transfers the block image
directly between the affected instances. Oracle RAC uses the private interconnect for
inter-instance communication and block transfers. The Global Enqueue Service Monitor
and the Instance Enqueue Process manages access to Cache Fusion resources as well as
enqueue recovery processing.
Most applications can be deployed on RAC without any modifications and still scale
linearly (well, almost).
However, applications with 'hot' rows (the same row being accessed by processes on
different nodes) will not work well. This is because data blocks will constantly be moved
from one Oracle Instance to another. In such cases the application needs to be partitioned
based on function or data to eliminate contention.
Benefits of RAC
• Windows Clusters
• Linux Clusters
• UNIX Clusters like SUN PDB (Parallel DB).
• IBM z/OS in SYSPLEX
When you use normal redundancy, Oracle Clusterware automatically maintains two
copies of the Oracle Cluster Registry (OCR) file and three copies of the Voting Disk file.
If you choose external redundancy for the OCR and voting disk, then to enable
redundancy, your disk subsystem must be configurable for RAID mirroring. Otherwise,
your system may be vulnerable because the OCR and voting disk are single points of
failure.
$ cp
$ORACLE_HOME/assistants/rconfig/sampleXMLs/ConvertToRAC.xml
racconv.xml
$ vi racconv.xml
$ rconfig racconv.xml
One can also use dbca and enterprise manager to convert the database to RAC mode.
• Make the software available on all computer systems that will run RAC. This can
be done by copying the software to all systems or to a shared clustered file
system.
• Each instance requires its own set of Redo Log Files (called a thread). Create
additional log files:
• Each instance requires its own set of Undo segments (rollback segments). To add
undo segments for New Nodes:
UNDO_MANAGEMENT = auto
UNDO_TABLESPACE = undots2
• Create the dictionary views needed for RAC by running catclust.sql (previously
called catparr.sql):
There are no difference between the way you start a normal database and RAC database,
except that a RAC database needs to be started from multiple nodes. The
CLUSTER_DATABASE=TRUE (PARALLEL_SERVER=TRUE) parameter needs to be
set before a database can be started in cluster mode.
In Oracle 10g one can use the srvctl utility to start instances and listener across the cluster
from a single node. Here are some examples:
BEGIN
IF dbms_utility.is_cluster_database THEN
dbms_output.put_line('Running in SHARED/RAC mode.');
ELSE
dbms_output.put_line('Running in EXCLUSIVE mode.');
END IF;
END;
/
Another method is to look at the database parameters. For example, from SQL*Plus:
You can keep track of active RAC instances by executing one of the following queries:
Starting with Oracle 9i, RAC can transfer blocks from one instance to another across the
interconnect* (cache fusion). This method is much faster than the old "pinging" method,
where one instance had to write the block to disk before another instance could read it.
*An interconnect is the high-speed, low latency communication link between nodes in a
cluster.
Pinging is the process whereby one instance requests another to write a set of blocks from
its SGA to disk so it can obtain it in exclusive mode. This method of moving data blocks
from one instance's SGA to another is extremely slow. The challenge of tuning
RAC/OPS is to minimize pinging activity.
Prior to Oracle 9i, network-clustered Oracle databases used a storage device as the data-
transfer medium (meaning that one node would write a data block to disk and another
node would read that data from the same disk), which had the inherent disadvantage of
lackluster performance. Oracle 9i addressed this issue, and RAC uses a dedicated
network-connection for communications internal to the cluster.
Since all computers/instances in an RAC access the same database, the overall system
must guarantee the coordination of data changes on different computers such that
whenever a computer queries data it receives the current version — even if another
computer recently modified that data. Oracle RAC refers to this functionality as Cache
Fusion. Cache Fusion involves the ability of Oracle RAC to "fuse" the in-memory data
cached physically separately on each computer into a single, global cache.
Oracle enables you to administer a cluster database as a single system image through
Enterprise Manager, SQL*Plus, or through Oracle RAC command-line interfaces such as
Server Control (SRVCTL). You can also use several tools and utilities to manage your
Oracle RAC environment and its components as follows:
A: Oracle Cluster File System (OCFS) is a shared file system designed specifically for
Oracle Real Application Clusters (RAC). OCFS eliminates the requirement for Oracle
database files to be linked to logical drives. OCFS volumes can span one shared disk or
multiple shared disks for redundancy and performance enhancements.
OCFS is designed to provide an alternative to using raw devices for Oracle 9iRAC.
Managing raw devices is usually a difficult task.
A cluster file system allows a number of nodes in a cluster to concurrently access a given
file system. Every node sees the same files and data. This allows easy management of
data that needs to be shared between nodes.
A:No.
With NFS, the file system is hosted by one node; the other nodes must access the file
system via the network.
On NFS there is a single point of failure and slow data throughput. With OCFS the
File system is natively mounted on all nodes.
A: OCFS on Linux implements most of the features of a generic cluster file system.
For Oracle9i Real Application Clusters customers, OCFS will eliminate the need to
manage and set up raw devices, making cluster database administration much easier
as it looks and feels just like a regular file system. With Raw Devices it is possible to
have a maximum of 255 raw partitions, on OCFS there are no limit on number of
files.
Moreover, with a shared file system, the different instances of the database can share
archive logs, which makes media recovery much more convenient because every
node has access to all archived log file when needed.
Known Limitations: at this time Oracle Cluster File System supports Oracle Datafiles.
This includes Redo Log files, Archive log files, Controlfiles and database Datafiles.
The shared quorum disk file for the cluster manager and the shared init file (srv) are
also supported.
ASM Features
PURPOSE
-------
Automatic Storage Management is a file system and volume manager built
into the database kernel that allows the practical management of
thousands of disk drives with 24x7 availability.
One portion of the ASM code allows for the start-up of a special
instance called an ASM Instance. ASM Instances do not mount databases,
but instead manage the metadata needed to make ASM files available to
ordinary database instances.
Both ASM Instances and database instances have access to some common
set of disks.
ASM Instances manage the metadata describing the layout of the ASM
files. Database instances access the contents of ASM files directly,
communicating with an ASM instance only to get information about the
layout of these files. This requires that a second portion of the ASM
code run in the database instance, in the I/O path.
Note:
1. One and only one ASM instance required per node. So you might have
multiple databases, but they will share the same single ASM.
HOW TO USE ?
------------
Preinstall:
Here DBA will create the ASM volume, so Sysadmin should give the
ownership or proper privs to DBA.
Example in LINUX
----------------
If not:
Set owner, group and permission on device file for each raw device:
So from DBCA you can see the device "raw1" and "raw2".