()

Steps to Apply Patch on Oracle Database Home

I this article we are going to demonstrate step by Step Apply Patch on Oracle Database Home (July 2020) patch ID 31113348. Before move ahead we will see here patch July patch IDs for all available version of Oracle database along with four next release date of patches.

Patch 31281355 – Database Release Update 19.8.0.0.200714 ==> 19c
Patch 31308624 – Database Release Update 18.11.0.0.200714 ==> 18c
Patch 31312468 – Database Release 12.2.0.1. 200714 ==> 12.2.0.1
Patch 31113348 – Database Patch Set Update 12.1.0.2.200714 ==> 12.1.0.2

Patch 31103343 – Database Patch Set Update 11.2.0.4.200714 ==> 11.2.0.4


The next four dates for Critical Patch Updates are:


  • October 20, 2020
  • January 19, 2021
  • April 20, 2021
  • July 20, 2021

Prerequisites

1. Go to Patch location and make sure download / copy correct patch and unzip it which depends on OS platform type & DB version

mkdir -p /home/oracle/12.2.0.1_patch_jul2020
cd /home/oracle/12.2.0.1_patch_jul2020/
ls -lrt


2. Download patch as require and make sure you have downloaded correct patch version for specific OS type & DB version. Here I am showing for Linux 64 Bit and database version is 12.2.0.1


unzip p31312468_122010_Linux-x86-64.zip
ls -lrt
cd 31312468


3. Capture information of running instances, listener, patch inventory, oratab & backup of associated ORACLE_HOME (In RAC DBs, execute on all available nodes)

. oraenv or use custom script / command to set / export environment,
export PATH=$ORACLE_HOME/OPatch:$PATH
ps -ef |grep pmon > /home/oracle/12.2.0.1_patch_jul2020/current_instance.txt
ps -ef |grep tns > /home/oracle/12.2.0.1_patch_jul2020/current_tns.txt
cat /etc/oratab > /home/oracle/12.2.0.1_patch_jul2020/current_oratab.txt ==> OS specific
$ORACLE_HOME/OPatch/opatch lsinventory > /home/oracle/12.2.0.1_patch_jul2020/before_current_lsinventory.txt
tar -cvf oracle_home_20Jul2020.tar $ORACLE_HOME
opatch version


Output of opatch version should minimum OPatch utility version 12.2.0.1.21, refer read me of patch ID document and according that it’s require to upgrade if it doesn’t meet to minimum require version.


4. Determine whether any currently installed interim patches conflict with the patch being installed.


cd /home/oracle/12.2.0.1_patch_jul2020/31312468/
. oraenv or use custom script / command to set / export environment
export PATH=$ORACLE_HOME/OPatch:$PATH
opatch prereq CheckConflictAgainstOHWithDetail -ph ./


Make sure no patch conflict output in prerequisite, in case any conflict act according that.


Installation


To install the patch, follow these steps:

1. Set environment

. oraenv or use custom script / command to set / export environment
export PATH=$ORACLE_HOME/OPatch:$PATH


2. Ensure that you shut down all the services running from the Oracle home where you are performing patch activity. Shutdown DB and Listener running associated from same ORACLE HOME where we are applying patch

For HAS & RAC Instances:

srvctl status database -d dbsguru12c
srvctl stop database -d dbsguru12c
srvctl stop listener -listener


In RAC environment if you don’t have down time then perform instance wise i.e stop services on one node at a time (Rolling fashion)

For Standalone DB:

sqlplus / as sysdba
shutdown immediate
lsnrctl stop


3. Ensure no services / processes are running from target ORACLE HOME

ps -eaf | grep pmon
ps -eaf | grep tns
ps -eaf | grep exp
ps -eaf | grep rman


4. Set your current directory to location where the patch is located and then run the opatch utility by entering the following commands:

cd /home/oracle/12.2.0.1_patch_jul2020/31312468/
$ opatch apply


Note: When using opatch you will be asked the following questions for each patch, reply as follows:

Email address/User Name:  

Leave Blank

Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:
Y
Is the local system ready for patching? [y|n]
y

NOTE: In RAC DB / Instance, it will prompt for next available node to patch after completion on executed node and if you want to instance wise use option –local

opatch lsinventory > /home/oracle/12.2.0.1_patch_jul2020/after_current_lsinventory.txt


Post patch installation


1. Start the services from the Oracle home.

sqlplus /nolog
conn / as sysdba
startup
alter pluggable database all open; ==> optional if Multitenant (CDB/PDB) used
quit


cd $ORACLE_HOME/OPatch
./datapatch -verbose


2. Validate patch applied in database.

sqlplus / as sysdba
SET LINESIZE 400
COLUMN action_time FORMAT A20
COLUMN action FORMAT A10
COLUMN status FORMAT A10
COLUMN description FORMAT A40
COLUMN version FORMAT A10
COLUMN bundle_series FORMAT A10


SELECT TO_CHAR(action_time, ‘DD-MON-YYYY HH24:MI:SS’) AS action_time,
action,status,description, version,patch_id,bundle_series
FROM sys.dba_registry_sqlpatch ORDER by action_time;


Click here for various options to validate applied patches in ORACLE HOME & DATABASE.


shutdown


4. Startup database


For HAS / RAC DB / Instance startup:

srvctl start database -d dbsguru12c
srvctl status database -d dbsguru12c


For Standalone DB startup:

sqlplus / as sysdba
startup
ps -eaf | grep pmon
ps -eaf | grep tns


NOTE: Follow post-installation steps# 1 to 4 for all databases running from the same ORACLE_HOME where we applied patch and in RAC environment only execute on one instance.

Make sure all services are up & running from patched ORACLE HOME

Thank you!!

This document is only for learning purpose and always validate in the LAB environment first before applying in the LIVE environment.


Hope so you like this article
!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the latest update. Click here to know more about our pursuit.


Related Articles

Loading

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

DBsGuru

Hello and welcome to DBsGuru,DBsGuru is a group of experienced DBA professionals and serves databases and their related community by providing technical blogs, projects, training. Technical blogs are the source of vast information not about databases but its related product like middleware, PL/SQL, replication methodology, and so on.Thanks for the visits!Share Learn Grow!

8 thoughts on “Step by Step Apply Patch on Oracle Database Home (July 2020)

    1. Thanks Krishna.
      Request to keep visiting us for new articles and provide your valuable feedback to motivate us & keep improving.

    1. Thanks Praween.
      Request to keep visiting us for new articles and provide your valuable feedback to motivate us & keep improving.

  1. Thanks, Ammrita!
    Request to keep visiting us for new articles and provide your valuable feedback to motivate us & keep improving.

Comments are closed.