1.查看当前DB环境
[oracle@db01 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
[oracle@db01 ~]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 13-SEP-2021 21:33:46
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db01)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 13-SEP-2021 21:33:43
Uptime 0 days 0 hr. 0 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/db01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db01)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@db01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Sep 13 21:31:54 2021
Version 19.11.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Connected to an idle instance.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 HBHE READ WRITE NO
2 从MOS下载19.12 的RU 补丁
19.12 DB的RU 编号是:32904851,GI的RU编号是: 32895426。
p32904851_190000_Linux-x86-64.zip
p32895426_190000_Linux-x86-64.zip
3 开始安装RU补丁
3.1 查看OPatch版本
[oracle@db01 OPatch]$ cd $ORACLE_HOME/OPatch
[oracle@db01 OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.27
OPatch succeeded.
3.2 检查Patch是否冲突
[oracle@db01 tmp]$ cd /tmp/32904851/
[oracle@db01 32904851]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.27
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2021-09-13_21-49-13PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
3.3 应用patch
如果是物理DG,那么主备库都需要安装Patch,可以先在备库安装,再安装主库,操作步骤可以参考:Document 278641.1。
对于RAC 环境,可以使用OPatch rolling 方式来安装,这样没有停机时间,具体操作可以参考:Document 244241.1。
对于单实例,必须关闭待升级ORACLE HOME关联的所有实例和监听,并且包括退出所有的sqlplus窗口。
关闭实例和监听,并退出sqlplus。
[oracle@db01 OPatch]$ lsnrctl stop
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 13-SEP-2021 21:52:15
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db01)(PORT=1521)))
The command completed successfully
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACL