Wednesday, March 30, 2016

How to apply one-off patch using Oracle opatch utility

How to apply one-off patch using Oracle opatch utility
How to apply one-off patch using Oracle opatch utility?

No
Description
Screenshot / Command / Others
0
Get the patch # that you want to download.
  • For this document, I am using the following:
    • Patch# is 18440047
    • Patch name is
      • ORA-600[KGLGETSO-NULL-PARENT] WHILE INVALIDATING OBJECT
1
Download Patch from Oracle Support.
https://support.oracle.com/ for the platform your database is hosted on.

In this case, my database is hosted on 64-Bit Linux.
Zip File Name:
p18440047_112040_Linux-x86-64.zip
2.
Extract Patch to get the ReadMe.txt
3
From the ReadMe.txt file, ensure if the patch is:
  • Online Patchable → Ensure that all the services in the Oracle home are up
    (OR)
  • Offline Patchable → Ensure that all the services in the Oracle home are down
4
Create directory where Patch can be staged.
  • Login to Server-223
  • . oraenv → ahmtry7
  • mkdir -p $ORACLE_HOME/Patches_Staging_Area
5.
Declare a variable for the Patch’s staging area and verify the variable is set.
  • export PStagingArea=$ORACLE_HOME/Patches_Staging_Area
6
WinSCP to Server-223:$ORACLE_HOME/Patches_Staging_Area
7
Set ORACLE SID
. oreanv → ahmtry7
8
Export PATH to OPatch location
export PATH=$PATH:$ORACLE_HOME/OPatch
9
From the Read.me file, opatch version should be the latest version. To find the current opatch version, check the Patch 6880880.

(OR)

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=224346.1
opatch version

10
Ensure ORACLE_HOME environment is set
echo $ORACLE_HOME
11
Check the current Patcheset.
opatch lsinventory
12
You may also want to get the current output of opatch lsinventory to a file. You can use this file to compare the list later after applying the patch.
opatch lsinventory > $PStagingArea/isinventory_before.log
13
Change directory to Patch Staging Area
cd $PStagingArea
14
Unzip the patch
unzip $PStagingArea/p18440047_112040_Linux-x86-64.zip
15
Verify the Patch Directory is created. In this case, a directory called 18440047 is created.
ls -ltrh $PStagingArea

16
Determine whether any currently installed interim patches conflict with this patch 18440047
opatch prereq CheckConflictAgainstOHWithDetail -ph ./
17
Database Downtime Begins here

18
Find all listeners running from the ORACLE_HOME you are patching
Ensure that all listeners running from this database home should be down. To find what listeners are associated with this ORACLE_HOME, run the following:

  • ps -ef |grep lsnr |awk  '{print $8 $9}' |grep -v grep
19
Shutdown Listener that is associated with this ORACLE_HOME you are patching.
  • lsnrctl stop lsnr_1577
20
Find all DATABASES running from the ORACLE_HOME you are patching:
  • echo $ORACLE_HOME
  • ls -1 $ORACLE_HOME/dbs/init* $ORACLE_HOME/dbs/spfile*
21
Stop all instances running from the ORACLE_HOME you are patching:
  • . oraenv → ahmtry7
  • sqlplus / as sysdba
  • shutdown immediate;

22
Verify listener and instances associated with ORACLE_HOME you are patching are completely down.
  • ps -ef |grep lsnr |grep lsnr_1577 |grep -v grep
  • ps -ef |grep pmon |grep ahmtry7 |grep -v grep
23
Change directory to Patch’s Staging Directory
  • cd $PStagingArea/18440047
24
At this point, patch can be installed.
  • opatch apply
25
Verify patches are applied
  • opatch lsinventory
26
Once the opatch is completed its patching:
  • startup LISTENER
  • Statup INSTANCE(S).
  • lsnrct start lsnr_1577
  • . oraenv → ahmtry7
  • sqlplus / as sysdba
    • startup
27
Verify listener and instances are started.
  • ps -ef |grep lsnr |grep lsnr_1577 |grep -v grep
  • ps -ef |grep pmon |grep ahmtry7 |grep -v grep


Hope this helps.

Moid Muhammad

No comments:

Post a Comment