19c打补丁verify_queryable_inventory returned ORA-20001

2025年4月25日 作者 XiaofeiHuangfu

适用范围

Oracle Database 19.3 +
Linux Enterprise Server 7.9

问题概述

Oracle 19c 在应用19.27补丁37642901时,执行opatch相关命令JAVA环境变量检查失败;verify_queryable_inventory returned ORA-20001。

问题原因

OPatch工具包与操作系统不匹配,p6880880_190000_LINUX.zip补丁包是Linux 32位的。

解决方案

下载与操作系统匹配的p6880880_190000_Linux-x86-64.zip包,备份并替换OPatch工具包,重新进行补丁应用。

分析过程

1、替换OPatch后检查版本
解压p6880880_190000_LINUX.zip,备份OPatch后,进行替换

-bash: ./OPatch: No such file or directory
[oracle@19cdb01 OPatch]# ./opatch version
Error: This Java instance does not support a 64-bit JVM.
Please install the desired version. 
OPatch failed with error code 1

提示JAVA不匹配
使用以下命令指定JAVA_HOME可以正常输出
OPatch version -jre $ORACLE_HOME/jdk
2、应用补丁

[oracle@19cdb01 OPatch]#opatch apply /soft/37642901
日志略

打补丁可以正常进行,未报错。
3、数据库应用补丁

[oracle@19cdb01 ~]$ c-verbose
SQL Patching tool version 19.27.0.0.0 Production on Tue Apr 22 16:45:19 2025
Copyright (c) 2012, 2025, Oracle.  All rights reserved.

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

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

Bootstrapping registry and package to current versions...done
Error: prereq checks failed!
verify_queryable_inventory returned ORA-20001: Latest xml inventory is not loaded into table
Prereq check failed, exiting without installing any patches.

Please refer to MOS Note 1609718.1 and/or the invocation log
/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_27774_2025_04_22_16_45_19/sqlpatch_invocation.log
for information on how to resolve the above errors.
SQL Patching tool complete on Tue Apr 22 16:45:21 2025

datapatch失败,报verify_queryable_inventory returned ORA-20001: Latest xml inventory is not loaded into table
4、检查应用补丁日志

[2025-04-22 16:45:21] verify_queryable_inventory returned ORA-20001: Latest xml inventory is not loaded into table
[2025-04-22 16:45:21] Error: prereq checks failed!
[2025-04-22 16:45:21] verify_queryable_inventory returned ORA-20001: Latest xml inventory is not loaded into table
[2025-04-22 16:45:21] Prereq check failed, exiting without installing any patches.
[2025-04-22 16:45:21] *** START final state end of patching ***

验证检查 invertory的xml失败
5、检查verify_queryable_inventory

SQL> select dbms_sqlpatch.verify_queryable_inventory from dual;

VERIFY_QUERYABLE_INVENTORY
--------------------------------------------------------------------------------
ORA-20001: Latest xml inventory is not loaded into table

dbms_sqlpatch.verify_queryable_inventory与日志报错信息一致。
6、检查补丁

[oracle@19cdb01 ~]$opatch lsinv
Java (1.8) could not be located. OPatch cannot proceed!
OPatch returns with error code = 1

执行opatch相关命令时还是java环境变量问题
7、检查JAVA_HOME

[oracle@19cdb01 ~]$ echo $JAVA_HOME
/u01/app/oracle/product/19c/db_1/OPatch/jdk

JAVA环境变量正常
8、检查OPatch工具包
当前OPatch包是p6880880_190000_LINUX.zip,这是Linux 32位的包与当前操作系统不匹配。
9、更换OPatch工具包
将OPatch包更换为p6880880_190000_Linux-x86-64
10、重新应用补丁
[oracle@19cdb01 db_1]$ datapatch -verbose
SQL Patching tool version 19.27.0.0.0 Production on Tue Apr 22 17:06:35 2025
Copyright © 2012, 2025, Oracle. All rights reserved.

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

Connecting to database…OK
Gathering database info…done

Note: Datapatch will only apply or rollback SQL fixes for PDBs
that are in an open state, no patches will be applied to closed PDBs.
Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
(Doc ID 1585822.1)

Bootstrapping registry and package to current versions…done
Determining current state…done

Current state of interim SQL patches:
No interim patches found

