Thursday 25 April 2019

All about Opatch

All about Opatch
+++++++++++++++
Opatch utility is used to apply database patches.
Opatch utility does not make changes to the database files (*.dbf) but make changes the binaries and libraries of $ORACLE_HOME.


Difference between opatch /adpatch
+++++++++++++++++++++++++++++++++

1)Opatch utility is used to apply database patches.
adpatch utility is used to apply application patches.

2)Pre reqsuites to apply application patches is database and database listener should be up and running.
When applying database patches database and database listener should be down.

3)Database patches can be rollback but we can't rollback application patches.

How to check opatch version
+++++++++++++++++++++++++++++
opatch version


Where OPatch is located
++++++++++++++++++++++++
$ORACLE_HOME/OPatch


EXPORT OPTACH UTILITY
+++++++++++++++++++++
export PATH=$PATH:$ORACLE_HOME/Opatch


How to go for help on opatch
++++++++++++++++++++++++++++
opatch -help


How to apply single database patch
++++++++++++++++++++++++++++++
opatch apply


How to apply multiple database patches
++++++++++++++++++++++++++++++++++++++
opatch napply


How to check a patch is applied to database
++++++++++++++++++++++++++++++++++++++++++
OPatch lsinventory |grep -i patch


How to check multiple patches applied to database in one command
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
opatch lsinventory|egrep -i 'patchno1|patchno2'

To check either patch can be apply online or not
--------------------------------------------
opatch query -is_online_patch 17230530


Check if the patch having any conflicts
================================
/d01/erpapp/patches/CPU_PATCHES/16902043
$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./



How to rollback a patch
+++++++++++++++++++++++++++++++++
$ opatch rollback -id 14153246

opatch rollback -id 17230530 -no_sysmod

Check whether the patch has been rolled back
++++++++++++++++++++++++++++++++++++++++++++
$ opatch lsinventory |grep 14153246


D. Cleanup Patch Storage to Reclaim Space
+++++++++++++++++++++++++++++++++++++++++++++++
OPatch can now determine and cleanup files in the patch storage that are no longer required. To do so run the following:
SYNTAX / EXAMPLE:

[oracle@lnx01] $ORACLE_HOME/OPatch/opatch util cleanup


B. List Detailed Information About a Patch Before Applying It
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The OPatch utility can be used to verify details of a patch before proceeding to apply to the Oracle Home directory.
Such information that can verified but not limited to are:
• Check if patch is a Rolling Patch
• Check if patch is a Patchset Update (PSU)
• Check if patch can be run with “opatch auto” option
• Check OS platform the patch can be applied on
• Actual actions and/or steps that patch contains without applying the patch. This include detailed information of files it touches, copies and relinks.


SYNTAX:

$ORACLE_HOME/OPatch/opatch query -all |more

[oracle@lnx01] cd /home/oracle/download/patches/12311357
[oracle@lnx01] $ORACLE_HOME/OPatch/opatch query -all |more


How to determine if a patch is a "rolling patch" or not?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Based on the oracle database version we can determine whether a patch is a rolling patch or not.

- For oracle version 9i or 10gR1 issue,
$ opatch query -is_rolling


what is the pre requisite to apply database patches?
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Database and database listener must be down.


No comments:

Post a Comment