Sunday, November 3, 2013

RAC Concepts - Part : A


Note:  Proofread any scripts before using. Always try scripts on a test instance first. This Blog is not responsible for any damage.

Part - A

1. What is the major difference between 10g and 11g RAC?
Well, there is not much difference between 10g and 11gR (1) RAC. But there is a significant difference in 11gR2.
Prior to 11gR1(10g) RAC, the following were managed by Oracle CRS

From 11gR2(onwards) its completed HA stack managing and providing the following resources as like the other cluster software like VCS etc.

  • Databases
  • Instances
  • Applications
  • Cluster Management
  • Node Management
  • Event Services
  • High Availability
  • Network Management (provides DNS/GNS/MDNSD services on behalf of other traditional services) and SCAN – Single Access Client Naming method, HAIP
  • Storage Management (with help of ASM and other new ACFS filesystem)
  • Time synchronization (rather depending upon traditional NTP)
  • Removed OS dependent hang checker etc, manages with own additional monitor process
 
2.  What are Oracle Cluster Components?
  • Cluster Interconnect (HAIP)
  • Shared Storage (OCR/Voting Disk)
  • Clusterware software

3. What are Oracle RAC Components?
VIP, Node apps etc.

4. What are Oracle Kernel Components (nothing but how does Oracle RAC database differs than Normal single instance database in terms of Binaries and process)
Basically Oracle kernel need to switched on with RAC On option when you convert to RAC, that is the difference as it facilitates few RAC bg process like LMON,LCK,LMD,LMS etc.

To turn on RAC
# link the oracle libraries
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk rac_on
# rebuild oracle
$ cd $ORACLE_HOME/bin
$ relink oracle

  • Oracle RAC is composed of two or more database instances. They are composed of Memory structures and background processes same as the single instance database.Oracle RAC instances use two processes GES(Global Enqueue Service), GCS(Global Cache Service) that enable cache fusion.Oracle RAC instances are composed of following background processes:
    •    ACMS     Atomic Controlfile to Memory Service (ACMS)
    •    GTX0-j   Global Transaction Process
    •    LMON     Global Enqueue Service Monitor
    •    LMD      Global Enqueue Service Daemon
    •    LMS      Global Cache Service Process
    •    LCK0     Instance Enqueue Process
    •    RMSn     Oracle RAC Management Processes (RMSn)
    •    RSMN     Remote Slave Monitor

5. What is Clusterware?
Software that provides various interfaces and services for a cluster. Typically, this includes capabilities that:

  • Allow the cluster to be managed as a whole
  • Protect the integrity of the cluster
  • Maintain a registry of resources across the cluster
  • Deal with changes to the cluster
  • Provide a common view of resources

6. What are the background process that exists in 11gr2 and functionality?

Process Name Functionality
crsd •The CRS daemon (crsd) manages cluster resources based on configuration information that is stored in Oracle Cluster Registry (OCR) for each resource. This includes start, stop, monitor, and failover operations. The crsd process generates events when the status of a resource changes.
cssd •Cluster Synchronization Service (CSS): Manages the cluster configuration by controlling which nodes are members of the cluster and by notifying members when a node joins or leaves the cluster. If you are using certified third-party clusterware, then CSS processes interfaces with your clusterware to manage node membership information. CSS has three separate processes: the CSS daemon (ocssd), the CSS Agent (cssdagent), and the CSS Monitor (cssdmonitor). The cssdagent process monitors the cluster and provides input/output fencing. This service formerly was provided by Oracle Process Monitor daemon (oprocd), also known as OraFenceService on Windows. A cssdagent failure results in Oracle Clusterware restarting the node.
diskmon •Disk Monitor daemon (diskmon): Monitors and performs input/output fencing for Oracle Exadata Storage Server. As Exadata storage can be added to any Oracle RAC node at any point in time, the diskmon daemon is always started when ocssd is started.
evmd •Event Manager (EVM): Is a background process that publishes Oracle Clusterware events
mdnsd •Multicast domain name service (mDNS): Allows DNS requests. The mDNS process is a background process on Linux and UNIX, and a service on Windows.
gnsd •Oracle Grid Naming Service (GNS): Is a gateway between the cluster mDNS and external DNS servers. The GNS process performs name resolution within the cluster.
ons •Oracle Notification Service (ONS): Is a publish-and-subscribe service for communicating Fast Application Notification (FAN) events
oraagent •oraagent: Extends clusterware to support Oracle-specific requirements and complex resources. It runs server callout scripts when FAN events occur. This process was known as RACG in Oracle Clusterware 11g Release 1 (11.1).
orarootagent •Oracle root agent (orarootagent): Is a specialized oraagent process that helps CRSD manage resources owned by root, such as the network, and the Grid virtual IP address
oclskd •Cluster kill daemon (oclskd): Handles instance/node evictions requests that have been escalated to CSS
gipcd •Grid IPC daemon (gipcd): Is a helper daemon for the communications infrastructure
ctssd •Cluster time synchronisation daemon(ctssd) to manage the time syncrhonization between nodes, rather depending on NTP

