A complete hands-on implementation guide for building a 2-node Oracle Real Application Clusters (RAC) environment from scratch on VirtualBox. Walk through every stage: VM provisioning, OS setup, Grid Infrastructure installation, ASM configuration, and RAC database creation. Built for DBAs who want real cluster experience in a practice lab.
This lab builds a complete 2-node Oracle RAC cluster on VirtualBox using Oracle Linux and Oracle 19c. All components — Grid Infrastructure, ASM, networking, shared storage — are configured end-to-end.
Follow every step in sequence. Each section covers a distinct cluster component — from initial VM setup through to a fully running RAC database.
Configure the VirtualBox VM for Node 1 with two network adapters. The first adapter provides public network connectivity; the second establishes the private RAC interconnect used for inter-node communication (cache fusion, cluster heartbeat).
Install Oracle Linux 7.8 on Node 1. During installation, select "Server with GUI" as the base environment and enable all required add-on package groups. After the installation completes, reboot and accept the license agreement to finish initial configuration.
node1.localdomainInstall VirtualBox Guest Additions on Node 1 to enable shared folders and improved VM integration. This must be run as the root user, not as oracle or grid users.
# Mount the Guest Additions ISO and run installer as root # Note: Must be run as root user, not oracle or grid sh /run/media/root/VBox_GAs_<version>/VBoxLinuxAdditions.run
<version> with the actual VirtualBox version number
Configure static IP addresses for both the public (enp0s3) and private (enp0s8) interfaces on Node 1. Then populate /etc/hosts on both nodes with all cluster entries — including public IPs, private IPs, VIPs, and SCAN IPs.
# Check and set hostname hostname hostname -i # Edit hostname if needed vi /etc/hostname # Set to: node1.localdomain
# /etc/hosts entries — add on both nodes ##Public network 192.168.1.103 node1.localdomain node1 192.168.1.104 node2.localdomain node2 #Private network 10.2.1.11 node1-priv.localdomain node1-priv 10.2.1.12 node2-priv.localdomain node2-priv #Virtual IP network (VIP) 192.168.1.115 node1-vip.localdomain node1-vip 192.168.1.116 node2-vip.localdomain node2-vip #Scan IPs address 192.168.1.117 node-scan.localdomain node-scan 192.168.1.118 node-scan.localdomain node-scan 192.168.1.119 node-scan.localdomain node-scan
# Public interface — static IP configuration
IPv4 Method: Manual
Address: 192.168.1.103
Netmask: 255.255.255.0
Gateway: 192.168.1.1
DNS: 192.168.1.1# Private interface — static IP (no gateway, no DNS)
IPv4 Method: Manual
Address: 10.2.1.11
Netmask: 255.255.255.0hostname and hostname -i must return expected valuesOracle RAC requires two separate OS users: oracle (for the RDBMS software) and grid (for Grid Infrastructure and ASM). Both users must belong to the correct OS groups for cluster operations to function correctly.
# Create grid user useradd grid passwd grid # Create required groups groupadd oinstall groupadd asmadmin groupadd asmdba groupadd dba # Assign groups to oracle user usermod -g oinstall oracle usermod -G asmdba,dba,asmadmin oracle # Assign groups to grid user usermod -g oinstall grid usermod -G asmdba,dba,asmadmin grid # Verify assignments id oracle id grid
Create the required Oracle installation directories. ORACLE_HOME, GRID_BASE, and GRID_HOME must be separate locations with correct ownership and permissions. Mixing Grid and Oracle homes causes installation failures.
# Create required directories mkdir -p /u01/app/oracle/product/19.0.0.0/dbhome_1 # ORACLE_HOME mkdir -p /u01/app/grid # GRID_BASE mkdir -p /u01/app/19.0.0.0/grid # GRID_HOME # Set ownership chown oracle:oinstall -R /u01 chown -R grid:oinstall /u01/app/grid chown -R grid:oinstall /u01/app/19.0.0.0 # Set permissions chmod -R 775 /u01
Configure .bash_profile for both the oracle and grid users on both nodes. These variables ensure Oracle binaries can be located and that each node connects to the correct database instance. The ORACLE_SID suffix differs between nodes (1 for node1, 2 for node2).
# oracle user .bash_profile export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1 export ORACLE_SID=<db_name>1 # node1: 1, node2: 2 export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
# grid user .bash_profile
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.0.0.0/grid
export PATH=$ORACLE_HOME/bin:$PATHORACLE_SID=<db_name>1 — on Node 2: ORACLE_SID=<db_name>2ORACLE_BASE must be different from the oracle user's ORACLE_BASEsource ~/.bash_profile after editing to activate changesInstall Oracle-specific pre-install packages on both nodes. The oracle-database-preinstall-19c package automatically configures required kernel parameters, system limits, and dependencies — saving significant manual configuration time.
# Install Oracle Linux release package yum install -y oraclelinux-release-el7.x86_64 # Install Oracle 19c pre-install package # (automatically configures kernel parameters, limits, etc.) yum install -y oracle-database-preinstall-19c.x86_64 # Install ASM support package yum install -y oracleasm-support.x86_64
Oracle RAC uses a complex set of internal network communications. The firewall and SELinux must be disabled on both nodes in a lab environment to prevent interference with clusterware communication, VIP failover, and interconnect traffic.
# Disable firewall systemctl stop firewalld systemctl disable firewalld # Disable SELinux — edit config file vi /etc/selinux/config # Change SELINUX=enforcing → SELINUX=disabled # Verify current SELinux status sestatus
Rather than repeating the entire OS installation, clone Node 1 in VirtualBox to create Node 2. This saves significant time — all OS packages, users, groups, and directory structure are inherited. After cloning, Node 2 requires a hostname and IP reconfiguration only.
After powering on Node 2, update the hostname and all IP addresses to reflect node2-specific values. The cloned VM will initially have Node 1's identity — this must be corrected before any cluster operations begin.
# Update hostname on node2 hostnamectl set-hostname node2.localdomain # Verify hostname was updated cat /etc/hostname
# Public interface — node2 IP
IPv4 Method: Manual
Address: 192.168.1.104
Netmask: 255.255.255.0
Gateway: 192.168.1.1
DNS: 192.168.1.1# Private interface — node2 private IP
IPv4 Method: Manual
Address: 10.2.1.12
Netmask: 255.255.255.0# Restart network service systemctl restart network # Reboot to reflect all changes reboot
hostname — should return node2.localdomainhostname -i — should return 192.168.1.104cat /etc/hosts — ensure entries match those on Node 1ping node1 and vice versa to confirm public network reachabilityping node1-priv to confirm private interconnect worksOracle RAC requires shared storage accessible by all cluster nodes simultaneously. In VirtualBox, create shareable virtual disks and attach them to both nodes. All disks must be set to Shareable type — this is the critical setting that enables simultaneous multi-node access.
Create a single primary partition on each shared disk using fdisk. Run this on Node 1 only — because the disks are shared, the partitions are automatically visible on Node 2 as well.
# Verify shared disks are visible ls -l /dev/sd* # Partition each disk using fdisk # Repeat for /dev/sdb, /dev/sdc, /dev/sdd, /dev/sde fdisk /dev/sdb > n # new partition > p # primary > 1 # partition number > # accept defaults for start sector > # accept defaults for end sector > w # write and exit # Repeat fdisk for /dev/sdc, /dev/sdd, /dev/sde # Verify partitions on both nodes ls -ltr /dev/sd*
Configure the Oracle ASM Library (ASMLIB) driver on both nodes. ASMLIB provides a kernel-level interface that Oracle uses to manage raw block devices as ASM disks. The default user must be grid and the default group must be asmadmin.
# Configure ASM library driver oracleasm configure -i # When prompted, enter: Default user : grid Default group : asmadmin Boot on start : y Scan on boot : y # Initialize ASM library oracleasm init
Create ASM disk labels on Node 1. Each partition on the shared disks is stamped with an ASM disk name. Node 2 will discover these labels automatically when it scans for ASM disks in the next step.
# Create ASM disk labels oracleasm createdisk DATA01 /dev/sdb1 oracleasm createdisk DATA02 /dev/sdc1 oracleasm createdisk FRA /dev/sdd1 oracleasm createdisk OCR /dev/sde1 # Verify disk creation oracleasm listdisks # Expected output: # DATA01 # DATA02 # FRA # OCR
On Node 2, trigger an ASM disk scan to discover the disks created on Node 1. Both nodes must list all 4 ASM disks before Grid Infrastructure installation can proceed.
# Scan for ASM disks oracleasm scandisks # Verify all 4 disks are visible oracleasm listdisks # Expected output: # DATA01 # DATA02 # FRA # OCR
Transfer the Oracle Grid Infrastructure 19c software to Node 1 and extract it directly into the GRID_HOME directory. This must be done as the grid user to ensure correct file ownership from the start.
# As grid user on Node 1 # Unzip Grid software to GRID_HOME unzip <grid_software>.zip -d /u01/app/19.0.0.0/grid/ # Verify files extracted correctly ls -lth /u01/app/19.0.0.0/grid/
Launch the Grid Infrastructure installer as the grid user on Node 1. The installer wizard will guide through cluster topology configuration, SSH setup, ASM disk group selection, and root script execution. Follow the specific choices carefully — incorrect configuration here requires a full reinstall.
cd /u01/app/19.0.0.0/grid/ ./gridSetup.sh
root.sh scripts when prompted — Node 1 first, then Node 2
When the Grid installer prompts, run the root scripts in the exact sequence shown. The orainstRoot.sh registers the Oracle Inventory, and root.sh installs the Oracle Clusterware stack. Never run Node 1 and Node 2 scripts simultaneously.
# Run on Node 1 FIRST — wait for full completion before touching Node 2
/u01/app/oraInventory/orainstRoot.sh
/u01/app/19.0.0.0/grid/root.sh# ONLY after Node 1 completes — run on Node 2
/u01/app/oraInventory/orainstRoot.sh
/u01/app/19.0.0.0/grid/root.shroot.sh on Node 1 first and wait for it to complete fully before running on Node 2root.sh on Node 1 can take 10–20 minutes — wait for the confirmation messageAfter Grid Infrastructure installation completes, launch ASMCA (ASM Configuration Assistant) to create and verify the ASM disk groups. Then validate disk group status via SQL*Plus as the sysasm user.
# As grid user on Node 1
asmca# Connect as sysasm to verify disk groups
sqlplus / as sysasm
SELECT name, state, type
FROM v$asm_diskgroup;Confirm that the Oracle Clusterware stack is fully operational. All cluster resources should show ONLINE status, both nodes should appear in the cluster topology, and OCR and voting disks should be accessible. This is a mandatory checkpoint before installing the Oracle RDBMS.
# Check all cluster resources and their status crsctl stat res -t # Check cluster nodes olsnodes -n # Check OCR integrity ocrcheck # Check voting disk location and status crsctl query css votedisk
crsctl stat res -t — All resources should be in ONLINE state on both nodesolsnodes -n — Should show both node1 and node2 with their node numbersocrcheck — Should return successful for all OCR locationscrsctl query css votedisk — Should show all voting disks as ONLINETransfer the Oracle 19c RDBMS software to Node 1 and extract it to the ORACLE_HOME directory. This must be performed as the oracle user. The Grid Infrastructure installation does not include the RDBMS binaries — they are separate.
# As oracle user on Node 1 # Unzip Oracle RDBMS software to ORACLE_HOME unzip <oracle_db_software>.zip \ -d /u01/app/oracle/product/19.0.0.0/dbhome_1/
Launch the Oracle Database installer as the oracle user. Select "Set Up Software Only" — do not create a database at this stage. The RDBMS software will be installed on both nodes simultaneously by selecting both nodes in the installer.
cd /u01/app/oracle/product/19.0.0.0/dbhome_1/ ./runInstaller
orainstRoot.sh and root.sh on both nodesUse DBCA (Database Configuration Assistant) to create the RAC database after the RDBMS software is installed. DBCA creates the database on ASM storage across both nodes simultaneously. Alternatively, use the silent mode command for a fully automated creation.
# As oracle user on Node 1 # Launch Database Configuration Assistant dbca
# Silent mode — fully automated RAC database creation
dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbName <db_name> \
-sid <db_name> \
-datafileDestination '+DATA01' \
-recoveryAreaDestination '+FRA' \
-storageType ASM \
-nodeList node1,node2+DATA01 — Fast Recovery Area: +FRA
Confirm that the RAC database is running correctly on both nodes. The GV$INSTANCE view shows all instances across the cluster — all instances should show OPEN status. Use SRVCTL to verify the cluster service layer recognises the database.
# Verify instances on both nodes via SRVCTL srvctl status database -d <db_name> # Check instance status across all cluster nodes sqlplus / as sysdba SELECT inst_id, instance_name, host_name, status FROM gv$instance ORDER BY inst_id; # Check all cluster services are online crsctl stat res -t
srvctl status database — Instance <db_name>1 on node1 — RUNNING; Instance <db_name>2 on node2 — RUNNINGgv$instance — Both rows should show status = OPENcrsctl stat res -t — All database and listener resources should show ONLINEAll phases of the Oracle RAC implementation have been completed. The 2-node cluster is fully operational with Grid Infrastructure, ASM storage, and a running RAC database.