Oracle Database 19c RAC on Oracle Linux 8 Using VirtualBox and Vagrant
Introduction
Setting up a Real Application Clusters (RAC) environment has traditionally required expensive shared storage—typically a SAN or high-end NAS device. This cost barrier prevents many people from gaining hands-on RAC experience.
This article describes a "hands-off" installation of Oracle Database 19c RAC on Oracle Linux 8 using VirtualBox and Vagrant, with no additional shared disk devices required. By using virtualization, you can run multiple Virtual Machines (VMs) on a single server and configure shared virtual disks—eliminating the need for expensive physical shared storage.
Note: This article uses the 64-bit versions of Oracle Linux and Oracle 19c. The entire build is automated through Vagrant scripts, so there is no GUI installation. For an explanation of why GUI installations are no longer covered, refer to the original article's note on this topic.
Important Considerations
Before you begin, be aware of the following:
| Consideration | Details |
|---|---|
| Resource Requirements | The finished system includes the host OS, three guest OSes, two sets of Oracle Grid Infrastructure (Clusterware + ASM), and two database instances—all on a single machine |
| Memory | Each RAC node VM needs at least 6 GB RAM (10 GB recommended, but still slow) |
| Not for Small Machines | Don't assume this will run on a small PC or laptop—it won't |
| Bare Bones Installation | No redundancy in the Grid Infrastructure or ASM installation |
| Not Production-Ready | This is for learning and experimentation only |
| DNS Required | Needed to support the SCAN listener |
| Time Required | The build takes over 3 hours to complete (possibly longer) |
| Disk Performance | Splitting virtual disks across different physical disks improves performance |
Overview of the Build Process
| Phase | Activity | Description |
|---|---|---|
| 1 | Required Software | Install VirtualBox, Vagrant, Git; download Oracle software |
| 2 | Clone Repository | Clone the Vagrant repository from GitHub |
| 3 | Amend File Paths | Configure the shared disk paths in vagrant.yml |
| 4 | Build the RAC | Start DNS, node2, then node1 |
| 5 | Turn Off RAC | Cleanly halt the VMs |
| 6 | Remove Whole RAC | Destroy all VMs and associated files |
Phase 1: Required Software
Download and install the following on your PC:
| Software | Purpose |
|---|---|
| VirtualBox | Virtualization platform |
| Vagrant | Automation tool for building VMs |
| Git Client | To clone the vagrant repository |
You will also need to download the following Oracle software (requires an Oracle Support account):
| Software | File Name |
|---|---|
| Grid Infrastructure | LINUX.X64_193000_grid_home.zip |
| Database | LINUX.X64_193000_db_home.zip |
| Combo Patch | p30783556_190000_Linux-x86-64.zip (OJVM RU + GI RU 19.7) |
| OPatch | p6880880_190000_Linux-x86-64.zip |
Note: The 19.7 Release Update (RU) is required because it includes fixes for running Oracle 19c RAC on OL8.2. Without it, you may encounter issues with passwordless SSH and SCP.
Phase 2: Clone Repository
Choose a Base Directory:
Pick an area on your PC file system to act as the base for the Git repository
Clone the Repository:
git clone https://github.com/oraclebase/vagrant.gitCopy the Oracle Software:
Copy the downloaded Oracle software under the
..../software/directory
Verify the Directory Structure:
From the
rac/ol8_19subdirectory, the structure should look like this:. +--- config | +--- install.env | +--- vagrant.yml +--- dns | +--- scripts | | +--- root_setup.sh | | +--- setup.sh | +--- Vagrantfile +--- node1 | +--- scripts | | +--- oracle_create_database.sh | | +--- oracle_db_software_installation.sh | | +--- oracle_grid_software_config.sh | | +--- oracle_grid_software_installation.sh | | +--- oracle_user_environment_setup.sh | | +--- root_setup.sh | | +--- setup.sh | +--- Vagrantfile +--- node2 | +--- scripts | | +--- oracle_user_environment_setup.sh | | +--- root_setup.sh | | +--- setup.sh | +--- Vagrantfile +--- README.md +--- shared_scripts | +--- configure_chrony.sh | +--- configure_hosts_base.sh | +--- configure_hosts_scan.sh | +--- configure_shared_disks.sh | +--- install_os_packages.sh | +--- oracle_software_patch.sh | +--- prepare_u01_disk.sh +--- software | +--- LINUX.X64_193000_db_home.zip | +--- LINUX.X64_193000_grid_home.zip | +--- p6880880_190000_Linux-x86-64.zip | +--- p30783556_190000_Linux-x86-64.zip | +--- put_software_here.txt
⚠️ Important (Windows Users): When you clone the repository on Windows, ensure the line terminators are preserved. All
.shscripts run inside the Linux VMs and need UNIX-style line terminators. If your Git client converts files to Windows-style line terminators, the scripts will fail when called from Linux.
Phase 3: Amend File Paths
The config directory contains two files that hold all the configuration for the build:
install.env— Environment variablesvagrant.yml— VM and disk configuration
At minimum, you must amend the shared disk paths in vagrant.yml to provide suitable paths on your PC.
Default Paths (Linux/macOS Style)
asm_crs_disk_1: /u05/VirtualBox/shared/ol8_19_rac/asm_crs_disk_1.vdi
asm_crs_disk_2: /u05/VirtualBox/shared/ol8_19_rac/asm_crs_disk_2.vdi
asm_crs_disk_3: /u05/VirtualBox/shared/ol8_19_rac/asm_crs_disk_3.vdi
asm_crs_disk_size: 2
asm_data_disk_1: /u05/VirtualBox/shared/ol8_19_rac/asm_data_disk_1.vdi
asm_data_disk_size: 40
asm_reco_disk_1: /u05/VirtualBox/shared/ol8_19_rac/asm_reco_disk_1.vdi
asm_reco_disk_size: 20Example Windows Paths
For a Windows PC, you might create a path like C:\VirtualBox\shared\ol8_19_rac and use:
asm_crs_disk_1: C:\VirtualBox\shared\ol8_19_rac\asm_crs_disk_1.vdi
asm_crs_disk_2: C:\VirtualBox\shared\ol8_19_rac\asm_crs_disk_2.vdi
asm_crs_disk_3: C:\VirtualBox\shared\ol8_19_rac\asm_crs_disk_3.vdi
asm_crs_disk_size: 2
asm_data_disk_1: C:\VirtualBox\shared\ol8_19_rac\asm_data_disk_1.vdi
asm_data_disk_size: 40
asm_reco_disk_1: C:\VirtualBox\shared\ol8_19_rac\asm_reco_disk_1.vdi
asm_reco_disk_size: 20Note: If you don't alter the paths, they will default to
C:\u05\VirtualBox\shared\ol8_19_rac.
Phase 4: Build the RAC
The following commands will leave you with a functioning RAC installation.
Step 1: Start the DNS Server
cd dns
vagrant upNote: The DNS server VM takes about 2 minutes to build.
Step 2: Start the Second Node
cd ../node2
vagrant upImportant: Node 2 must be running before you start node 1. This VM takes about 5 minutes to build.
Step 3: Start the First Node
cd ../node1
vagrant upNote: Node 1 performs all installation operations. Depending on the host system spec, this could take a long time — about 1.5 hours on one server, but potentially 3.5 hours or more.
Phase 5: Turn Off RAC
To cleanly shut down the RAC environment:
cd node2
vagrant halt
cd ../node1
vagrant halt
cd ../dns
vagrant haltPhase 6: Remove Whole RAC
To destroy all VMs and associated files (so you can run the process again):
cd node2
vagrant destroy -f
cd ../node1
vagrant destroy -f
cd ../dns
vagrant destroy -fDescription of the Build
All parameters for the build come from two files: vagrant.yml and install.env.
DNS Server Build
The DNS server build is simple and takes about 2 minutes.
VM Characteristics:
| Attribute | Value |
|---|---|
| OS | Oracle Linux 8.2 |
| VM Name | ol8_19_dns |
| CPUs | 1 |
| RAM | 1 GB |
| NIC 1 | NAT Network |
| NIC 2 | 192.168.56.100 (public network) |
| Disk 1 | Box disk with OS pre-installed |
What root_setup.sh Does:
Sources
install.envfor environment variablesGets the latest Yum repository file
Adds entries to
/etc/hostsfor public, private, and virtual IPs of each RAC node, plus SCAN IPsInstalls and enables Dnsmasq — presents the
/etc/hostscontents as a DNS server (simpler than BIND)
Important: If you have any problems with the DNS build, do not continue with the RAC nodes until you fix them.
RAC Node 2 Build
Node 2 performs no installation actions — it just prepares the OS. This VM takes about 5 minutes to build.
VM Characteristics:
| Attribute | Value |
|---|---|
| OS | Oracle Linux 8.2 |
| VM Name | ol8_19_rac2 |
| CPUs | 4 |
| RAM | 6144 MB |
| NIC 1 | NAT Network |
| NIC 2 | 192.168.56.102 (public network) |
| NIC 3 | 192.168.1.102 (private network) |
| Disk 1 | Box disk with OS pre-installed |
| Disk 2 | Local disk for /u01 mount point |
| Disk 3-5 | CRS disks 1-3 |
| Disk 6 | DATA disk |
| Disk 7 | RECO disk |
What root_setup.sh Does:
Sources
install.envRuns
prepare_u01_disk.sh— partitions/dev/sdb, creates a file system, adds to/etc/fstab, and mountsRuns
install_os_packages.sh— configures Yum repos and installs OS packages (includingoracle-database-preinstall-19c)Sets passwords for
rootandoracleusersRuns
configure_hosts_base.sh— adds public, private, and virtual addresses to/etc/hostsConfigures
/etc/resolv.confto point to the DNS server VMRuns
configure_chrony.sh— configures Chrony for NTPRuns
configure_shared_disks.sh— configures UDEV for ASM shared disksSets the hostname
Runs
oracle_user_environment_setup.sh— creates environment scripts, GRID_HOME and DB_HOME directories, and partially prepares passwordless SSHPartially prepares passwordless SSH for the
rootuser (completed by node 1)
Important: If you have any problems with the node 2 build, do not continue with node 1 until you fix them.
RAC Node 1 Build
Node 1 performs all software installation and configuration actions. The DNS and node 2 VMs must be running before starting this node. This VM takes about 1.5 hours to build.
VM Characteristics:
| Attribute | Value |
|---|---|
| OS | Oracle Linux 8.2 |
| VM Name | ol8_19_rac1 |
| CPUs | 2 |
| RAM | 7168 MB |
| NIC 1 | NAT Network |
| NIC 2 | 192.168.56.101 (public network) |
| NIC 3 | 192.168.1.101 (private network) |
| Disk 1 | Box disk with OS pre-installed |
| Disk 2 | Local disk for /u01 mount point |
| Disk 3-5 | CRS disks 1-3 |
| Disk 6 | DATA disk |
| Disk 7 | RECO disk |
What root_setup.sh Does (in addition to node 2 steps):
Completes passwordless SSH for
oracleandrootusers usingsshpassandssh-copy-idInstalls the
cvuqdiskpackage on both nodesRuns
oracle_grid_software_installation.sh— silent Grid Infrastructure installationRuns
orainstRoot.shon node 1, then node 2Runs
root.shon node 1, then node 2Runs
oracle_grid_software_config.sh— silent Grid Infrastructure configuration and cluster statusRuns
oracle_db_software_installation.sh— silent database software installationRuns
root.shon node 1, then node 2Applies the OJVM Patch on both nodes
Runs
oracle_create_database.sh— silent database creation using DBCA
Result: Once
vagrant upcompletes, you have a fully configured and running 2-node RAC.
The Complete Build Flow
┌─────────────────────────────────────────────────────────────────┐
│ 1. REQUIRED SOFTWARE │
│ VirtualBox, Vagrant, Git client │
│ Download Grid, DB, Combo Patch, OPatch │
└──────────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 2. CLONE REPOSITORY │
│ git clone https://github.com/oraclebase/vagrant.git │
│ Copy Oracle software to the software/ directory │
└──────────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 3. AMEND FILE PATHS │
│ Configure shared disk paths in vagrant.yml │
└──────────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 4. BUILD THE RAC │
│ cd dns && vagrant up (2 minutes) │
│ cd ../node2 && vagrant up (5 minutes) │
│ cd ../node1 && vagrant up (1.5 - 3.5 hours) │
└──────────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 5. TURN OFF RAC │
│ vagrant halt (node2, node1, dns) │
└──────────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 6. REMOVE WHOLE RAC │
│ vagrant destroy -f (node2, node1, dns) │
└─────────────────────────────────────────────────────────────────┘Extra Notes
The 19.7 RU Requirement
The 19.7 Release Update (RU) is required because it includes fixes for running Oracle 19c RAC on OL8.2. Without it, you may encounter:
Passwordless SSH Issue: An incompatibility between the way the 19.3 GI installer tests for passwordless SSH and how SCP works on OL8.2
OS Certification Issue: The 19.3 software was released before OL8 was certified
Workaround for Passwordless SSH (If Not Applying the RU)
On each RAC node:
# Before the installation
mv /usr/bin/scp /usr/bin/scp.orig
echo "/usr/bin/scp.orig -T \$*" > /usr/bin/scp
chmod 555 /usr/bin/scp
# After the installation
#mv /usr/bin/scp.orig /usr/bin/scpWorkaround for OS Certification (If Not Applying the RU)
export CV_ASSUME_DISTID=OEL7.6Note: These workarounds are not necessary if you apply the patches as part of the installations using the
-applyRUparameter.
Best Practices
| Practice | Description |
|---|---|
| Ensure Sufficient Resources | Allocate at least 6 GB RAM per RAC node |
| Use Separate Physical Disks | Split virtual disks across physical disks for better performance |
| Use DNS for SCAN | Required for SCAN listener functionality |
| Apply the 19.7 RU | Avoids SSH and SCP issues on OL8.2 |
| Monitor Build Progress | The build takes hours—be patient and monitor logs |
| Verify Each Phase | Don't continue if DNS or node2 builds fail |
| Use Version Control | Keep your vagrant.yml and install.env in version control |
| Document Customizations | Record any changes to the default configuration |
Troubleshooting Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| Scripts fail on Linux | Windows line terminators | Configure Git to preserve UNIX line terminators |
| DNS build fails | Wrong IP configuration | Verify vagrant.yml and install.env |
| Node 2 build fails | Disk path issues | Verify the shared disk paths in vagrant.yml |
| Node 1 build fails | DNS or node 2 not running | Ensure DNS and node 2 are up before node 1 |
| SSH passwordless fails | SCP incompatibility on OL8.2 | Apply the 19.7 RU or use the SCP workaround |
| GI installer fails | OS not certified | Use CV_ASSUME_DISTID=OEL7.6 |
| Insufficient memory | Not enough RAM | Allocate at least 6 GB per node |
| Slow performance | Disk speed limitations | Use SSDs or split disks across physical disks |
Summary
Setting up Oracle Database 19c RAC on Oracle Linux 8 using VirtualBox and Vagrant involves the following key phases:
Required Software: Install VirtualBox, Vagrant, Git, and download Oracle software
Clone Repository: Clone the Vagrant repository and copy Oracle software
Amend File Paths: Configure shared disk paths in
vagrant.ymlBuild the RAC: Start DNS, node2, then node1 (in that order)
Turn Off RAC: Cleanly halt the VMs
Remove Whole RAC: Destroy all VMs and files
Key Points to Remember
Shared storage is faked using VirtualBox shared virtual disks
DNS is required for SCAN listener support (Dnsmasq is used)
Node 2 must run before node 1 — node 2 prepares the OS, node 1 installs
The 19.7 RU is required for OL8.2 compatibility
The build takes over 3 hours — be patient
At least 6 GB RAM per node is required
This is not production-ready — it's for learning and experimentation
Workarounds exist for SSH/SCP and OS certification issues
Why This Matters
This hands-off RAC installation is significant because it:
Removes the Cost Barrier: Eliminates the need for expensive shared storage
Enables Learning: Allows anyone to gain hands-on RAC experience
Automates Setup: Uses Vagrant for a repeatable, hands-off installation
Saves Time: Automates hours of manual installation steps
Builds Confidence: Provides a safe environment to experiment with RAC
Demonstrates Best Practices: Shows how to build RAC using silent installations
By following this guide, you can set up a fully functional 2-node Oracle 19c RAC environment on a single machine, providing an excellent platform for learning, testing, and experimentation.
References
Oracle Database Documentation: Oracle Real Application Clusters Installation Guide
Oracle Database Documentation: Grid Infrastructure Installation Guide
My Oracle Support: Doc ID 2555697.1 (SSH/SCP Workaround)
GitHub Repository: https://github.com/oraclebase/vagrant.git
Related Articles: Vagrant Oracle Real Application Clusters (RAC) Build, All RAC Articles, Silent Installation and Configuration: All Articles
No comments:
Post a Comment