Install Oracle 19c on Amazon Linux 2 (GUI-Based)
Installing Oracle 19c on Amazon Linux 2 is now easier than ever with this step-by-step guide designed for a real-world production setup. This tutorial uses the GUI-based Oracle Universal Installer (OUI) and includes verified commands, kernel tuning, X11 support, and optional patching — all tested and optimized for Amazon EC2 environments.
✅ What you’ll achieve: A fully functional Oracle 19c instance with all OS prerequisites properly configured on Amazon Linux 2 (2025).
🎥 Watch this step-by-step tutorial on how to install Oracle 19c on Amazon Linux 2 (2025) before following the written guide.
✅ Step 1: Check System Kernel Version
Run the following command to check system details:
uname -a
This reveals the kernel version, architecture, and hostname. It’s crucial to verify that you’re using Amazon Linux 2, which is compatible with Oracle 19c.
✅ Step 2: Install Required Packages
Run as root:
sudo yum install -y binutils compat-libcap1 compat-libstdc++-33 \
gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel \
libX11 libXau libXi libXtst libXrender libXrender-devel \
libgcc libstdc++ libstdc++-devel libxcb make smartmontools \
sysstat
These packages include development tools, GUI libraries, and system utilities Oracle needs to install and run properly.
💡 Tip: These are production-tested on Amazon Linux 2 (2025), ensuring smoother installation with fewer missing dependencies.
✅ Step 3: Configure System Kernel Parameters
Edit /etc/sysctl.conf
and add the following:
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
These values fine-tune memory, semaphore, and networking parameters for Oracle’s heavy workloads.
✅ Step 4: Verify and Apply Kernel Parameter Changes
cat /etc/sysctl.conf
sudo sysctl -p
sysctl -a | grep oracle
This applies the changes and verifies they’re live — no reboot required.
✅ Step 5: Disable SELinux
setenforce 0
sed -i 's/^SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
getenforce
Expected output:
Permissive
⚠️ Important: Oracle installation fails or behaves unpredictably under SELinux Enforcing mode.
✅ Step 6: Set Resource Limits for the Oracle User
Run as root:
echo "oracle soft nofile 1024" >> /etc/security/limits.d/oracle.conf
echo "oracle hard nofile 65536" >> /etc/security/limits.d/oracle.conf
echo "oracle soft nproc 16384" >> /etc/security/limits.d/oracle.conf
echo "oracle hard nproc 16384" >> /etc/security/limits.d/oracle.conf
echo "oracle soft stack 10240" >> /etc/security/limits.d/oracle.conf
echo "oracle hard stack 32768" >> /etc/security/limits.d/oracle.conf
echo "oracle hard memlock 134217728" >> /etc/security/limits.d/oracle.conf
echo "oracle soft memlock 134217728" >> /etc/security/limits.d/oracle.conf
Then verify:
su - oracle
ulimit -a
✅ Step 7: Disable Swap
swapoff -a
sed -i '/swap/d' /etc/fstab
free -m
🧠 Why? Oracle uses huge pages and locked memory. Swap interferes with performance, especially for production.
✅ Step 8: Disable Firewall
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
✅ Step 9: Create Oracle User and Groups
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
useradd -u 54321 -g oinstall -G dba,oper oracle
id oracle
🔐 Note: These groups are required to define roles for installation and DB operations.
✅ Step 10: Set Password for the Oracle User
passwd oracle
su - oracle
✅ Step 11: Create Required Directories and Set Permissions
mkdir -p /u01/app/oracle/product/19c/db_1
mkdir -p /u02/oracle/oradata
mkdir -p /u02/oracle/FRA
mkdir -p /backup/patch
chown -R oracle:oinstall /u01 /u02 /backup
chmod -R 750 /u01 /u02 /backup
ls -ld /u01 /u02 /backup
📁 These paths are optimized for a clean multi-volume Oracle layout.
✅ Step 12: Configure Oracle Environment Variables
su - oracle
vi ~/.bash_profile
Add:
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=ip-172-31-47-65.ap-south-1.compute.internal
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
export ORACLE_SID=orcl
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export PATH=$ORACLE_HOME/OPatch:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Reload:
. ~/.bash_profile
env | grep ORA
✅ Step 13: Download, Rename, and Unzip Oracle 19c
cd $ORACLE_HOME
wget -O LINUX.X64_193000_db_home.zip "https://download.oracle.com/otn/linux/oracle19c/190000/LINUX.X64_193000_db_home.zip?AuthParam=..."
unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
ls -lrt
✅ Step 14: Install X11 for GUI Installer
Amazon Linux 2:
sudo yum install -y xorg-x11-xauth
sudo yum install -y xclock xterm
🖥️ These enable you to launch the Oracle GUI installer over X11 forwarding.
✅ Step 15: Export a False Image for Oracle Installation
Oracle’s installer checks the OS version and may fail on newer or unofficial distributions. To bypass compatibility issues, set the CV_ASSUME_DISTID
environment variable to mimic a supported OS version.
Use the setting that matches your distribution:
# Oracle Linux
export CV_ASSUME_DISTID=OL8 # For Oracle Linux 8
export CV_ASSUME_DISTID=OL7 # For Oracle Linux 7
# Red Hat Enterprise Linux (RHEL)
export CV_ASSUME_DISTID=RHEL8 # For RHEL 8
export CV_ASSUME_DISTID=RHEL7 # For RHEL 7
# Amazon Linux
export CV_ASSUME_DISTID=OL8 # Assume compatibility with Oracle Linux 8
# Ubuntu (Debian-based)
export CV_ASSUME_DISTID=OL8 # Mimic Oracle Linux 8
# SUSE Linux Enterprise Server (SLES)
export CV_ASSUME_DISTID=SLES12 # For SLES 12
export CV_ASSUME_DISTID=SLES15 # For SLES 15
# Sun Solaris (SPARC or x86)
export CV_ASSUME_DISTID=SOLARIS
# CentOS (Now Stream)
export CV_ASSUME_DISTID=RHEL8 # Since CentOS is RHEL-based
# Rocky Linux / AlmaLinux
export CV_ASSUME_DISTID=RHEL8
✅ Tip: Even if you’re using Amazon Linux 2, setting
OL8
ensures compatibility.
🔒 Persist the Setting for the Oracle User
Edit the Oracle user’s .bash_profile
to make this change permanent:
vi ~/.bash_profile
Add at the end:
export CV_ASSUME_DISTID=OL8
Apply changes:
. ~/.bash_profile # Reload profile
echo $CV_ASSUME_DISTID # Verify setting
🧠 This prevents having to manually re-export the variable every time you log in.
Expected Output:
OL8 # or your set value
Step 16: Start Oracle 19c Installer
Now, switch to the oracle user and start the Oracle 19c GUI installer.
Switch to the oracle User
Run the following command from the ec2-user:
su - oracle
Enter the oracle user password when prompted.
Verify the Current Directory
Ensure you are in the oracle home directory:
pwd
# Expected Output: /home/oracle
Set the Compatibility Variable
Export the CV_ASSUME_DISTID variable to ensure compatibility:
export CV_ASSUME_DISTID=OEL7.6
Start Oracle 19c Installer
cd $ORACLE_HOME
./runInstaller
The Oracle Universal Installer (OUI) GUI will launch. Follow the on-screen steps to complete the installation. ✅
If you want to apply a patch while installing Oracle 19c, use the following command instead of just ./runInstaller:
./runInstaller -applyRU /backup/patch/35943157
- -applyRU applies the Release Update (RU) patch before installation completes.
- Replace 35943157 with the correct patch number if using a different patch.
This ensures your Oracle database is installed with the latest updates right from the start!