Tuesday, June 12, 2007

Oracle 10g Real Application Cluster Concept



Very recently I installed two node Oracle 10g RAC Database using ASM on Oracle Enterprise Linux 4.0. I had to struggle for almost two weeks to get it done and finally I was successful. Before I jump to explain installation part of 10g RAC Database using ASM , I would like to discuss basic concept and understanding of Oracle Real Application Cluster. Whenever we think about RAC first questions comes to our mind is what is Cluster?

What is Cluster?

A Cluster is combination of more than one connected computer (or server). From applications prospective it seems to be single server processing applications requests. Multiple connected servers refer to physical files stored on shared area and are interconnected using physical network.

Oracle Real Application Cluster

Oracle Real Application Cluster is software that is installed on all interconnected server running on same operating system. It acts as if they were single server. Oracle clusterware has two components, a voting disk and OCR (Oracle Cluster Registry). A voting disk keeps record of all nodes’ membership whereas OCR keeps track of cluster configuration. These two component Voting disk and OCR must be on shared storage, which can be access by all interconnected cluster servers. As part of Oracle cluster ware each server (node) should be connected to private network as private interconnect. Oracle Real Application cluster provides feature to run multiple instance on various node on single database.

Advantage of Oracle Real Application Cluster

Oracle RAC is mainly for high availability. If one node goes down connection would get routed through other server. Service can be configured to run against multiple nodes so if one node goes down it would switch over to another node. You can add various nodes to increase processing power and you can remove node when you do not use node for processing any more. Services load management happens automatically across various nodes. RAC allows more concurrent batch process, great parallel execution with more degree of parallelism. It also allows more number of user connections.

Oracle Cluster Software Processes

There are several Oracle Cluster background processes for cluster related operations. Cluster background process are given below.

  • Cluster Synchronization Services (CSS)
This background process manages oracle cluster configuration file. It keeps record of all nodes which are cluster members and inform other members when a node (server) join cluster or leaves the cluster. If cluster is from third party, then CSS process interacts and interfaces with clusterware to keep track of node information and manage node.
  • Cluster Ready Services (CRS)

CRS manages high availability within a cluster. CRS manage cluster resources which are database, instance, service, listener, a virtual IP(VIP address), application process etc. CRS refers resource’s configuration information that is stored in the OCR (Oracle Cluster Registry) on the shared storage to manage start, stop, monitor, failover operations clusterware resources (database, instance, service, listener, VIP).

  • Event Management (EVM)
This process publishes events that crs creates. The evm process scans a designated directory and invokes all of the scripts in that directory when an even occurs.
  • Oracle Notification Services (ONS)
ONS publishes and subscribes services for communication Fast Application Notification (FAN) events.
  • RACG
Helps clussterware to support Oracle-Specific requirements and complex resources. Runs server callout scripts when FAN events occurs.
  • Process Monitor Daemon (OPROCD)
This process is locked in memory to monitor the cluster and provide I/O fencing. OPROCD performs its check, stops running. If the wake up is beyond the expected
time, then OPROCD resents the processor and reboots the node. An OPROCD failure results in the Oracle Clusterware restarting the node. OPROCD uses the hangcheck
timer on Linux platforms.
Oracle Real Application Cluster Physical Files and Cluster Processing

In Oracle RAC database all datafiles, controlfiles, PFILEs(SPFILE) and redo log files must reside on shared disk, which should be cluster compatible. So cluster node can access these physical file stored on cluster aware shared storage area.

A RAC database can have maximum 100 instances. Each RAC database has at least one additional thread of redo for each instance and undo talbespace for individual instance. For shared store following option can be used.
  • OCFS (Oracle Cluster File System)
  • A network file system
  • Raw devices
  • ASM à Oracle recommends to use ASM

RAC database has more than one instance. Each oracle RAC instance has its own memory and background process. RAC database has some additional memory structure and background processes than non RAC single instance database.

RAC instance uses bigger cache in SGA. It uses Cache Fusion so SGA size for RAC database is more than SGA size of single instance database.

To ensure data integrity for individual RAC instance, RAC use to background processes, GCS (Global Cache Service) and GES (Global Enqueue Service) . The Global Cache Service and Global Enqueue Service maintain records/status of each data file and each cached block using a GRD (Global Resource Directory).

Global Resource Directory contents are distributed across all the active instances, which increases SGA size of a RAC instance.

When one of RAC instance caches data, other same RAC database instance can obtain a block from this instance instead of reading the block from disk. Cache Fusion moves current blocks between instances rather re-reading the block from disk. If changed block is needed by another RAC instance, Cache Fusion transfers the block image directly between affected instances.

Real application uses private interconnect to communicate between instances and to transfer block. The GES monitor and the Instance Enqueue Process manages access to Cache Fusion resource and enqueue recovery.

There are additional background process for RAC instance which are used to maintain database coherency among each instance. They manage global resources:

  • LMSx – Global Cache Service Process, where x can range from 0 to j
  • LMD0 – Global Enqueue Service Daemon
  • LMON – Global Enqueue Service Monitor
  • LCK0 – Instance Enqueue Process
  • DIAG – Diagnosiblity Process


2 comments:

Anonymous said...

simply gr8 !! :)

Anonymous said...

Well said.