How to enable additional logging on OPATCH
Commands:
export OPATCH_DEBUG=true
export JAVA_VM_OPTION="$JAVA_VM_OPTION -Doracle.installer.logLevel=FINEST"
Tips and recommendations on various Oracle products. Solving day to day challenges with easy operational tasks. Providing ideas on scripting, queries and oracle Patching. Find tricks for numerous ORA-error.
export OPATCH_DEBUG=true
export JAVA_VM_OPTION="$JAVA_VM_OPTION -Doracle.installer.logLevel=FINEST"
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.
ORACLE_SID=devORACLE_HOME=/u01/app/oracleORACLE_BASE=/u01/appPATCH_TOP=<Temporary location where the patch is staged>PATH=$ORACLE_HOME/OPatch:$PATCH_TOP:$PATH:.
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_storageCentral Inventory is locked by another OUI instanceNo read permission to Central InventoryThe lock file exists in ORACLE_HOME/.patch_storageThe Oracle Home does not exist in Central InventoryUtilSession failed: OPatch failed to locate Central Inventory.Possible causes are:The Central Inventory is corruptedThe oraInst.loc file specified is not valid.
cat /etc/oraInst.loccat $ORACLE_HOME/oraInst.loc
cp -p $ORACLE_HOME/oraInst.loc $ORACLE_HOME/oraInst.loc.oldModify 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!!
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
--This will remove the inactive patches./opatch util listorderedinactivepatches
./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)
Some Important Oracle database Memory management queries. SGA usage by Oracle Instance: select round(sum(bytes)/1024/1024,2)||' MB'...