Exacheck: The bundle patch version installed does not match the bundle patch version registered in the database

Hi all!
So, running Exacheck on a recently created database, found this error:

 FAIL => The bundle patch version installed does not match the bundle patch version registered in the database: [host]:[sid],...

This means that a boundle patch with sqlpatch was applied to OH and not to this database. Happens because Exacheck try to match the patch info stored in oraInventory with the patch info stored in dba_registry_sqlpatch.

Also note in some situations, running datapatch may require the database to be in upgrade mode and if you are patching Exadata , which is generally a RAC based environment, you need to set the cluster_database=false and at least 1 job_queue_process before starting the database using startup upgrade command. This should be described in readme on related patch.

When checking for this, I found a really interesting validation script here. As per:

opatch_bp=$($ORACLE_HOME/OPatch/opatch lspatches 2>/dev/null|grep -iwv javavm|grep -wi database|head -1|awk -F';' '{print $1}') 
database_bp_status=$(echo -e "set heading off feedback off timing off \n select STATUS from dba_registry_sqlpatch where PATCH_ID = $opatch_bp;"|$ORACLE_HOME/bin/sqlplus -s " / as sysdba" | sed -e '/^ *$/d')
if [ "$database_bp_status" == SUCCESS ]
then
      echo "SUCCESS: Bundle patch installed in the database matches the software home and is installed successfully."
else
      echo "FAILURE: Bundle patch installed in the database does not match the software home, or is installed with errors." 
 fi

To fix, just set environment variables to correct database, go to $ORACLE_HOME/OPatch and run:

./datapatch -verbose

Expected Output:

[oracle@grepora-srv greporadb]$ sh fix_boundle_patch.sh 
FAILURE: Bundle patch installed in the database does not match the software home, or is installed with errors.
[oracle@grepora-srv greporadb]$ cd $ORACLE_HOME/OPatch
[oracle@grepora-srv greporadb]$ ./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Tue Sep  5 11:58:02 2017
Copyright (c) 2012, 2017, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_235324_2017_09_05_11_58_02/sqlpatch_invocation.log

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Patch 25437695 (Database PSU 12.1.0.2.170418, Oracle JavaVM Component (APR2017)):
  Installed in the binary registry only
Bundle series DBBP:
  ID 170418 in the binary registry and not installed in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  The following patches will be applied:
    25437695 (Database PSU 12.1.0.2.170418, Oracle JavaVM Component (APR2017))
    25397136 (DATABASE BUNDLE PATCH 12.1.0.2.170418)

Installing patches...
Patch installation complete.  Total patches installed: 2

Validating logfiles...
Patch 25437695 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/25437695/21057393/25437695_apply_AWRW_2017Sep05_11_58_31.log (no errors)
Patch 25397136 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/25397136/21145057/25397136_apply_AWRW_2017Sep05_11_58_34.log (no errors)
SQL Patching tool complete on Tue Sep  5 11:59:29 2017
[oracle@grepora-srv greporadb]$ cd -
/home/oracle
[oracle@grepora-srv greporadb]$ sh fix_boundle_patch.sh 
SUCCESS: Bundle patch installed in the database matches the software home and is installed successfully.
[oracle@grepora-srv greporadb]$

Hope this helps!
Cheers!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.