查看数据库补丁版本
cd /opt/oracle/product/12.2.0/dbhome_1/OPatch
./opatch lsinventory -detail
解压缩补丁,应用补丁
cd 29757449/
/opt/oracle/product/12.2.0/dbhome_1/OPatch/opatch apply
启动数据库
SQL> startup
执行后续步奏
/opt/oracle/product/12.2.0/dbhome_1/OPatch/datapatch -verbose
如果还安装了OJVM RU或RUR,则在上一步执行datapatch后,您可能会看到无效的对象。在这种情况下,请运行utlrp.sql
以重新验证这些对象
SQL> @utlrp.sql
查看补丁和历史记录
select * from dba_registry_sqlpatch;
select * from dba_registry_history;
常见错误
错误代码73,更新Opatch版本
[oracle@redhat 29757449]$ /opt/oracle/product/12.2.0/dbhome_1/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.6
Copyright (c) 2019, Oracle Corporation. All rights reserved.
Oracle Home : /opt/oracle/product/12.2.0/dbhome_1
Central Inventory : /opt/oraInventory
from : /opt/oracle/product/12.2.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.6
OUI version : 12.2.0.1.4
Log file location : /opt/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2019-10-11_04-30-19AM_1.lo
g
Verifying environment and performing prerequisite checks...
NApply could not load patch from location '/setup/patch/29757449'
UtilSession failed: /setup/patch/29757449/etc/config/actions.xml with Version field of the component "delet
e" in actions file cannot be <null> or empty. Please check patch metadata.
Log file location: /opt/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2019-10-11_04-30-19AM_1.log
OPatch failed with error code 73