Oracle Database Software 21c Silent Installation with RU Patching: A Step-by-Step Guide
Oracle Database Silent Installation Overview
Silent installation allows you to install Oracle Database without any user interaction by using a response file that contains pre-configured settings.
Step 1: Install the Oracle Database Preinstallation Package
Before starting the installation, download the Oracle Database 21c installation files (V1011496-01.zip) & need to install the required preinstallation package. This package configures the system with the necessary dependencies (users, groups, kernel parameters, etc.).
Run the following command to install the preinstallation package:
[root@discovery ~]# yum install -y oracle-database-preinstall-21c
Step 2: Prepare the Installation Directory
Create and configure the directories where Oracle will be installed. Set permissions for the Oracle user and group.
Create directories:
[root@discovery ~]#mkdir -p /u02/app/oracle/product/21/dbhome_1
[root@discovery ~]#mkdir -p =/u02/app/oraInventory
Set ownership and permissions:
[root@discovery ~]# chown -R oracle:oinstall /u02
[root@discovery ~]# chmod -R 775 /u02
Step 3: Unzip the Oracle Database Installation Files
Unzip the Oracle Database 21c installation files into the Oracle home directory.
[oracle@discovery ~]$ unzip V1011496-01.zip -d /u02/app/oracle/product/21/dbhome_1/
Step 4: Set Oracle Environment Variables
Set the required environment variables for the Oracle Database installation:
[oracle@discovery u02]$ export ORACLE_HOME=/u02/app/oracle/product/21/dbhome_1
[oracle@discovery u02]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@discovery u02]$ export CV_ASSUME_DISTID=OL8
[oracle@discovery response]$ export INVENTORY_LOCATION=/u02/app/oraInventory
Step 5: Configure the Response File
The silent installation uses a response file (db_install.rsp
) to automate the installation. Navigate to the response directory and modify the db_install.rsp
file with the correct settings.
[oracle@discovery dbhome_1]$ cd /u02/app/oracle/product/21/dbhome_1/install/response/
Update the following:
- oracle.install.option=INSTALL_DB_SWONLY
- INVENTORY_LOCATION=/u02/app/oraInventory
- ORACLE_HOME=/u02/app/oracle/product/21/dbhome_1
- ORACLE_BASE=/u02/app/oracle
- oracle.install.db.InstallEdition=EE
- oracle.install.db.OSDBA_GROUP=oinstall
- oracle.install.db.OSOPER_GROUP=oinstall
- oracle.install.db.OSBACKUPDBA_GROUP=oinstall
- oracle.install.db.OSDGDBA_GROUP=oinstall
- oracle.install.db.OSKMDBA_GROUP=oinstall
- oracle.install.db.OSRACDBA_GROUP=oinstall
- oracle.install.db.rootconfig.executeRootScript=false
Sample db_install.rsp output:
[oracle@discovery response]$ cat db_install.rsp
####################################################################
## Copyright(c) Oracle Corporation 1998,2021. All rights reserved.##
## ##
## Specify values for the variables listed below to customize ##
## your installation. ##
## ##
## Each variable is associated with a comment. The comment ##
## can help to populate the variables with the appropriate ##
## values. ##
## ##
## IMPORTANT NOTE: This file contains plain text passwords and ##
## should be secured to have read permission only by oracle user ##
## or db administrator who owns this installation. ##
## ##
####################################################################
#------------------------------------------------------------------------------
# Do not change the following system generated value.
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v21.0.0
#-------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
# - INSTALL_DB_SWONLY
# - INSTALL_DB_AND_CONFIG
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY
#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall
#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/u02/app/oraInventory
#-------------------------------------------------------------------------------
# Specify the complete path of the Oracle Home.
#-------------------------------------------------------------------------------
ORACLE_HOME=/u02/app/oracle/product/21/dbhome_1
#-------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base.
#-------------------------------------------------------------------------------
ORACLE_BASE=/u02/app/oracle
#-------------------------------------------------------------------------------
# Specify the installation edition of the component.
#
# The value should contain only one of these choices.
# - EE : Enterprise Edition
# - SE2 : Standard Edition 2
#-------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE
###############################################################################
# #
# PRIVILEGED OPERATING SYSTEM GROUPS #
# ------------------------------------------ #
# Provide values for the OS groups to which SYSDBA and SYSOPER privileges #
# needs to be granted. If the install is being performed as a member of the #
# group "dba", then that will be used unless specified otherwise below. #
# #
# The value to be specified for OSDBA and OSOPER group is only for UNIX based #
# Operating System. #
# #
###############################################################################
#------------------------------------------------------------------------------
# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges.
#-------------------------------------------------------------------------------
oracle.install.db.OSDBA_GROUP=oinstall
#------------------------------------------------------------------------------
# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges.
# The value to be specified for OSOPER group is optional.
#------------------------------------------------------------------------------
oracle.install.db.OSOPER_GROUP=oinstall
#------------------------------------------------------------------------------
# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSBACKUPDBA_GROUP=oinstall
#------------------------------------------------------------------------------
# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSDGDBA_GROUP=oinstall
#------------------------------------------------------------------------------
# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSKMDBA_GROUP=oinstall
#------------------------------------------------------------------------------
# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSRACDBA_GROUP=oinstall
################################################################################
# #
# Root script execution configuration #
# #
################################################################################
#-------------------------------------------------------------------------------------------------------
# Specify the root script execution mode.
#
# - true : To execute the root script automatically by using the appropriate configuration methods.
# - false : To execute the root script manually.
#
# If this option is selected, password should be specified on the console.
#-------------------------------------------------------------------------------------------------------
oracle.install.db.rootconfig.executeRootScript=false
Now that your db_install.rsp
file is ready, you need to download the RU patch. Best Practice for Oracle Software Installation: Apply RU patches during the installation
1. Downloading and Transferring Patch Files
The first step in patching is to download the required patches from Oracle Support. We are going to apply patch 21.15, and once the patch is downloaded, you can use the secure copy (SCP) command to transfer the patch files from your local machine to the Oracle server
scp -pr ./
p36352352_210000_Linux-x86-64.zip ./p6880880_210000_Linux-x86-64.zip root@discovery:/u02/patch/
2. Set Permissions for the Patch Directory
Once the patch files are copied to the server, change the ownership and permissions for the patch directory so that the Oracle user can access them.
[root@discovery u02]# chown -R oracle:oinstall patch/
[root@discovery u02]# chmod -R 775 patch/
3. Verify OPatch Version
Login as the Oracle user and verify the current version of Opatch utility.
[root@discovery u02]# su - oracle
[oracle@discovery ~]$ cd /u02/app/oracle/product/21/dbhome_1/OPatch/
[oracle@discovery OPatch]$ ./opatch version
[oracle@discovery OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.17
OPatch succeeded.
4.Upgrade OPatch Directory
Download the latest Opatch p6880880_210000_Linux-x86-64.zip, Before upgrade opatch directory, it’s recommended to backup the current OPatch directory.
[oracle@discovery dbhome_1]$ mv OPatch OPatch_bkp
This will create a backup of the existing OPatch directory. Next, unzip the opatch files into the Oracle home directory.
[oracle@discovery patch]$ unzip p6880880_210000_Linux-x86-64.zip -d /u02/app/oracle/product/21/dbhome_1/
After unzipping the opatch, verify the opatch version.
cd /u02/app/oracle/product/21/dbhome_1/OPatch/
[oracle@discovery OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.44
OPatch succeeded.
5.Unzip the Patch
Similarly, unzip the patch file:
[oracle@discovery patch]$ unzip p36352352_210000_Linux-x86-64.zip
Run the Oracle Installer with the -applyRU Option
[oracle@discovery dbhome_1]$ ./runInstaller -applyRU /u02/patch/36352352 -waitForCompletion -silent -responseFile /u02/app/oracle/product/21/dbhome_1/install/response/db_install.rsp
Sample Silent Installation with RU Patching Output
[oracle@discovery dbhome_1]$ ./runInstaller -applyRU /u02/patch/36352352 -waitForCompletion -silent -responseFile /u02/app/oracle/product/21/dbhome_1/install/response/db_install.rsp
Preparing the home to patch...
Applying the patch /u02/patch/36352352...
Successfully applied the patch.
The log can be found at: /u01/app/oraInventory/logs/InstallActions2024-11-22_07-36-08AM/installerPatchActions_2024-11-22_07-36-08AM.log
Launching Oracle Database Setup Wizard...
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2024-11-22_07-36-08AM/installActions2024-11-22_07-36-08AM.log
ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2024-11-22_07-36-08AM/installActions2024-11-22_07-36-08AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
/u02/app/oracle/product/21/dbhome_1/install/response/db_2024-11-22_07-36-08AM.rsp
You can find the log of this install session at:
/u01/app/oraInventory/logs/InstallActions2024-11-22_07-36-08AM/installActions2024-11-22_07-36-08AM.log
As a root user, execute the following script(s):
1. /u02/app/oracle/product/21/dbhome_1/root.sh
Execute /u02/app/oracle/product/21/dbhome_1/root.sh on the following nodes:
[discovery]
Successfully Setup Software with warning(s).
[oracle@discovery dbhome_1]$ exit
logout
[root@discovery ~]# sh /u02/app/oracle/product/21/dbhome_1/root.sh
Check /u02/app/oracle/product/21/dbhome_1/install/root_discovery_2024-11-22_07-42-25-697600994.log for the output of root script
The installation was completed successfully!
Alert: The information provided on this website is for educational purposes only. It has been tested internally, but there is no guarantee it will work in every environment. It is strongly recommended to first test the process in a non-production environment, such as a User Acceptance Testing (UAT) setup. This allows you to verify configurations, identify any issues, and ensure a smooth transition to production, minimizing the risk of disruptions in your live environment. Always conduct thorough testing before applying changes to production systems.