Wednesday, April 22, 2026

Installing Oracle Database 19c on Amazon Linux 2 with autoupgrade.jar

 

A comprehensive guide for installing Oracle Database 19c Enterprise Edition on EC2 instances running Amazon Linux 2. 

Demo Purpose for Oracle 19c silent installation and autoupgrade.jar, as Oracle 19c is NOT officially certified on Amazon Linux 2.

Overview

This guide covers the installation of Oracle Database 19c using silent mode for automation and creates a non-CDB database (ORCL) .

Important: Oracle 19c is NOT officially supported on Amazon Linux 2023 due to glibc 2.34+ compatibility issues. Use Amazon Linux 2 instead.

Installation Steps

Step 1: Install Required Packages

Install all prerequisite packages required by Oracle Database:

sudo yum install -y \
  bc \
  binutils \
  elfutils-libelf \
  fontconfig \
  glibc \
  glibc-devel \
  ksh \
  libaio \
  libX11 \
  libXau \
  libXi \
  libXrender \
  libXtst \
  libgcc \
  libstdc++ \
  libxcb \
  make \
  policycoreutils \
  smartmontools \
  sysstat

Install JDK 21 (required for AutoUpgrade):

# Add Amazon Corretto repository
sudo rpm --import https://yum.corretto.aws/corretto.key
sudo curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo

# Install JDK 21
sudo yum install -y java-21-amazon-corretto-devel

# Verify installation
java -version

Expected output:

openjdk version "21.0.10" 2026-01-20 LTS
OpenJDK Runtime Environment Corretto-21.0.10.7.1 (build 21.0.10+7-LTS)

Note: Amazon Linux 2 uses yum package manager, not dnf. Most required packages are already installed by default.

Step 2: Create Oracle Groups

Create the required Oracle Inventory and database administration groups:

# Primary installation group
sudo /usr/sbin/groupadd -g 54321 oinstall

# Database administration groups
sudo /usr/sbin/groupadd -g 54322 dba
sudo /usr/sbin/groupadd -g 54323 oper
sudo /usr/sbin/groupadd -g 54324 backupdba
sudo /usr/sbin/groupadd -g 54325 dgdba
sudo /usr/sbin/groupadd -g 54326 kmdba
sudo /usr/sbin/groupadd -g 54330 racdba

Group Purposes:

  • oinstall: Oracle Inventory group (primary)
  • dba: Database Administrator (SYSDBA)
  • oper: Database Operator (SYSOPER)
  • backupdba: Backup and Recovery (SYSBACKUP)
  • dgdba: Data Guard (SYSDG)
  • kmdba: Encryption Key Management (SYSKM)
  • racdba: Real Application Clusters

Step 3: Create Oracle User

Create the oracle user for database installation:

sudo /usr/sbin/useradd -u 54321 -g oinstall \
  -G dba,backupdba,dgdba,kmdba,racdba oracle

Set a password for the oracle user:

echo "oracle:Oracle123" | sudo chpasswd

Or interactively:

sudo passwd oracle

Step 4: Configure Resource Limits

Configure kernel resource limits for the oracle user:

sudo tee -a /etc/security/limits.conf << 'EOF'
# Oracle Database resource limits
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 28835840
oracle hard memlock 28835840
EOF

Limit Explanations:

  • nofile: Maximum number of open file descriptors
  • nproc: Maximum number of processes
  • stack: Maximum stack size (KB)
  • memlock: Maximum locked memory (KB)

Step 5: Create Directory Structure

Create the Oracle base, inventory, and staging directories:

# Create directories as root
sudo mkdir -p /u01/app/oracle
sudo mkdir -p /u01/app/oraInventory
sudo mkdir -p /u01/stage

# Set ownership
sudo chown -R oracle:oinstall /u01/app/oracle
sudo chown -R oracle:oinstall /u01/app/oraInventory
sudo chown oracle:oinstall /u01/stage

# Set permissions
sudo chmod -R 775 /u01/app

Directory Structure:

  • /u01/app/oracle: Oracle Base directory
  • /u01/app/oraInventory: Oracle Inventory location
  • /u01/stage: Staging area for installation files

Step 6: Download Installation Files Using AutoUpgrade

Download the Oracle 19c base image:

Download the base image (LINUX.X64_193000_db_home.zip) from: https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html

