7b. Oracle Database 19c RAC on Oracle Linux 8 Using VirtualBox and Vagrant

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:

ConsiderationDetails
Resource RequirementsThe 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
MemoryEach RAC node VM needs at least 6 GB RAM (10 GB recommended, but still slow)
Not for Small MachinesDon't assume this will run on a small PC or laptop—it won't
Bare Bones InstallationNo redundancy in the Grid Infrastructure or ASM installation
Not Production-ReadyThis is for learning and experimentation only
DNS RequiredNeeded to support the SCAN listener
Time RequiredThe build takes over 3 hours to complete (possibly longer)
Disk PerformanceSplitting virtual disks across different physical disks improves performance

Overview of the Build Process

PhaseActivityDescription
1Required SoftwareInstall VirtualBox, Vagrant, Git; download Oracle software
2Clone RepositoryClone the Vagrant repository from GitHub
3Amend File PathsConfigure the shared disk paths in vagrant.yml
4Build the RACStart DNS, node2, then node1
5Turn Off RACCleanly halt the VMs
6Remove Whole RACDestroy all VMs and associated files

Phase 1: Required Software

Download and install the following on your PC:

SoftwarePurpose
VirtualBoxVirtualization platform
VagrantAutomation tool for building VMs
Git ClientTo clone the vagrant repository

You will also need to download the following Oracle software (requires an Oracle Support account):

SoftwareFile Name
Grid InfrastructureLINUX.X64_193000_grid_home.zip
DatabaseLINUX.X64_193000_db_home.zip
Combo Patchp30783556_190000_Linux-x86-64.zip (OJVM RU + GI RU 19.7)
OPatchp6880880_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

  1. Choose a Base Directory:

    • Pick an area on your PC file system to act as the base for the Git repository

  2. Clone the Repository:

    bash
    git clone https://github.com/oraclebase/vagrant.git
  3. Copy the Oracle Software:

    • Copy the downloaded Oracle software under the ..../software/ directory

  4. Verify the Directory Structure:

    From the rac/ol8_19 subdirectory, the structure should look like this:

    text
    .
    +--- 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 .sh scripts 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 variables

  • vagrant.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)

yaml
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: 20

Example Windows Paths

For a Windows PC, you might create a path like C:\VirtualBox\shared\ol8_19_rac and use:

yaml
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: 20

Note: 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

bash
cd dns
vagrant up

Note: The DNS server VM takes about 2 minutes to build.

Step 2: Start the Second Node

bash
cd ../node2
vagrant up

Important: Node 2 must be running before you start node 1. This VM takes about 5 minutes to build.

Step 3: Start the First Node

bash
cd ../node1
vagrant up

Note: 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:

bash
cd node2
vagrant halt

cd ../node1
vagrant halt

cd ../dns
vagrant halt

Phase 6: Remove Whole RAC

To destroy all VMs and associated files (so you can run the process again):

bash
cd node2
vagrant destroy -f

cd ../node1
vagrant destroy -f

cd ../dns
vagrant destroy -f

Description 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:

AttributeValue
OSOracle Linux 8.2
VM Nameol8_19_dns
CPUs1
RAM1 GB
NIC 1NAT Network
NIC 2192.168.56.100 (public network)
Disk 1Box disk with OS pre-installed

What root_setup.sh Does:

  1. Sources install.env for environment variables

  2. Gets the latest Yum repository file

  3. Adds entries to /etc/hosts for public, private, and virtual IPs of each RAC node, plus SCAN IPs

  4. Installs and enables Dnsmasq — presents the /etc/hosts contents 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:

AttributeValue
OSOracle Linux 8.2
VM Nameol8_19_rac2
CPUs4
RAM6144 MB
NIC 1NAT Network
NIC 2192.168.56.102 (public network)
NIC 3192.168.1.102 (private network)
Disk 1Box disk with OS pre-installed
Disk 2Local disk for /u01 mount point
Disk 3-5CRS disks 1-3
Disk 6DATA disk
Disk 7RECO disk

