近期,一个项目在数据库从12.1升级19.3时,DBUA运行时遇到报错,分析日志为prereq checks failed检查失败,具体为:verify_queryable_inventory returned ORA-20001: Latest xml inventory is not loaded into table。
经过后续的排查及测试验证,推测问题为LINUX环境安装时选择为中文后续设置为英文--LANG变量的设置问题(可能设置为LANG=en_us),后续设置好LANG重新设置后(LANG=en_US.UTF-8),升级也正常完成。
再次强烈建议LINUX环境安装选择英文或通过环境变量LANG=en_US.UTF-8设置好SHELL为英文,再进行数据库的安装、升级等操作,纯英文环境可以减少很多奇怪问题。排查过程参考了MOS文档:Queryable Patch Inventory - Issues/Solutions for ORA-20001: Latest xml inventory is not loaded into table (Doc ID 1602089.1),里面介绍了很多种报错ORA-20001的问题及解决思路,在Symptoms 18中提到UTF8字符问题会导致报错:
The problem is with the 'sed' utility, which interprets its input in the character set defined in the LANG/LC_ALL variable. However, the text that sed processes in qopiprep.bat is always in UTF-8 (content of inventory XML files).Due to some customizations in custmoer environment it wasn't set ,so are the errors from datapatch execution .
相关信息如下:
1.DBUA报错截图
2.DBUA出问题时的日志信息
Start of DataPatch Logs
------------------------------------------------------
stdout from running datapatch to install upgrade SQL patches and PSUs:
SQL Patching tool version 19.3.0.0.0 Production on Sat Dec 4 02:38:15 2021
Copyright (c) 2012, 2019, Oracle. All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_14064_2021_12_04_02_38_15/sqlpatch_invocation.log
Enter password for sys:
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 ==========>>>报错
3.后续的测试验证