Transfer the file to /u01/stage/

Download patches using autoupgrade.jar:

# Switch to oracle user
sudo su - oracle

# Navigate to staging directory
cd /u01/stage

# Download autoupgrade.jar from Oracle
# Visit: https://www.oracle.com/database/upgrades/
# Place autoupgrade.jar in /u01/stage

# Create download configuration file
cat > /u01/stage/download.cfg << 'EOF'
global.global_log_dir=/u01/stage/log
global.keystore=/u01/stage/keystore
global.folder=/u01/stage/
download1.target_version=19
download1.patch=RECOMMENDED
download1.platform=LINUX.X64
EOF

# Configure MOS credentials
java -jar autoupgrade.jar -patch -config download.cfg -load_password

When prompted:

  1. Enter a keystore password (twice)
  2. At MOS> prompt, run: add -user your_email@example.com
  3. Enter your My Oracle Support password (twice)
  4. Run: save
  5. Convert to auto-login: yes
  6. Run: exit

Download the patches:

java -jar autoupgrade.jar -patch -config download.cfg -mode download

Downloaded files include:

  • DATABASE RELEASE UPDATE 19.30.0.0.0
  • OPatch 12.2.0.1.51
  • DATAPUMP BUNDLE PATCH 19.30.0.0.0
  • OJVM RELEASE UPDATE 19.30.0.0.0

### Step 7: Install Oracle Home Using AutoUpgrade

Create Oracle Home using autoupgrade.jar with the downloaded patches:

