Showing posts with label OPatch. Show all posts
Showing posts with label OPatch. Show all posts

April 02, 2025

OPatch Debug log

How to enable additional logging on OPATCH 

Sometime while patching we need to look at some of the additional details which is not on the opatch logs. Specially if any patch is failing/ any patch is stuck for very long period of time. In such scenarios, enabling a few additional logging would be a great help to troubleshoot the issue. 

Commands:

Before starting the session, export this two variable on the unix session and then check the opatch logs.
If you are running ASM and you can check some additional debugging on the crs logs as well. 

export OPATCH_DEBUG=true

export JAVA_VM_OPTION="$JAVA_VM_OPTION -Doracle.installer.logLevel=FINEST"


After setting this variables, now run the patching session and it will keep putting more steps on the log file. 

Happy patching!!

February 04, 2025

Patching: Apply Oracle Database Patch on Linux/Unix host

 How to apply Oracle Database Patches in Linux?

This guide explains how to apply database patches into oracle database and oracle home running on Unix/Linux/ Aix etc.
First, we need to download the required patch from oracle support or metalink. 
Then ftp/scp the patch in a shared path on the server. 

Login to the server:

Setup environment variables.


ORACLE_SID=dev
ORACLE_HOME=/u01/app/oracle
ORACLE_BASE=/u01/app
PATCH_TOP=<Temporary location where the patch is staged>
PATH=$ORACLE_HOME/OPatch:$PATCH_TOP:$PATH:.

Note: Setup the PATH Variable to point to OPatch directory and the Patch directory where the patch is staged.

December 06, 2024

OPatch Failed with error code 73

Oracle OPatch  Error


Error:

Oracle Home       : <ORACLE_HOME> Path 

Central Inventory : The inventory that is being used by this opatch session

   from           : The inventory that is stored in the Oracle Home

OPatch version    : 12.2.0.1.44

OUI version       : 12.2.0.7.0

Log file location : /u01/oracle/product/19.3.0/cfgtoollogs/opatch/opatch<date>.log


OPatchSession cannot load inventory for the given Oracle Home <oracle_home>. Possible causes are:
   No read or write permission to ORACLE_HOME/.patch_storage
   Central Inventory is locked by another OUI instance
   No read permission to Central Inventory
   The lock file exists in ORACLE_HOME/.patch_storage
   The Oracle Home does not exist in Central Inventory
UtilSession failed: OPatch failed to locate Central Inventory.
Possible causes are:
    The Central Inventory is corrupted
    The oraInst.loc file specified is not valid.


This is because, sometime the /etc/oraInst.loc is pointing to the ora inventory in a temp location which the $ORACLE_HOME/oraInst.loc is not aware.

cat /etc/oraInst.loc
cat $ORACLE_HOME/oraInst.loc

check if both the files are pointing to the same location. if not, take a backup of the file and update the central inventory in $ORACLE_HOME/oraInst.loc.

cp -p $ORACLE_HOME/oraInst.loc $ORACLE_HOME/oraInst.loc.old
Modify the file accordingly for parameter inventory_loc=<Full PATH of the inventory, which can be copied from /etc/oraInst.loc>


Note: One more observation on the file permission, if you are running the grid with different usernames, the same group and sharing the same inventory, make sure, the files under /u01/oraInventory/ContentsXML have 644 permissions. So that while doing patching with Oracle users, it can modify those XML files.

Hope this helps resolve the error, happy patching!!


Best Wishes!!


December 05, 2024

OPatch Session Hung Forever | CUP_LOG: Found poh CUP XXXXXX is a subset of other poh CUP: XXXXX

Performance Issue with OPatch


Opatch Hung forever

CUP_LOG: Found poh CUP XXXXXX is a subset of other poh CUP: XXXXX


If you ever face issues with opatch utility is taking long time to run the prerequisite check and in the log you see the below line.


CUP_LOG: Found poh CUP XXXXXX is a subset of other poh CUP: XXXXX
CUP_LOG: Found poh CUP XXXXXX is a subset of other poh CUP: XXXXX
CUP_LOG: Found poh CUP XXXXXX is a subset of other poh CUP: XXXXX
CUP_LOG: Found poh CUP XXXXXX is a subset of other poh CUP: XXXXX
CUP_LOG: Found poh CUP XXXXXX is a subset of other poh CUP: XXXXX


It is time to cleanup some inactive patches from opatch inventory, to do that please follow the below instructions.


cd $ORACLE_HOME/OPatch

--This will list the inactive patches

./opatch util listorderedinactivepatches

--This will remove the inactive patches

./opatch util deleteinactivepatches


This will take some time depending on how many old inactive patches is present in the inventory.


Reference:

OPatch 12.2.0.1.37+ Introduces a New Feature to Delete Inactive Patches in the ORACLE_HOME/.patch_storage Directory (Doc ID 2942102.1)


Recent Post

Oracle Memory usage Queries

Some Important Oracle database Memory management queries. SGA usage by Oracle Instance: select  round(sum(bytes)/1024/1024,2)||' MB'...