Thursday, 18 September 2025

Rac services Startup Sequence

 

RAC Services Startup Sequence

When an Oracle RAC cluster is started, the components must come up in a specific dependency order:


🧩 Step-by-Step Startup Order

OrderComponentDescriptionCommand (if manual)
1️⃣OHAS (Oracle High Availability Services)Base daemon on each node. Brings up local agents and monitors.crsctl start has
2️⃣CSSD (Cluster Synchronization Services Daemon)Handles node membership and cluster heartbeat.Auto via OHAS
3️⃣CRSD (Cluster Ready Services Daemon)Manages cluster resources (like databases, services, VIPs).Auto via OHAS
4️⃣EVMD (Event Manager Daemon)Manages cluster events and notifications.Auto via OHAS
5️⃣ASM InstancesProvides shared storage (if using ASM). Must start before any database instances.srvctl start asm -n <node>
6️⃣Listener(s)Handles client connections. Needed before database instances start.srvctl start listener -n <node>
7️⃣Database InstancesEach RAC instance on each node. They mount and open the shared database.srvctl start instance -d <db> -i <inst> or srvctl start database -d <db>
8️⃣RAC Services (DB Services)Logical services running on top of the database. Enable workload balancing, failover, etc.srvctl start service -d <db> -s <service>

RAC Startup Sequence

 In an Oracle RAC environment, multiple instances start up and mount one shared database. The startup is coordinated by Oracle Clusterware.


🧩 RAC Startup Steps

1. Clusterware Startup (Infrastructure Layer)

  • Before any database instance starts, Clusterware (CRS) must be running on all nodes.

  • Clusterware includes:

    • Cluster Ready Services (CRS)

    • Oracle Cluster Synchronization Services (CSS)

    • Oracle High Availability Services (OHASD)

Commands:

crsctl start crs # Start Clusterware stack on a node crsctl check crs # Verify status

2. Automatic Startup of RAC Instances

  • Once CRS is up, it will start:

    • Oracle ASM instances (if used)

    • Listener

    • Database instances (configured as resources in CRS)

Commands:

srvctl start asm -n <node_name> # Start ASM on a specific node srvctl start listener -n <node_name> # Start listener on a node srvctl start database -d <db_name> # Start all RAC instances
  • Alternatively, to start an instance manually (on one node):

sqlplus / as sysdba STARTUP

⚙ RAC Instance Startup Phases

Each RAC instance goes through these standard Oracle startup stages:

StageWhat Happens
STARTUP NOMOUNTAllocates SGA, starts background processes. Uses init.ora / spfile
STARTUP MOUNTReads control files from shared storage. Opens redo threads.
STARTUP OPENOpens datafiles and online redo logs, database available to users
  • At MOUNT, the instance joins the cluster group using Global Enqueue Service (GES) and Global Cache Service (GCS).

  • At OPEN, the database becomes fully accessible.


🔁 Typical RAC Startup Flow

[Start Clusterware] ↓ [Start ASM Instances] ↓ [Start Listeners] ↓ [Start RAC Instances (Node1, Node2,...)] ↓ [Each instance does: NOMOUNT → MOUNT → OPEN] ↓ [Clustered Database becomes available]

📌 Useful RAC Startup/Shutdown Commands

TaskCommand
Start whole RAC DBsrvctl start database -d <db_name>
Stop whole RAC DBsrvctl stop database -d <db_name>
Start one instancesrvctl start instance -d <db_name> -i <inst_name>
Stop one instancesrvctl stop instance -d <db_name> -i <inst_name>
Check database statussrvctl status database -d <db_name>

Components of RAC

 1. Cluster Nodes (Servers)

  • Multiple physical or virtual servers (nodes) work together as a cluster.

  • Each node runs its own Oracle Instance (SGA + background processes).

  • All nodes access the same database files.


2. Shared Storage

  • All RAC nodes must see the same storage.

  • Contains:

    • Datafiles

    • Control files

    • Redo log files

    • Archive logs

  • Usually implemented using SAN / NAS / ASM (Automatic Storage Management).


3. Cluster Interconnect (Private Network)

  • High-speed private network between all nodes.

  • Used for:

    • Cache Fusion (transferring data blocks between instances)

    • Global resource coordination

  • Requires low-latency and high-bandwidth network (typically 10/25/40GbE or Infiniband).


4. Oracle Clusterware

  • Provides cluster management and node membership.

  • Ensures only active nodes access the shared storage.

  • Manages:

    • Node heartbeat monitoring

    • Automatic failover

    • VIP (Virtual IP) configuration


5. Global Cache Service (GCS) & Global Enqueue Service (GES)

  • Ensure data consistency across instances.

  • Cache Fusion: If a block is modified on one node, other nodes get the updated version via interconnect (not disk I/O).

  • GES manages locks, GCS manages cache coherency.


6. Oracle RAC Database

  • One database (shared) accessed by multiple instances.

  • Appears as a single database to applications.

  • Supports load balancing and failover through services.


📊 RAC Architecture Diagram

+-------------+ +-------------+ | Node 1 | | Node 2 | |-------------| |-------------| | Oracle Inst | | Oracle Inst | | SGA/Proc | | SGA/Proc | +------|------+ +------|------+ | | ======= Private Interconnect ======= | | +---------------------------------------+ | Shared Storage (ASM) | | Control/Data/Redo/Archive Files | +---------------------------------------+

⚙ Benefits of RAC

  • High Availability: Survives node failure automatically.

  • Scalability: Add more nodes to increase capacity.

  • Load Balancing: Workload distributed among nodes.

  • Fault Tolerance: Shared database remains available if a node fails.