Quick one liner to get a full OPatch inventory of your Oracle Middleware Server

After trying to use OEM to grab all the patches from every installed Oracle product, I gave up and decided to write my own one liner. Customize to match your weblogic install directory.

This script will first find all Middleware Homes specifically using Weblogic, then run the lsinventory or lspatches to display a full listing.

  • First, sign in as the “oracle” user
  • Second, run the following command on your linux system

ora-plane

 

for line in `locate oraInst.loc|grep weblogic |sed 's/.\{12\}$//'`;do /u01/app/oracle/weblogic1036R2/oracle_common/OPatch/opatch lsinv -detail -oh $line;done