Current state of release update SQL patches:
Binary registry:
19.27.0.0.0 Release_Update 250406131139: Installed
PDB CDBROOT:Applied19.17.0.0.0ReleaseUpdate220924224051successfullyon24−JUL−2101.25.53.443252PMPDBHRPDB:Applied19.17.0.0.0ReleaseUpdate220924224051successfullyon24−JUL−2101.26.03.009956PMPDBPDBROOT:Applied19.17.0.0.0ReleaseU​pdate220924224051successfullyon24−JUL−2101.25.53.443252PMPDBHRPDB:Applied19.17.0.0.0ReleaseU​pdate220924224051successfullyon24−JUL−2101.26.03.009956PMPDBPDBSEED:
Applied 19.17.0.0.0 Release_Update 220924224051 successfully on 24-JUL-21 01.25.58.434166 PM

Adding patches to installation queue and performing prereq checks…done
Installation queue:
For the following PDBs: CDBROOTPDBROOTPDBSEED HRPDB
No interim patches need to be rolled back
Patch 37642901 (Database Release Update : 19.27.0.0.250415 (37642901)):
Apply from 19.17.0.0.0 Release_Update 220924224051 to 19.27.0.0.0 Release_Update 250406131139
No interim patches need to be applied

Installing patches…
Patch installation complete. Total patches installed: 3

Validating logfiles…done
Patch 37642901 apply (pdb CDBROOT):SUCCESSlogfile:/u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901applyCDB19CCDBROOT2025Apr22170656.log(noerrors)Patch37642901apply(pdbPDBROOT):SUCCESSlogfile:/u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901a​pplyC​DB19CC​DBROOT2​025Apr221​70​65​6.log(noerrors)Patch37642901apply(pdbPDBSEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_CDB19C_PDBSEED_2025Apr22_17_08_49.log (no errors)
Patch 37642901 apply (pdb HRPDB): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_CDB19C_HRPDB_2025Apr22_17_08_49.log (no errors)
SQL Patching tool complete on Tue Apr 22 17:13:50 2025

[oracle@19cdb01 db_1]$ datapatch -verbose -apply 37642901 -force -pdbs hrpdb
SQL Patching tool version 19.27.0.0.0 Production on Tue Apr 22 17:18:36 2025
Copyright © 2012, 2025, Oracle. All rights reserved.

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

Connecting to database…OK
Gathering database info…done

Note: Datapatch will only apply or rollback SQL fixes for PDBs
that are in an open state, no patches will be applied to closed PDBs.
Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
(Doc ID 1585822.1)

Bootstrapping registry and package to current versions…done
Determining current state…done

Current state of interim SQL patches:
No interim patches found

Current state of release update SQL patches:
Binary registry:
Unknown as -force or -noqi specified
PDB HRPDB:
Applied 19.27.0.0.0 Release_Update 250406131139 successfully on 22-APR-25 05.12.57.800042 PM

Adding patches to installation queue and performing prereq checks…done
Installation queue:
For the following PDBs: HRPDB
No interim patches need to be rolled back
Patch 37642901 (Database Release Update : 19.27.0.0.250415 (37642901)):
Apply from 19.1.0.0.0 Feature Release to 19.27.0.0.0 Release_Update 250406131139
No interim patches need to be applied

Installing patches…
Patch installation complete. Total patches installed: 1

Validating logfiles…done
Patch 37642901 apply (pdb HRPDB): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_CDB19C_HRPDB_2025Apr22_17_18_38.log (no errors)
SQL Patching tool complete on Tue Apr 22 17:22:35 2025
11、检查补丁应用情况

[oracle@19cdb01 ~]$ opatch lsinv|grep desc
ARU platform description:: Linux x86-64
Patch description:  "Database Release Update : 19.27.0.0.250415 (37642901)"
Patch description:  "OCW RELEASE UPDATE 19.3.0.0.0 (29585399)"
[oracle@19cdb01 ~]$

SQL>select con_id,PATCH_ID,PATCH_TYPE,ACTION,STATUS,TARGET_VERSION from  cdb_registry_sqlpatch;

  CON_ID   PATCH_ID PATCH_TYPE ACTION          STATUS                    TARGET_VERSION
---------- ---------- ---------- --------------- ------------------------- --------------
         1   29517242 RU         APPLY           SUCCESS                   19.3.0.0.0
         1   34419443 RU         APPLY           SUCCESS                   19.17.0.0.0
         1   37642901 RU         APPLY           SUCCESS                   19.27.0.0.0
         3   29517242 RU         APPLY           SUCCESS                   19.3.0.0.0
         3   34419443 RU         APPLY           SUCCESS                   19.17.0.0.0
         3   37642901 RU         APPLY           SUCCESS                   19.27.0.0.0
         3   37642901 RU         APPLY           SUCCESS                   19.27.0.0.0

7 rows selected.

更换OPatch后补丁可以正常应用。
【小结】安装基础软件和补丁包,需要提前检查操作系统和补丁,确认兼容性。
-the end-