Friday, 29 September 2023

Oracle Database Patching (Upgrade from 19.3.0.0.0 to 19.20.0.0.0)


This document will help patching Oracle database 19.3.0.0.0 and ASM 19.3.0.0.0 and take the binaries to 19.20.0.0.0
Pre-Requisite and downloads:
Target Audience:
  1. Oracle DBA with basic knowledge of Installations
Scenario for Upgrade:
  1. Single Node Binary of Oracle DB 19.3.0.0.0
  2. Single node Binary Oracle grid infrastructure (Oracle Restart) 19.3.0.0.0
  3. Storage is not attached to ASM yet. There is no DB available
Pre-Requisites:
  1. DB binaries is already installed and version is 19.3.0.0.0
  2. ASM binaries is already installed and version is 19.3.0.0.0
  3. Putty/terminal can be accessible
Software Versions:
  1. RU Patch 19.20.0.0.0
  2. Latest OPatch
Download:
Follow Oracle support document : Doc ID 19202307



Download patch 35319490 for Grid infra. This patch contains both DB and Grid patches.



WGET option can also be used to download. Click on Wget Option to get script to download using wget





Note : Go Through README of the patch in conjunction with this document.
Download the patch for "Linux x86-64 (American English)"
Download latest OPatch (v 12.2.0.1.39) from [link] (https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6880880 ) given the README of the patch.




Steps for Patching

Login using grid user:

su - grid
Create a folder where the patch and OPatch software to be downloaded and extracted
mkdir /home/grid/dbpatch

OPatch installation will go first. Take backup of existing OPatch folder from $ORACLE_HOME directory.

Installation of OPatch Using Grid User

sudo su - grid
backup OPatch as OPatch.org
cd $ORACLE_HOME
mv OPatch OPatch.org

Go to patch folder /home/grid/dbpatch

cd /home/grid/dbpatch
unzip p6880880_122010_Linux-x86-64.zip $ORACLE_HOME/

check if everything is fine
opatch version

This command should run without any issue and it should give you version of OPatch as : 12.2.0.1.39

if everything is fine, take inventory list :

opatch lsinventory -detail -Oh $ORACLE_HOME  > /home/grid/GridInventoryListPreUpgrade.txt

OPatch installation will go first. Take backup of existing OPatch folder from $ORACLE_HOME directory.

Installation of OPatch Using Oracle User

sudo su - oracle
backup OPatch as OPatch.org
cd $ORACLE_HOME
mv OPatch OPatch.org

Go to patch folder /home/grid/dbpatch

cd /home/grid/orclsoft
unzip p6880880_122010_Linux-x86-64.zip $ORACLE_HOME/

check if everything is fine
opatch version

This command should run without any issue and it should give you version of OPatch as : 12.2.0.1.39

if everything is fine, take inventory list :

opatch lsinventory -detail -Oh $ORACLE_HOME  > /home/oracle/OraInventoryListPreUpgrade.txt

Unzip Patch 35319490 in folder /home/grid/orclsoft

unzip p35319490_190000_Linux-x86-64.zip -d /home/grid/orclsoft/

Check conflicts with patch :

 sudo su - grid
 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/orclsoft/35319490/35320081 
 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/orclsoft/35319490/35320149  
 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/orclsoft/35319490/35332537  
 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/orclsoft/35319490/35553096 
 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/orclsoft/35319490/33575402 

Same with Oracle User:

 sudo su - oracle
 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/oracle/orclsoft/35319490/35320081 
 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/oracle/orclsoft/35319490/35320149 

Validate if /tmp has free space:

Login with grid user

  sudo su - grid

Create a file in /tmp folder:

vi /tmp/patch_list_gihome.txt

/home/grid/orclsoft/35319490/35320081
/home/grid/orclsoft/35319490/35320149
/home/grid/orclsoft/35319490/35332537
/home/grid/orclsoft/35319490/35553096
/home/grid/orclsoft/35319490/33575402

Execute checking space command:

sudo su - grid
$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt

Validate if /tmp has free space for Oracle user:

Login with oracle user

  sudo su - oracle

Create a file in /tmp folder:

vi /tmp/patch_list_dbhome.txt

/home/oracle/orclsoft/35319490/35320081
/home/oracle/orclsoft/35319490/35320149

Execute checking space command:

sudo su - oracle
$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt

Note: Skip step 2.1.2 as there are no conflicts

Note: Skip step 2.1.3 as We don't have clustered installed. We have only binaries

Now the environment is ready for patching. We can start patching grid home.

Login with root

su -

export PATH=$PATH:/u01/app/19.0.0/grid/OPatch

validate opatch and opatchauto is working here with root user:

opatch version
opatchauto version

if everything looks fine, apply the patch on grid home using:

opatchauto apply /home/grid/orclsoft/35319490 -oh /u01/app/19.0.0/grid
This will provide output at the end like:


if the patch returned successful, the validation can be done by logging into sqlplus as:

 sqlplus / as sysasm

This should return:



Patching on Grid home done, let's move to patching oracle home
Open new Terminal and Login with root

su -

export PATH=$PATH:/u01/app/oracle/product/19.0.0/db_1/OPatch

validate opatch and opatchauto is working here with root user:

opatch version
opatchauto version

if everything looks fine, apply the patch on grid home using:

opatchauto apply /home/oracle/orclsoft/35319490 -oh /u01/app/oracle/product/19.0.0/db_1

This will provide output at the end like:

if the patch returned successful, the validation can be done by logging into sqlplus as:

 sqlplus / as sysadmin

This should return:

No comments:

Post a Comment

How can you ensure Seamless Data recovery with cloud disaster recovery solution??

 1. Plan Ahead Begin with conducting a thorough risk assessment to identify potential threats to your data and applications. based on the as...