ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

清風艾艾 發表於 2021-10-26
Linux Oracle

    一同事,在對ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110時,遇到了各種巨坑。

    首先,在Patch  31550110 apply的過程中,沒有任何異常,按照PSU 31550110的readme,在apply執行完成後,

無論單純的單例項還是CDB容器庫都需要執行./datapatch -verbose。

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

     但是,在執行 ./datapatch -verbose時,操作日誌提示報錯資訊如下:

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

    按照 datapatch -verbose日誌提示,分別在CDB和PDB資料庫執行select dbms_sqlpatch.verify_queryable_inventory

 from dual;均提示錯誤資訊:

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

    其次,依經驗需要排除PSU31550110的影響,處理方法是回退PSU31550110再執行select

 dbms_sqlpatch.verify_queryable_inventory  from dual;是否有同樣的錯誤資訊提示。回退 PSU31550110後再執行查詢

dbms_sqlpatch.verify_queryable_inventory  from dual;,無論是CDB還是PDB依然是 KUP-00554 KUP-01005 KUP-01008 KUP-01007的報錯資訊提示。所以,可以確定 KUP-00554 KUP-01005 KUP-01008 KUP-01007問題在 PSU31550110應用之前就存在。 PSU31550110應用之前,需要先處理 KUP-00554 KUP-01005 KUP-01008 KUP-01007

報錯問題。

    按照KUP-00554 KUP-01005 KUP-01008 KUP-01007在oracle mos查詢到文件Doc ID 2302799.1。

Doc ID 2302799.1提示的對應資料庫版本與本次操作的資料庫版本一致:

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

Doc ID 2302799.1提示的現象與本次操作的報錯資訊一致:

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

Doc ID 2302799.1提示的問題處理方法是重建OPATCH_XML_INV表,重建過程如下:

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

需要注意的是: OPATCH_XML_INV表重建需要在CDB層次 2302799.1沒有特別說明 操作。

    再次,重建 OPATCH_XML_INV後,重新應用補丁集31550110也是成功的, datapatch -verbose不再有異常提示資訊:

oracle$[/app/oracle/product/12.1.0/dbhome_1/OPatch]./datapatch -verbose

SQL Patching tool version 12.1.0.2.0 Production on Mon Oct 25 18:04:27 2021

Copyright (c) 2012, 2016, Oracle.  All rights reserved.


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


Connecting to database...OK

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 SQL patches:

Bundle series PSU:

  ID 201020 in the binary registry and ID 201020 in PDB CDB$ROOT, ID 201020 in PDB PDB$SEED, ID 201020 in PDB PDBORCL


Adding patches to installation queue and performing prereq checks...

Installation queue:

  For the following PDBs: CDB$ROOT

    Nothing to roll back

    Nothing to apply

  For the following PDBs: PDB$SEED PDBORCL

    Nothing to roll back

    The following patches will be applied:

      31550110 (DATABASE PATCH SET UPDATE 12.1.0.2.201020)


Installing patches...

Patch installation complete.  Total patches installed: 2


Validating logfiles...

Patch 31550110 apply (pdb PDB$SEED): SUCCESS

  logfile: /app/oracle/cfgtoollogs/sqlpatch/31550110/23839756/31550110_apply_ORCL_PDBSEED_2021Oct25_18_04_50.log (no errors)

Patch 31550110 apply (pdb PDBORCL): SUCCESS

  logfile: /app/oracle/cfgtoollogs/sqlpatch/31550110/23839756/31550110_apply_ORCL_PDBORCL_2021Oct25_18_04_51.log (no errors)

    在CDB層次執行查詢select dbms_sqlpatch.verify_queryable_inventory  from dual;正常返回結果:

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

    但是,在PDB中執行 select dbms_sqlpatch.verify_queryable_inventory  from dual;返回錯誤資訊:

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

關於KUP-00554 KUP-01005 KUP-01008 KUP-01007報錯問題,MOS上有另外一篇文件Doc ID 2293336.1有說明:

ORACLE 12.1.0.2 for linux7.6 應用PSU補丁31550110中的巨坑

按照 Doc ID 2293336.1文件提示, select dbms_sqlpatch.verify_queryable_inventory  from dual;查詢只能在CDB層次

執行,PDB層次不支援。

    總結:

    1. KUP-00554 KUP-01005 KUP-01008 KUP-01007報錯問題,CDB中需要重建表 OPATCH_XML_INV;

    2. PDB中 KUP-00554 KUP-01005 KUP-01008 KUP-01007報錯問題可忽略








來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29357786/viewspace-2839282/,如需轉載,請註明出處,否則將追究法律責任。