(new Update see below)
Patching is a task which is really often done and if you sit in front of a Oracle System which
you know while doing regularly maintenance the Patch status is more or less known to you
But what if your college ask:
„Please check an Oracle System from a new customer and let me know if they had patched
the System in the last six month.“
Now most of us do a Login set the environment for example Oracle_Home or Grid_Home
and start an „opatch“ or checked via the database and registry.
To get a complete overview what happen on the System is more easy from my point of view
while taking a look in the opatch_history.txt file.
This textfile exist for every Oracle Home on the server and shows the complete history
su - oracle
You saw exactly at which time which command was entered against the Oracle Home.
So you can very easy check when and which Patches where applied in the last time.
Date & Time : Mon Aug 03 02:05:45 CEST 2020
Oracle Home : /u01/app/oracle/product/188.8.131.52/dbhome_1
OPatch Ver. : 184.108.40.206.19
Current Dir : /u01/app/oracle/product/220.127.116.11/dbhome_1
Command : lsinventory -oh /u01/app/oracle/product/18.104.22.168/dbhome_1 -local -invPtrLoc /u01/app/oracle/product/22.214.171.124/dbhome_1/oraInst.loc
Log File : /u01/app/oracle/product/126.96.36.199/dbhome_1/cfgtoollogs/opatch/opatch2020-08-03_02-05-45AM_1.log
Another example for an Oracle Grid Home here Release 19c.
Grid Home is „/u01/app/19.0.0/grid“
Date & Time : Mon Aug 03 02:26:04 CEST 2020
Oracle Home : /u01/app/19.0.0/grid
OPatch Ver. : 188.8.131.52.17
Current Dir : /u01/app/19.0.0/grid
Command : lsinventory -oh /u01/app/19.0.0/grid -local -invPtrLoc /u01/app/19.0.0/grid/oraInst.loc
Log File : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2020-08-03_02-26-04AM_1.log
Try it and check your opatch_history.txt file. It is really helpful.
Update on this Post after Roy (Swonger) VP from Oracle ask me if I can add an additional information I do of course.
„One of the most common issues I see is when customers run OPatch but forget to run Datapatch to apply the SQL changes to the database. Mike had a good blog post about the dba_registry_history and dba_registry_sqlpatch views that explains which to use depending on the version you are running: https://mikedietrichde.com/2016/11/30/dba_registry_history-vs-dba_registry_sqlpatch/ “
Yes, please take a look to Mike’s Blog which is very helpful (as all his posts 👍)
In my special case the main topic of my college was the question „Can you check if the customer has tried to install Patches in the Grid Home during the last month?“. This question could be easy answered via the opatch_history.txt file.
So have fun during the next patching action and not forget the datapatch