查看数据库补丁版本

  1. cd /opt/oracle/product/12.2.0/dbhome_1/OPatch
  2. ./opatch lsinventory -detail

解压缩补丁,应用补丁

  1. cd 29757449/
  2. /opt/oracle/product/12.2.0/dbhome_1/OPatch/opatch apply

启动数据库

  1. SQL> startup

执行后续步奏

  1. /opt/oracle/product/12.2.0/dbhome_1/OPatch/datapatch -verbose

如果还安装了OJVM RU或RUR,则在上一步执行datapatch后,您可能会看到无效的对象。在这种情况下,请运行utlrp.sql 以重新验证这些对象

  1. SQL> @utlrp.sql

查看补丁和历史记录

  1. select * from dba_registry_sqlpatch;
  2. select * from dba_registry_history;

常见错误

错误代码73,更新Opatch版本

  1. [oracle@redhat 29757449]$ /opt/oracle/product/12.2.0/dbhome_1/OPatch/opatch apply
  2. Oracle Interim Patch Installer version 12.2.0.1.6
  3. Copyright (c) 2019, Oracle Corporation. All rights reserved.
  4. Oracle Home : /opt/oracle/product/12.2.0/dbhome_1
  5. Central Inventory : /opt/oraInventory
  6. from : /opt/oracle/product/12.2.0/dbhome_1/oraInst.loc
  7. OPatch version : 12.2.0.1.6
  8. OUI version : 12.2.0.1.4
  9. Log file location : /opt/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2019-10-11_04-30-19AM_1.lo
  10. g
  11. Verifying environment and performing prerequisite checks...
  12. NApply could not load patch from location '/setup/patch/29757449'
  13. UtilSession failed: /setup/patch/29757449/etc/config/actions.xml with Version field of the component "delet
  14. e" in actions file cannot be <null> or empty. Please check patch metadata.
  15. Log file location: /opt/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2019-10-11_04-30-19AM_1.log
  16. OPatch failed with error code 73