Oracle Database 19c RAC on Oracle Linux 7 Using VirtualBox and Vagrant
I have completed Oracle Database 19c RAC installation using this method on the following host
operating system with 16G RAM.
Windows 11 Pro
Download and install the following software from below links.
1. VirtualBox
2. Vagrant
3. Git
VirtualBox 7.0.10
https://www.virtualbox.org/wiki/Downloads
Install Vagrant
Install or update to v2.3.7 (latest version) of Vagrant to get started.
https://developer.hashicorp.com/vagrant/downloads
Install Git
Download the latest (2.42.0) 64-bit version of Git for Windows. This is the most recent
maintained build. It was released 5 days ago, on 2023-08-21.
https://git-scm.com/download/win
You will also need to download the 19c Grid Infrastructure and Database zip files from below
link.
https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html
Grid: LINUX.X64_193000_grid_home.zip
Database: LINUX.X64_193000_db_home.zip
Clone Repository
Pick an area on your PC file system (C:\git\oraclebase in my case) to act as the base for this git
repository and issue the following command.
git clone https://github.com/oraclebase/vagrant.git
Copy the Oracle software under the "C:\git\oraclebase\vagrant\rac\ol7_19\software" subdirectory.
From the " C:\git\oraclebase\vagrant\rac\ol7_19 " subdirectory, the structure should look like
this.
```
$ tree
+--- 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_hostname.sh
| +--- configure_hosts_base.sh
| +--- configure_hosts_scan.sh
| +--- configure_shared_disks.sh
| +--- install_os_packages.sh
| +--- prepare_u01_disk.sh
+--- software
| +--- LINUX.X64_193000_db_home.zip
| +--- LINUX.X64_193000_grid_home.zip
| +--- put_software_here.txt
```
## Amend File Paths
The "config" directory contains a "install.env" and a "vagrant.yml" file. The combination of
these two files contain all the config used for this build. You can alter the configuration of the
build here, but remember to make sure the combination of the two stay consistent.
At minimum you will have to amend the following paths in the "vagrant.yml" file, providing
suitable paths for the shared disks.
```
asm_crs_disk_1: /u05/VirtualBox/shared/ol7_19_rac/asm_crs_disk_1.vdi
asm_crs_disk_2: /u05/VirtualBox/shared/ol7_19_rac/asm_crs_disk_2.vdi
asm_crs_disk_3: /u05/VirtualBox/shared/ol7_19_rac/asm_crs_disk_3.vdi
asm_crs_disk_size: 2
asm_data_disk_1: /u05/VirtualBox/shared/ol7_19_rac/asm_data_disk_1.vdi
asm_data_disk_size: 40
asm_reco_disk_1: /u05/VirtualBox/shared/ol7_19_rac/asm_reco_disk_1.vdi
asm_reco_disk_size: 20
```
For example, if you were working on a Windows PC, you might create a path called "
D:\VirtualBox\rac\shared\ol7_19_rac " and use the following settings.
```
asm_crs_disk_1: D:\VirtualBox\rac\shared\ol7_19_rac\asm_crs_disk_1.vdi
asm_crs_disk_2: D:\VirtualBox\rac\shared\ol7_19_rac\asm_crs_disk_2.vdi
asm_crs_disk_3: D:\VirtualBox\rac\shared\ol7_19_rac\asm_crs_disk_3.vdi
asm_crs_disk_size: 2
asm_data_disk_1: D:\VirtualBox\rac\shared\ol7_19_rac\asm_data_disk_1.vdi
asm_data_disk_size: 40
asm_reco_disk_1: D:\VirtualBox\rac\shared\ol7_19_rac\asm_reco_disk_1.vdi
asm_reco_disk_size: 20
```
If you don't alter them, they will get written to "C:\u05\VirtualBox\shared\ol7_19_rac".
## Build the RAC
The following commands will leave you with a functioning RAC installation.
Start the DNS server.
```
cd dns
vagrant up
```
Start the second node of the cluster. This must be running before you start the first node.
```
cd ../node2
vagrant up
```
Ignore the final "default: Host key verification failed." message at the end. That's fine.
Start the first node of the cluster. This will perform all of the installations operations. Depending
on the spec of the host system, this could take a long time. On one of my servers it took about 3.5
hours to complete.
```
cd ../node1
vagrant up
```
## Turn Off RAC
Perform the following to turn off the RAC cleanly.
```
cd ../node2
vagrant halt
cd ../node1
vagrant halt
cd dns
vagrant halt
```
## Remove Whole RAC
The following commands will destroy all VMs and the associated files, so you can run the
process again.
```
cd ../node2
vagrant destroy -f
cd ../node1
vagrant destroy -f
cd dns
vagrant destroy -f
```
Check all the shared disks have been removed as expected. If they are left behind they will be
reused, which will cause problems.
## DHCP Server Issue
If the VirtualBox DHCP server is enabled, you may see something like this.
* DNS up and running.
* Node2 up and running.
* Node1 grid configuration fails with the following error.
```
default: Do grid software-only installation. Wed Nov 18 23:32:46 UTC 2020
default:
******************************************************************************
default: Launching Oracle Grid Infrastructure Setup Wizard...
default: [FATAL] [INS-40718] Single Client Access Name (SCAN):ol7-19-scan could not be
resolved.
default: CAUSE: The name you provided as the SCAN could not be resolved using TCP/IP
host name lookup.
default: ACTION: Provide name to use for the SCAN for which the domain can be resolved.
```
I have seen this a few times on a Windows laptop (my main workstation). I have not seen it on
Linux. It is almost as if Node1 cannot see the DNS, even though it is there, and Node2 can see it.
I figure it must be some silly eccentricity of VirtualBox on Windows.
There are two workarounds for this.
Disable the VirtualBox DHCP server. Navigate to "File > Host Network Manager > DHCP
Server (tab)". Uncheck the "Enable Server" checkbox and click the "Apply" button.
Alternatively, do the following during the startup process.
* Start up DNS.
* Start Node2.
* Start Node1.
* While Node1 is doing the OS prerequisites, stop and start the DNS node (vagrant halt, then
vagrant up). That's not a rebuild. Just a restart. Clearly the DNS must be restarted before the
installation takes place.
Something about the DNS restart allows Node1 to see the DNS.
Reference Link: https://oracle-base.com/articles/19c/oracle-db-19c-rac-installation-on-oracle-
linux-7-using-virtualbox