```bash
# Switch to oracle user
sudo su - oracle

# Create Oracle Home intallation directory
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1

# Navigate to staging directory
cd /u01/stage

# Create installation configuration file
cat > /u01/stage/19c.cfg << 'EOF'
global.global_log_dir=/u01/stage/log
global.keystore=/u01/stage/keystore
global.folder=/u01/stage/
install1.target_version=19
install1.patch=RECOMMENDED
install1.target_home=/u01/app/oracle/product/19.0.0/dbhome_1
install1.home_settings.oracle_base=/u01/app/oracle
install1.home_settings.edition=EE
install1.home_settings.inventory_location=/u01/app/oraInventory
install1.download=no
EOF

# Run Oracle Home creation
java -jar autoupgrade.jar -patch -config 19c.cfg -mode create_home

Monitor the installation:

# At the patch> prompt, list jobs
patch> lsj

# Monitor job progress with auto-refresh every 10 seconds
patch> lsj -a 10

Expected Output:

+----+-------------+-------+---------+-------+----------+-------+---------------------+
|Job#|      DB_NAME|  STAGE|OPERATION| STATUS|START_TIME|UPDATED|              MESSAGE|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
| 101|create_home_1|EXTRACT|EXECUTING|RUNNING|  14:05:16|25s ago|Extracting gold image|
+----+-------------+-------+---------+-------+----------+-------+---------------------+

+----+-------------+-----------+---------+-------+----------+-------+----------------------------------------+
|Job#|      DB_NAME|      STAGE|OPERATION| STATUS|START_TIME|UPDATED|                                 MESSAGE|
+----+-------------+-----------+---------+-------+----------+-------+----------------------------------------+
| 100|create_home_1|OH_PATCHING|EXECUTING|RUNNING|  15:22:28|39s ago|Database Release Update : 19.30.0.0.2601|
+----+-------------+-----------+---------+-------+----------+-------+----------------------------------------+

Job 100 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs finished                  [1]
Jobs failed                    [0]
Jobs restored                  [0]
Jobs pending                   [0]

# Run the root.sh script as root for the following jobs:
For create_home_1 -> /u01/app/oracle/product/19.0.0/dbhome_1/root.sh

# Run the orainstRoot.sh script as root for the following jobs:
For create_home_1 -> /u01/app/oraInventory/orainstRoot.sh

Please check the summary report at:
/u01/stage/log/cfgtoollogs/patch/auto/status/status.html
/u01/stage/log/cfgtoollogs/patch/auto/status/status.log

Press ENTER to exit the auto-refresh mode.

Configuration Parameters:

  • target_version=19: Oracle Database 19c
  • patch=RECOMMENDED: Install recommended patches
  • target_home: Oracle Home directory path
  • oracle_base: Oracle Base directory
  • edition=EE: Enterprise Edition
  • inventory_location: Oracle Inventory location
  • download=no: Use already downloaded files

Step 8: Execute Root Scripts

After installation completes, run the required root scripts as indicated by the installer:

# Exit oracle user session
exit

# Run as root
sudo /u01/app/oraInventory/orainstRoot.sh
sudo /u01/app/oracle/product/23.0.0/dbhome_1/root.sh

These scripts configure inventory permissions and set up Oracle Restart components.

Step 9: Configure Network Listener and Create Database

After software installation, configure the listener and create the database using silent mode.

Set Environment Variables:

# Switch to oracle user
sudo su - oracle

# Set environment
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH

Create Network Listener:

$ORACLE_HOME/bin/netca \
  /orahome $ORACLE_HOME \
  /instype typical \
  /inscomp client,oraclenet,javavm,server,ano \
  /insprtcl tcp \
  /cfg local \
  /authadp NO_VALUE \
  /responseFile $ORACLE_HOME/network/install/netca_typ.rsp \
  /lisport 1521 \
  /silent \
  /orahnam OraDB19Home1

Expected Output:

Parsing command line arguments:
    Parameter "orahome" = /u01/app/oracle/product/19.0.0/dbhome_1
    Parameter "instype" = typical
    Parameter "lisport" = 1521
    Parameter "silent" = true
Done parsing command line arguments.
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
    Running Listener Control: 
      /u01/app/oracle/product/19.0.0/dbhome_1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.

Verify Listener:

lsnrctl status

Create Non-CDB Database:

$ORACLE_HOME/bin/dbca -silent -createDatabase \
  -templateName General_Purpose.dbc \
  -gdbName ORCL \
  -sid ORCL \
  -createAsContainerDatabase false \
  -characterSet AL32UTF8 \
  -memoryPercentage 40 \
  -emConfiguration NONE \
  -datafileDestination /u01/app/oracle/oradata \
  -storageType FS \
  -sampleSchema false

When prompted, enter passwords:

  • SYS user password: ChangeT#StrongPassword
  • SYSTEM user password: ChangeT#StrongPassword

Expected Output:

Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete.
Global Database Name: ORCL
System Identifier (SID): ORCL

Database creation takes 5-10 minutes.

Note: This creates a traditional non-CDB database (not a container database). For CDB with PDB, use -createAsContainerDatabase true -numberOfPDBs 1 -pdbName pdb1.

Post-Installation Configuration

Step 10: Set Environment Variables

Add Oracle environment variables to the oracle user's profile:

# Switch to oracle user
sudo su - oracle

# Edit .bash_profile
cat >> ~/.bash_profile << 'EOF'

# Oracle Environment
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
export ORACLE_SID=ORCL
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
EOF

# Apply changes
source ~/.bash_profile

Step 11: Verify Installation

Check the installed patches and database version:

# Verify patches
$ORACLE_HOME/OPatch/opatch lspatches

Expected Output:

38523609;OJVM RELEASE UPDATE: 19.30.0.0.260120 (38523609)
38844733;DATAPUMP BUNDLE PATCH 19.30.0.0.0
38632161;Database Release Update : 19.30.0.0.260120(REL-JAN260130) (38632161)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)

OPatch succeeded.

Step 12: Test Database Connectivity

Connect to the database using SQL*Plus:

# Using SQL*Plus
sqlplus system/ChangeT#StrongPassword@localhost/ORCL

# Or as SYSDBA
sqlplus / as sysdba

Verify Version:

SELECT banner FROM v$version;
SELECT name, open_mode, cdb FROM v$database;

Expected Output:

BANNER
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

NAME      OPEN_MODE            CDB
--------- -------------------- ---
ORCL      READ WRITE           NO

Step 13: Configure Automatic Startup (Optional)

Edit /etc/oratab to enable automatic startup:

sudo vi /etc/oratab

Change the last field from N to Y:

ORCL:/u01/app/oracle/product/19.0.0/dbhome_1:Y

Or use sed:

sudo sed -i 's/^ORCL:.*:N$/ORCL:\/u01\/app\/oracle\/product\/19.0.0\/dbhome_1:Y/' /etc/oratab

Create a systemd service for automatic startup:

sudo tee /etc/systemd/system/oracle-database-orcl.service << 'EOF'
[Unit]
Description=Oracle Database Service
After=network.target

[Service]
Type=forking
User=oracle
Group=oinstall
Environment="ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1"
Environment="ORACLE_SID=ORCL"
Environment="PATH=/u01/app/oracle/product/19.0.0/dbhome_1/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin"
Environment="LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0/dbhome_1/lib"
ExecStart=/bin/bash /u01/app/oracle/product/19.0.0/dbhome_1/bin/dbstart /u01/app/oracle/product/19.0.0/dbhome_1
ExecStop=/bin/bash /u01/app/oracle/product/19.0.0/dbhome_1/bin/dbshut /u01/app/oracle/product/19.0.0/dbhome_1
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
EOF

# Enable the service
sudo systemctl daemon-reload
sudo systemctl enable oracle-database-orcl.service

Test the service:

# Start database
sudo systemctl start oracle-database-orcl.service

# Check status
sudo systemctl status oracle-database-orcl.service

# Stop database
sudo systemctl stop oracle-database-orcl.service

Database Management

Enable Archivelog Mode and Flashback

Configure the database for archivelog mode and flashback recovery:

# Switch to oracle user
sudo su - oracle

# Create Fast Recovery Area directory
mkdir -p /u01/app/oracle/fast_recovery_area

# Configure database
sqlplus / as sysdba
-- Configure Fast Recovery Area (20GB)
ALTER SYSTEM SET db_recovery_file_dest_size=20G SCOPE=BOTH;
ALTER SYSTEM SET db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' SCOPE=BOTH;

-- Enable archivelog mode
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;

-- Enable flashback
ALTER DATABASE FLASHBACK ON;

-- Verify configuration
SELECT name, log_mode, flashback_on FROM v$database;
SHOW PARAMETER db_recovery_file_dest;
ARCHIVE LOG LIST;

Expected Output:

NAME      LOG_MODE     FLASHBACK_ON
--------- ------------ ------------------
ORCL      ARCHIVELOG   YES

Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST

Starting and Stopping the Database

Manual Start:

# Start listener
lsnrctl start

# Start database
sqlplus / as sysdba
SQL> STARTUP;
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;
SQL> EXIT;

Manual Stop:

sqlplus / as sysdba
SQL> SHUTDOWN IMMEDIATE;
SQL> EXIT;

# Stop listener
lsnrctl stop

Using dbstart/dbshut:

# Start
dbstart $ORACLE_HOME

# Stop
dbshut $ORACLE_HOME

Connecting to Databases

Connect to CDB:

sqlplus / as sysdba
# or
sqlplus sys@localhost/orcl23.example.com as sysdba

Connect to PDB:

sqlplus system@localhost/pdb1.example.com

Switch Between Containers:

-- Show current container
SHOW CON_NAME;

-- Switch to PDB
ALTER SESSION SET CONTAINER = pdb1;

-- Switch to CDB root
ALTER SESSION SET CONTAINER = CDB$ROOT;

Troubleshooting

Common Issues

Issue: libcrypt.so.1 missing during installation

Error message:

AutoUpgradePatchingException [AutoUpgrade Patching failed to install the new ORACLE_HOME /u01/app/oracle/product/19.0.0/dbhome_1
/u01/app/oracle/product/19.0.0/dbhome_1/perl/bin/perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

Solution: Install the missing libnsl package:

sudo dnf install -y libnsl

Issue: libcrypt.so.1 missing (alternative fix)

If the above doesn't resolve the issue, install libxcrypt-compat:

sudo dnf install -y libxcrypt-compat

Issue: Resume failed AutoUpgrade patching job

If an AutoUpgrade patching job fails, you can restore and resume it:

# Start AutoUpgrade in patch mode
java -jar autoupgrade.jar -patch -config download.cfg

# At the patch> prompt, list jobs
patch> lsj

# Restore the failed job (this resets progress)
patch> restore -job <job_number>

# Resume the job
patch> resume -job <job_number>

Example:

patch> lsj
+----+-------------+-------+---------+------+----------+-------+
|Job#|      DB_NAME|  STAGE|OPERATION|STATUS|START_TIME|UPDATED|
+----+-------------+-------+---------+------+----------+-------+
| 102|create_home_1|INSTALL|  STOPPED| ERROR|  14:11:06|       |
+----+-------------+-------+---------+------+----------+-------+

patch> restore -job 102
patch> resume -job 102