Select SQL where not unique

Stefan's blog

(new update see below)

Patching is a task which is really often done and if you sit in front of an 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 of what happen on the system is more easy from my point of view

while taking a look in the opatch_history.txt file.

This text file exist for every Oracle Home on the server and shows the complete history


ssh host1 su - oracle cat / etc / oratab db1: /u01/app/oracle/product/ Y. oraenv cd /u01/app/oracle/product/ vi opatch_history.txt

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/ OPatch Ver. : Current Dir: /u01/app/oracle/product/ Command: lsinventory -oh /u01/app/oracle/product/ -local -invPtrLoc / u01 / app /oracle/product/ Log File: /u01/app/oracle/product/

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. : 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.

Roy says:

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:

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 easily answered via the opatch_history.txt file.

So have fun during the next patching action and don't forget the datapatch





Oracle 12.2, Oracle 19c, Oracle DatabaseOracle Patching