[Oracle] How to create Oracle RAC using Virtual Box and Vagrant
Hi guys,
In this article I’m going to show you how to create oracle RAC using Virtual Box and Vagrant.
I’m using OS win10 on my pc and I’ve installed these software:
ENVIRONMENT
- VirtualBox Version 6.1.4 r136177 (Qt5.6.2)
- Vagrant Vagrant 2.2.7
- A Git client GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
You will also need to download the 19c Grid Infrastructure and Database zip files from here. You’ll see what to do with that in a moment.
• Grid: LINUX.X64_193000_grid_home.zip
• Database: LINUX.X64_193000_db_home.zip
You have to place in your favorite area in your filesystem and perform the following command:
$ git clone https://github.com/oraclebase/vagrant.git
Copy the Oracle software under the “…./software/” directory. From the “rac/ol7_19” subdirectory:
dario@elrond MINGW64 /e/vagrant/rac/ol7_19/software (master)
$ ll
total 5809469
-rw-r--r-- 1 dario 197609 3059705302 nov 7 21:52 LINUX.X64_193000_db_home.zip
-rw-r--r-- 1 dario 197609 2889184573 ott 25 09:31 LINUX.X64_193000_grid_home.zip
-rw-r--r-- 1 dario 197609 104 mar 3 21:33 put_software_here.txt
You have to indicate the position of your disks that you want to create:
In my case this is the path:
dario@elrond MINGW64 /e/vagrant/rac/ol7_19/config (master)
$ pwd
/e/vagrant/rac/ol7_19/config
You can edit the file vagrant.yml
asm_crs_disk_1: E:\VirtualBox\shared\ol7_19_rac\asm_crs_disk_1.vdi
asm_crs_disk_2: E:\VirtualBox\shared\ol7_19_rac\asm_crs_disk_2.vdi
asm_crs_disk_3: E:\VirtualBox\shared\ol7_19_rac\asm_crs_disk_3.vdi
asm_crs_disk_size: 2
asm_data_disk_1: E:\VirtualBox\shared\ol7_19_rac\asm_data_disk_1.vdi
asm_data_disk_size: 40
asm_reco_disk_1: E:\VirtualBox\shared\ol7_19_rac\asm_reco_disk_1.vdi
asm_reco_disk_size: 20
My path is “E:\VirtualBox\shared\ol7_19_rac\asm_crs_disk_1.vdi” you can replace with your path.
Now you can start for build the rac, you can put in your folder where ../ol7_19 and run these commands:
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.
cd ../node1
vagrant up
Connect Rac
You have to use vagrant ssh as below.
dario@elrond MINGW64 /e/vagrant/rac/ol7_19/node2 (master)
$ vagrant ssh
Last login: Thu Mar 5 16:26:52 2020 from 10.0.2.2
$ sudo su -
$ su - oracle
$ sqlplus as / sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 10 18:10:09 2020 Version 19.3.0.0.0 Copyright (c)
1982, 2019, Oracle. All rights reserved. Connected
to: Oracle Database 19c Enterprise Edition Release
19.0.0.0.0 - Production Version 19.3.0.0.0
SQL>
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
Keep in touch!
Stay Tuned!! ITHACK#