7. Under which user or owner the process will start?

Component Name of the Process Owner
Oracle High Availability Service ohasd init, root
Cluster Ready Service (CRS) Cluster Ready Services root
Cluster Synchronization Service (CSS) ocssd,cssd monitor, cssdagent grid owner
Event Manager (EVM) evmd, evmlogger grid owner
Cluster Time Synchronization Service (CTSS) octssd root
Oracle Notification Service (ONS) ons, eons grid owner
Oracle Agent oragent grid owner
Oracle Root Agent orarootagent root
Grid Naming Service (GNS) gnsd root
Grid Plug and Play (GPnP) gpnpd grid owner
Multicast domain name service (mDNS) mdnsd grid owner

8. What is startup sequence in Oracle 11g RAC? 11g RAC startup sequence?
  
11g Grid Infrastructure (RAC): CRS Startup Sequence

This is about to understand the startup sequence of Grid Infrastructure daemons and its resources in 11gR2 RAC.
In 11g RAC aka Grid Infrastructure we all know there are additional background daemons and agents, and the Oracle documentation is not so clear nor the other blog.
For example:- I have found below diagram from metalink which is very confusing.


Whilst reading the book “http://www.amazon.com/Pro-Oracle-Database-11g-Linux/dp/1430229586” found excellent diagram representing the same but very understandable manner. (at least for me)

image
Without much hassle or discussion with bottom to top approach, I understand now,
OHASD Phase:-
OHASD Agent Phase:-
  • OHASD Agent starts and in turn this will start
gipcd Grid interprocess communication daemon, used for monitoring cluster interconnect
mdnsd Multicast DNS service It resolves DNS requests on behalf of GNS
gns The Grid Naming Service (GNS), a gateway between DNS and mdnsd, resolves DNS requests
gpnpd Grid Plug and Play Daemon, Basically a profile similar like OCR contents stored in XML format in $GI_HOME/gpnp/profiles/<peer> etc., this is where used by OCSSD also to read the ASM disk locations to start up with out having ASM to be up, moreover this also provides the plug and play profile where this can be distributed across nodes to cluster
evmd/ evmlogger Evm service will be provided by evmd daemon, which is a information about events happening in cluster, stop node,start node, start instance etc.
  • cssdagent (cluster synchronization service agent), in turn starts
ocssd Cluster synchronization service daemon which manages node membership in the cluster
If cssd found that ocssd is down, it will reboot the node to protect the data integrity.

  • cssdmonitor (cluster synchronization service monitor), replaces oprocd and provides I/O fencing

  • OHASD orarootagent starts and in turn starts
crsd.bin Cluster ready services, which manages high availability of cluster resources , like stopping , starting, failing over etc.
diskmon.bin disk monitor (diskdaemon monitor) provides I/O fencing for exadata storage
octssd.bin Cluster synchronization time services , provides Network time protocol services but manages its own rather depending on OS

