Pages

Thursday, January 24, 2019

Oracle opatch

=======================
URLs

=======================
Search
Search by Patch

Download
Download a Patch


Upgrade Opatch Utility
Download a Patch

How to search:
In Oracle Support:
Patches & Updates Tab ->
Patch Search ->
Product or Family (Advanced) ->
Select Product -> Oracle Global Lifecycle Management OPatch
Select Release ->
Select Platform -> Linux x86-64

After unzip of the OPatch zip, backup $ORACLE_HOME/OPatch/ folder. And extract from the OPatch zip into $ORACLE_HOME/OPatch/


=======================
Steps to apply Oracle patch
=======================

Per Oracle documentation

1. For non-recommended patches, you must have the exact symptoms
   described in the service request (SR).

2. Confirm the version of Perl installed and configured for the ORACLE_HOME.
  - source the ORACLE_HOME environment
  - execute "perl -v"
  - verify that the returned version of Perl is 5.00503 or higher

Verify the OUI Inventory.
$ORACLE_HOME/OPatch/opatch lsinventory

3. Create a location for storing the unzipped patch. 
This location will be referred to later in the document as <PATCH_TOP>.

4.  Unzip the patch zip file into the <PATCH_TOP>.

unzip -d <PATCH_TOP> p7626014_111070_Linux-x86-64.zip
unzip -d 33494256 19_12_p33494256_190000_Linux-x86-64.zip
cd 33494256/33494256 

5.  Shut down services running from the ORACLE_HOME.

Before applying this patch, do a clean shut down of all services
running from the ORACLE_HOME.
  Shut down all services that are running from this ORACLE_HOME.
  Confirm the return status from each shutdown command to verify
  the shutdown is successful and there are no errors.

Meaning, shut down Oracle listener and Oracle service.

lsnrctl stop;
shutdown immediate;

Once done, you can apply the patch:
cd to the patch folder, created during unzip step (to the folder containing README.txt)

apply patch by running:
$ORACLE_HOME/OPatch/opatch lsinventory
$ORACLE_HOME/OPatch/opatch apply
$ORACLE_HOME/OPatch/opatch lsinventory

 Start Oracle server and listener.


=================================
Patch Installation Steps by example:
=================================

1. Stop Oracle and Listener
lsnrctl stop
ALTER SYSTEM CHECKPOINT;
SHUTDOWN ABORT;


2. Unzip patch to a directory
<PATCH_TOP>/7626014

3.  Set your current directory to the directory where the patch is located.

  cd <PATCH_TOP>/7626014/
(you should be in same directory with file README.txt)

4.  Apply the patch.

Use the following command to apply the patch to the ORACLE_HOME:

$ORACLE_HOME/OPatch/opatch apply

5. Check patch was applied

$ORACLE_HOME/OPatch/opatch lsinventory


Post Patch Installation Steps:
-------------------------
Startup Oracle and Listener

STARTUP
lsnrctl start

=================================
Patch Rollback Steps by example:
=================================
$ORACLE_HOME/OPatch/opatch lsinventory
$ORACLE_HOME/OPatch/opatch rollback -id 7626014
$ORACLE_HOME/OPatch/opatch lsinventory

Patch 7626014 should not be in the list


=======================
Opatch Utility versions
=======================
Opatch Utility has version as well. 
Opatch Utility version, should be compatible with the applied patch, as newer patched require newer version on Opatch utility.
In case Opatch utility is too old version, following error would come during patch installation:


oracle@my_server:~/OPATCH_p20761024/20761024>% $ORACLE_HOME/OPatch/opatch apply
Invoking OPatch 11.1.0.6.8

Oracle Interim Patch Installer version 11.1.0.6.8
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /software/oracle/111
Central Inventory : /software/oracle/installers/111
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.8
OUI version       : 11.1.0.7.0
OUI location      : /software/oracle/111/oui
Log file location : /software/oracle/111/cfgtoollogs/opatch/opatch2019-04-23_23-20-01PM.log

Patch history file: /software/oracle/111/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '20761024' to OH '/software/oracle/111'
ApplySession failed: ApplySession failed to prepare the system. 

Patch 20761024 requires OPatch version 11.1.0.8.2.
The OPatch version being used (11.1.0.6.8) doesn't meet the minimum version required by the patch(es). Please download latest OPatch from My Oracle Support.

System intact, OPatch will not attempt to restore the system

OPatch failed with error code 73


How to check current Opatch version:
$ORACLE_HOME/OPatch opatch version
How to check current Opatch version:
Inside readme.txt of a patch, refer to Prerequisites section. 
For example:

2 Prerequisites
2.1 OPatch Utility
You must use the OPatch utility version 11.1.0.8.2 or later to apply this patch.
Oracle recommends that you use the latest released OPatch version for 11.1, which is available for download from My Oracle Support patch 6880880 by selecting the 11.1.0.0.0 release.

=================================
Upgrade Opatch Utility
=================================
Upgrade Opatch Utility is done via implementing patch Patch 6880880
Patch 6880880 is a general Patch for the OPatch utility
How to apply:

From readme.txt inside Patch 6880880

How to install the utility:
---------------------------

To install this patch, Please extract the file "zipped file" using unzip or winzip,
depending upon the platform.
You should extract the zip file directly under the

ORACLE_HOME.
Please follow the following steps for extracting the zip file of OPatch.


(1)  Please take a backup of ORACLE_HOME/OPatch into a dedicated backup
location.
(2) Please make sure no directory ORACLE_HOME/OPatch exist.
(3) Please unzip the OPatch downloaded zip into ORACLE_HOME directory.

To check the version of the opatch utility installed in the above step,

go to the OPatch directory and run "opatch version".

For example:
cd %ORACLE_HOME
rm -rf  OPatch
unzip 12_2_1_30_p6880880_190000_Linux-x86-64.zip

check:
$ORACLE_HOME/OPatch/opatch version

No comments:

Post a Comment