0% found this document useful (0 votes)
110 views7 pages

Patching in Oracle

Uploaded by

Mortal FC
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views7 pages

Patching in Oracle

Uploaded by

Mortal FC
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Patching in Oracle

Step 1:
• Download Patch p34133642_19.16.00_Linux-x86-64
• Make sure the minimum OPATCH version is 12.2.0.1.30

Step 2:
To update the OPATCH version we need to download it first and then replace
it with the existing OPATCH in ORACLE HOME.

Step 3:
After downloading the OPATCH and PATCH copy both files to the Database
server. In my case, I have copied both files to /u02 mount point.

Step 4:

Before updating the OPATCH version, you should check the current version of OPATCH.

$cd $ORACLE_HOME/OPatch
$./opatch version
OPatch Version: 12.2.0.1.17
OPatch succeeded.

Step 5:
In my case the OPATCH version is 12.2.o.1.17 and we need the minimum OPATCH version to be
12.2.0.1.30.
$ cd $ORACLE_HOME/
$mv OPatch OPatch_bkp

Upgrade OPATCH
Upgrade the OPATCH utility, just unzip the newly downloaded opatch utility version in
ORACLE_HOME directly.

$unzip /u02/p6880880_190000_Linux-x86-64 -d $ORACLE_HOME/


Once the above command is completed then check the OPATCH version again.

$ ./opatch version
OPatch Version: 12.2.0.1.35
OPatch succeeded.
This time you can see the OPATCH version successfully updating.
Step 6:

Verify the Database Current


version
Using the below command verify the current version details and some other information related to
the database.
SQL> select BANNER_FULL from v$version;
BANNER_FULL
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

Check dba_registry status


Registry verification is an important part of the patching activity.
SQL>col comp_id for a10
SQL>col version for a11
SQL>col status for a10
SQL>col comp_name for a37
SQL>select comp_id,comp_name,version,status from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
---------- ------------------------------------- ----------- ----------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 VALID
SDO Spatial 19.0.0.0.0 VALID
XOQ Oracle OLAP API 19.0.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 VALID
15 rows selected.

Step 7:

Rollback Plan
Due to any type of error if patching got failed, then you must have a backup plan.
• Take Oracle Home Backup
• Full Database RMAN Backup or Create Guaranteed Restore Point.

Take Oracle Home backup


$cd $ORACLE_HOME
$tar -cvf oracle_home_15jan2023.tar $ORACLE_HOME

Step 8:
Let's start the preparation for applying the patch. Unzip the path in the /u02 directory using the
following commands.

Unzip the Patch


$unzip /u02/p34133642_19.16.00_Linux-x86-64.zip -d /u02

Note:
Yes, check the prerequisites before applying the patch using the following command.

Check prerequisites
$cd /u02/34133642
$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail
-ph ./
Output from the above query, if everything is fine.

Oracle Interim Patch Installer version 12.2.0.1.35


Copyright (c) 2023, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u02/app/oracle/product/19.3.0/db_home
Central Inventory : /u01/app/oraInventory
from : /u02/app/oracle/product/19.3.0/db_home/oraInst.loc
OPatch version : 12.2.0.1.35
OUI version : 12.2.0.7.0
Log file location :
/u02/app/oracle/product/19.3.0/db_home/cfgtoollogs/opatch/opatch2023-
01-12_23-58-36PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.

Step 9:

Stop all Database services

Step 10:
Using the following command applies the patch.

Note:
Make sure 7 GB of disk space is free in your binary location otherwise the patch will be failed.

Execute opatch apply


$cd /u02/34133642
34133642]$ORACLE_HOME/OPatch/opatch apply

Patching component oracle.precomp.common, 19.0.0.0.0...


Patching component oracle.precomp.lang, 19.0.0.0.0...
Patching component oracle.jdk, 1.8.0.201.0...
Patch 34133642 successfully applied.
Sub-set patch [29517242] has become inactive due to the application of a
super-set patch [34133642].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location:
/u02/app/oracle/product/19.3.0/db_home/cfgtoollogs/opatch/opatch2023-
01-13_00-09-07AM_1.log
OPatch succeeded.

Step 11:

Start All database services


Once opatch apply successfully, then start all the database services.

Step 12:

Post PATCH steps


Now it's time to run datapatch -verbose which updates the patch
information at the database binary & dictionary level as well as binary files.

Run datapatch -verbose


34133642]$ cd $ORACLE_HOME/OPatch
OPatch]$ ./datapatch -verbose

Step 13:

Execute utlrp.sql
Once datapatch -verbose is completed then execute the utlrp script to
validate the invalid objects.
SQL> @?/rdbms/admin/utlrp.sql
Step 14:

Verify the PATCH


Check applied patch details using lsinventory command.

OPatch]$ ./opatch lsinventory

Oracle Interim Patch Installer version 12.2.0.1.35


Copyright (c) 2023, Oracle Corporation. All rights reserved.
Oracle Home : /u02/app/oracle/product/19.3.0/db_home
Central Inventory : /u01/app/oraInventory
from : /u02/app/oracle/product/19.3.0/db_home/oraInst.loc
OPatch version : 12.2.0.1.35
OUI version : 12.2.0.7.0
Log file location :
/u02/app/oracle/product/19.3.0/db_home/cfgtoollogs/opatch/opatch2023-
01-13_07-35-21AM_1.log
Lsinventory Output file location :
/u02/app/oracle/product/19.3.0/db_home/cfgtoollogs/opatch/lsinv/lsinven
tory2023-01-13_07-35-21AM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: noida
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 19c 19.0.0.0.0
There are 1 products installed in this Oracle Home.
Interim patches (2) :
Patch 34133642 : applied on Fri Jan 13 00:17:16 IST 2023
Unique Patch ID: 24865470
Patch description: "Database Release Update : 19.16.0.0.220719 (34133642)"
Created on 14 Jul 2022, 16:09:56 hrs UTC
Bugs fixed:
Verify at the Database Level
SQL> select patch_uid,patch_id,SOURCE_VERSION, TARGET_VERSION, action,
status,action_time,description from dba_registry_sqlpatch;

You might also like