Wednesday, April 5, 2017

Obtaining Database PSU history from SQL

Check for ORACLE Patches applied



It is possible to determine all Patch Set Updates that has been applied to a database using a simple SQL statement - but note that this will only retrieve the details of patchsets that contained a database element (i.e. you had to run a SQL script in as part of the patch).
Note: It is better to use the opatch utility to retrieve the details of all patches and patchsets applied to an environment. However, this query may still prove useful.

AS GRID and 11g:

$ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed  | grep -i 'PSU'

FOR DATABASE

$ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed | egrep 'PSU|PATCH SET UPDATE'
$ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed | grep -i 'DATABASE PSU'

 CRS

$ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed | grep -i 'TRACKING BUG' | grep -i 'PSU'

GI:

$ORACLE_HOME/OPatch/opatch lsinventory -bugs_fixed | grep -i 'GI PSU'

QUERY the registry$history database object

select substr(action_time,1,30) action_time,
substr(id,1,10) id,
substr(action,1,10) action,
substr(version,1,8) version,
substr(BUNDLE_SERIES,1,6) bundle,
substr(comments,1,20) comments
from registry$history;



col Time for a18
col target for a30
col action for a30

select to_char(action_time,'DD-MON-YYYY HH24:MI:SS') time
     , namespace||' '||version target
     , action||' '||comments action
  from dba_registry_history;

1 comment:

Avishek Priyadarshi said...

I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in ORACLE SOLARIS, kindly Contact MaxMunus
MaxMunus Offer World Class Virtual Instructor led training on ORACLE SOLARIS. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 1,00,000 + trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Demo Contact us.
Avishek Priyadarshi
MaxMunus
E-mail: avishek@maxmunus.com
Skype id: avishek_2 .
Ph:(0) 8553177744 / 080 - 41103383
www.MaxMunus.com