In this article series, we are going to build a complete Oracle Data Guard 19c environment step by step, starting from scratch.
This environment will not only include a Primary Database and a Physical Standby, but will also cover advanced features such as Fast-Start Failover (FSFO), Observer, and automatic reinstantiation.
This is exactly what many organizations need, but it is rarely presented in a structured, practical, and step-by-step manner in Persian resources.
In this tutorial, all stages—from operating system installation to performing a real failover test and observing Application Continuity behavior—will be executed practically, based on real-world experiences from data centers and enterprise projects.
The goal of this series is to create a fully practical, repeatable, and deployable learning path, so that any DBA can simulate a standard and professional Data Guard environment on their own personal laptop.
Scope of Part One: Infrastructure Preparation
In this first part, our focus is on preparing the infrastructure:
-
Creating virtual machines using VirtualBox
-
Configuring the network for stable communication between Primary and Standby
-
Installing Oracle Linux 9.6
-
Performing initial configurations, including required packages, kernel parameters, and disabling services that are not needed in a test environment
All of these foundational steps prepare us for installing Oracle Grid Infrastructure, creating the Primary Database, building the Standby database, configuring Data Guard Broker, and ultimately enabling Fast Failover.
If you are planning to build a real and standard Data Guard environment—whether for enterprise testing, training, resume enhancement, or hands-on projects—this series will guide you through the entire process.
Requirements
-
Oracle Linux 9.6 ISO (FULL PACKAGE)
-
Oracle Grid Infrastructure and Oracle Database version 19.3
-
Patch 19.29
-
OPatch compatible with version 19.29
The last two items require access to Oracle Metalink or can be obtained from someone who already has them.
-
Preinstallation RPM package, which you can download from the Telegram channel:
t.me/vahiddb_dba
Let’s start with the very first step: preparing the virtual machines.
Virtual Machine Specifications
We will create two virtual machines with the following specifications:
-
CPU: 4 cores
-
RAM: 8 GB
-
HDD: 150 GB (used for OS installation and software installation)
-
HDD: 10 GB (used for data)
-
NIC type: Host-Only Adapter
We name one machine dc1 and the other dc2, where dc stands for datacenter.
IP addresses are assigned as follows:
-
192.168.56.21 → dc1
-
192.168.56.22 → dc2
VirtualBox Installation Steps
-
Launch VirtualBox.
-
Click New (the large icon at the top of the window).
-
Set the machine name to dc1 and choose an appropriate location on your system.
-
Click ISO Image and select Oracle Linux 9.6.
-
Check Skip Unattended Installation.
-
Go to the Hardware section.
-
Set RAM to 8 GB and CPU to 4 cores (these values can be reduced based on your system capacity).
-
Go to the Hard Disk section.
-
Set disk size to 150 GB. This space will not be allocated immediately; it will grow dynamically.
-
Click Finish.
Adding the Data Disk
-
Right-click the virtual machine and select Settings.
-
From the left menu, go to Storage.
-
Next to the SATA Controller, click the plus (+) icon next to the disk symbol.
-
In the new window, click Create.
-
Set the size to 10–20 GB and check Pre-allocate Full Size.
-
After the disk is created, select it from the Not Attached section.
Network Configuration
-
Go to the Network section.
-
Set Attached to as Host-Only Adapter.
-
Click OK.
Installing Oracle Linux
-
Select the virtual machine and click Start.
-
Click inside the VM window. Your mouse will be captured; to release it, press the Right Ctrl key.
-
Select Install and press Enter.
-
Wait for the initial screen to load.
-
Accept the default language (English – United States) and click Continue.
Disk Partitioning
-
Enter Installation Destination.
-
Select the 150 GB disk, choose Custom at the bottom, then click Done.
-
Since the partitioning type is LVM, click the + button.
-
Create the following mount points:
-
/with size 40 GiB -
/bootwith size 1 GiB -
swapwith size 9 GiB -
/u01with no specified size (it will use all remaining space)
-
-
Click Done, confirm the changes, and return to the main screen.
Software Selection
-
Enter Software Selection.
-
Choose Minimal Install from the left menu to avoid installing unnecessary packages.
-
Click Done.
Root Password
-
Go to Root Password.
-
Set a password for the root user and click Done.
Network & Hostname Configuration
-
Enter Network & Hostname.
-
Click Configure (bottom-left).
-
Go to the IPv4 Settings tab.
-
Change Method from Automatic to Manual.
-
Click Add and enter the following for the first machine (use a unique IP for the standby machine):
-
Address:
192.168.56.21 -
Netmask:
24 -
Gateway:
192.168.56.1
-
-
Click Save, then Done.
Start Installation
Click Begin Installation.
After installation completes, click Reboot System.
Enabling Root SSH Access
By default, Oracle Linux 9 does not allow SSH access for the root user.
-
Log in as root via the VirtualBox console.
-
Edit the SSH configuration file:
vi /etc/ssh/sshd_config
-
Press
ito enter insert mode. -
Locate the line containing
PermitRootLogin. -
Remove the
#and change the value fromprohibit-passwordtoyes. -
Press
Esc, then type:wqand press Enter. -
Restart the SSH service:
systemctl restart sshd
Repeat all of the above steps to create dc2.
Final OS Configuration
Connect to both servers using MobaXterm.
Since this is a test environment, we disable firewalld and SELinux.
Disable firewall at boot:
systemctl disable firewalld
Set SELinux to permissive:
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
Set hostnames:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.21 dc1 dc1.vahiddb.com
192.168.56.22 dc2 dc2.vahiddb.com
Restart both machines.
Video Link:
YouTube video link for this part in persian
Next Part