What root_setup.sh Does:

  1. Sources install.env

  2. Runs prepare_u01_disk.sh — partitions /dev/sdb, creates a file system, adds to /etc/fstab, and mounts

  3. Runs install_os_packages.sh — configures Yum repos and installs OS packages (including oracle-database-preinstall-19c)

  4. Sets passwords for root and oracle users

  5. Runs configure_hosts_base.sh — adds public, private, and virtual addresses to /etc/hosts

  6. Configures /etc/resolv.conf to point to the DNS server VM

  7. Runs configure_chrony.sh — configures Chrony for NTP

  8. Runs configure_shared_disks.sh — configures UDEV for ASM shared disks

  9. Sets the hostname

  10. Runs oracle_user_environment_setup.sh — creates environment scripts, GRID_HOME and DB_HOME directories, and partially prepares passwordless SSH

  11. Partially prepares passwordless SSH for the root user (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:

AttributeValue
OSOracle Linux 8.2
VM Nameol8_19_rac1
CPUs2
RAM7168 MB
NIC 1NAT Network
NIC 2192.168.56.101 (public network)
NIC 3192.168.1.101 (private network)
Disk 1Box disk with OS pre-installed
Disk 2Local disk for /u01 mount point
Disk 3-5CRS disks 1-3
Disk 6DATA disk
Disk 7RECO disk

What root_setup.sh Does (in addition to node 2 steps):

  1. Completes passwordless SSH for oracle and root users using sshpass and ssh-copy-id

  2. Installs the cvuqdisk package on both nodes

  3. Runs oracle_grid_software_installation.sh — silent Grid Infrastructure installation

  4. Runs orainstRoot.sh on node 1, then node 2

  5. Runs root.sh on node 1, then node 2

  6. Runs oracle_grid_software_config.sh — silent Grid Infrastructure configuration and cluster status

  7. Runs oracle_db_software_installation.sh — silent database software installation

  8. Runs root.sh on node 1, then node 2

  9. Applies the OJVM Patch on both nodes

  10. Runs oracle_create_database.sh — silent database creation using DBCA

Result: Once vagrant up completes, you have a fully configured and running 2-node RAC.


The Complete Build Flow

text
┌─────────────────────────────────────────────────────────────────┐
│  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:

  1. Passwordless SSH Issue: An incompatibility between the way the 19.3 GI installer tests for passwordless SSH and how SCP works on OL8.2

  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:

bash
# 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/scp

Workaround for OS Certification (If Not Applying the RU)

bash
export CV_ASSUME_DISTID=OEL7.6

Note: These workarounds are not necessary if you apply the patches as part of the installations using the -applyRU parameter.


Best Practices

PracticeDescription
Ensure Sufficient ResourcesAllocate at least 6 GB RAM per RAC node
Use Separate Physical DisksSplit virtual disks across physical disks for better performance
Use DNS for SCANRequired for SCAN listener functionality
Apply the 19.7 RUAvoids SSH and SCP issues on OL8.2
Monitor Build ProgressThe build takes hours—be patient and monitor logs
Verify Each PhaseDon't continue if DNS or node2 builds fail
Use Version ControlKeep your vagrant.yml and install.env in version control
Document CustomizationsRecord any changes to the default configuration

Troubleshooting Common Issues

IssuePossible CauseSolution
Scripts fail on LinuxWindows line terminatorsConfigure Git to preserve UNIX line terminators
DNS build failsWrong IP configurationVerify vagrant.yml and install.env
Node 2 build failsDisk path issuesVerify the shared disk paths in vagrant.yml
Node 1 build failsDNS or node 2 not runningEnsure DNS and node 2 are up before node 1
SSH passwordless failsSCP incompatibility on OL8.2Apply the 19.7 RU or use the SCP workaround
GI installer failsOS not certifiedUse CV_ASSUME_DISTID=OEL7.6
Insufficient memoryNot enough RAMAllocate at least 6 GB per node
Slow performanceDisk speed limitationsUse 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:

  1. Required Software: Install VirtualBox, Vagrant, Git, and download Oracle software

  2. Clone Repository: Clone the Vagrant repository and copy Oracle software

  3. Amend File Paths: Configure shared disk paths in vagrant.yml

  4. Build the RAC: Start DNS, node2, then node1 (in that order)

  5. Turn Off RAC: Cleanly halt the VMs

  6. 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