CRSD Agent Phase:- crsd.bin starts two more agents
crsd orarootagent(Oracle root agent) starts and in turn this will start
gns Grid interprocess communication daemon, used for monitoring cluster interconnect
gns vip Multicast DNS service It resolves DNS requests on behalf of GNS
Network Monitor the additional networks to provide HAIP to cluster interconnects
Scan vip Monitor the scan vip, if found fail or unreachable failed to other node
Node vip Monitor the node vip, if found fail or unreachable failed to other node
crsd oraagent(Oracle Agent) starts and in turn it will start (the same functionality in 11gr1 and 10g managed by racgmain and racgimon background process) which is now managed by crs Oracle agent itself.

ASM & disk groups Start & monitor local asm instance
ONS FAN feature, provides notification to interested client
eONS FAN feature, provides notification to interested client
SCAN Listener Start & Monitor scan listener
Node Listener Start & monitor the node listener (rdbms?)

9. As said Voting & OCR Disk resides in ASM Diskgroups, but as per startup sequence OCSSD starts first before than ASM, how is it possible?

How does OCSSD starts if voting disk & OCR resides in ASM Diskgroups?
You might wonder how CSSD, which is required to start the clustered ASM instance, can be started if voting disks are stored in ASM? This sounds like a chicken-and-egg problem: without access to the voting disks there is no CSS, hence the node cannot join the cluster. But without being part of the cluster, CSSD cannot start the ASM instance. To solve this problem the ASM disk headers have new metadata in 11.2: you can use kfed to read the header of an ASM disk containing a voting disk. The kfdhdb.vfstart and kfdhdb.vfend fields tell CSS where to find the voting file. This does not require the ASM instance to be up. Once the voting disks are located, CSS can access them and joins the cluster.
Source: Pro Oracle Database 11g RAC on Linux- Martin Bach … – Amazon.com

10. How does SCAN works?
clip_image002
  1. Client Connected through SCAN name of the cluster (remember all three IP addresses round robin resolves to same Host name (SCAN Name), here in this case our scan name is cluster01-scan.cluster01.example.com
  2. The request reaches to DNS server in your corp and then resolves to one of the node out of three.  a. If GNS (Grid Naming service or domain is configured) that is a subdomain configured in  the DNS entry for to resolve cluster address the request will be handover to GNS (gnsd)
  3. Here in our case assume there is no GNS, now the with the help of SCAN listeners where end points are configured to database listener.
  4. Database Listeners listen the request and then process further.
  5. In case of node addition, Listener 4, client need not to know or need not change any thing from their tns entry (address of 4th node/instance) as they just using scan IP.
  6. Same case even in the node deletion.

11. What is GNS?
Grid Naming service is alternative service to DNS , which will act as a sub domain in your DNS but managed by Oracle, with GNS the connection is routed to the cluster IP and manages internally.

12. What is GPNP?
Grid Plug and Play along with GNS provide dynamic
In previous releases, adding or removing servers in a cluster required extensive manual preparation.
In Oracle Database 11g Release 2, GPnP allows each node to perform the following tasks dynamically:
    • Negotiating appropriate network identities for itself
    • Acquiring additional information from a configuration profile
    • Configuring or reconfiguring itself using profile data, making host names and addresses resolvable on the network
For example a domain should contain
  • –Cluster name: cluster01
  • –Network domain: example.com
  • –GPnP domain: cluster01.example.com
To add a node, simply connect the server to the cluster and allow the cluster to configure the node.
To make it happen, Oracle uses the profile located in $GI_HOME/gpnp/profiles/peer/profile.xml which contains the cluster resources, for example disk locations of ASM. etc.
So this profile will be read local or from the remote machine when plugged into cluster and dynamically added to cluster.


No comments:

Post a Comment

Oracle ASM Concepts

Note: Proofread any scripts before using. Always try scripts on a test instance first. This Blog is not responsible for any damage. O...