已索引

在线打补丁还是离线打补丁

Note:

  • Online patches are recommended when a downtime cannot be scheduled and the patch needs to be applied urgently.
  • Online patches consume additional memory and if kept permanently the memory consumption increases as the number of processes in the system increases.
  • It is strongly recommended to rollback all Online patches and replace them with regular (offline) patches on next instance shutdown or the earliest maintenance window.

安装前准备

确保如下操作系统命令在 $PATH 变量路径里:
(oracle)Ensure that the $PATH definition has the following executables: make, ar, ld and nm.

创建一个目录(<PATCH_TOP_DIR>,absolute path),将压缩包解压到该目录
(oracle)$ unzip -d <PATCH_TOP_DIR> p22036236_112040_Linux-x86-64.zip

更新Opatch(建议)
将 opatch 压缩包下载到一个临时目录,以被更新目录属主身份执行如下命令更新:
$ unzip <OPATCH-ZIP> -d $ORACLE_HOME
$ $ORACLE_HOME/OPatch/opatch version

冲突检查(必做!!!)
(oracle)$ cd <PATCH_TOP_DIR>/22036236
(oracle)$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./

离线打补丁

关闭所有数据库相关进程再打补丁,包括集群进程(crsctl stop crs)。
RAC 一般都可以轮流打,即关闭一个节点,打补丁,完成后起节点。再以同样的方式操作其它节点。
(oracle)$ cd <PATCH_TOP_DIR>/22036236
(oracle)$ opatch apply
(oracle)$ opatch lsinventory | grep 22036236

在线打补丁

Ensure that all the services in the Oracle home are up and running.
Ensure that you maintain adequate memory on your system to apply this online patch. To calculate the amount of memory required for this online patch, use the following formula:

Memory Consumed = (Number of Oracle Processes + 1) X (Size of Patched .pch File) 

Note:
-    For UNIX, the number of Oracle processes is determined by checking the parameter "processes" in the database by querying v$parameter. For Microsoft Windows, the number of Oracle processes is always zero (0).
-    The .pch file is available under <bug_number>/online/files/hpatch/ directory.

$ cd <PATCH_TOP_DIR>/22036236

For Non-RAC Environments (Standalone Databases):

$ opatch apply online -connectString <SID>:<USERNAME>:<PASSWORD>: 

For RAC Environments:

$ opatch apply online -connectString <SID_Node1>:<Username_Node1>:<Password_Node1>:<Node1_Name>,<SID_Node2>:<Username_Node2>:<Password_Node2>:<Node2_Name>,<SID_NodeN>:<Username_NodeN>:<Password_NodeN>:<NodeN_Name>

Note:
-    Run the previous command on the first node of the Oracle RAC system, and specify details of each node separated by a comma. In the command, NodeN refers to the different nodes of the Oracle RAC system. Once the patch is applied on the first node, OPatch automatically moves over and patches the next node you have specified in the comamnd.

用户名一般使用 sys。但,我们按照说明文件,在对两节点RAC在线打补丁时,报错如下:

$ $ORACLE_HOME/OPatch/opatch apply online -connectString orcl1:sys:oracle:rac1,orcl2:sys:oracle:rac2
Oracle Interim Patch Installer version 11.2.0.3.47
Copyright (c) 2024, Oracle Corporation.  All rights reserved.

Error: Remote patching is not supported for DB version older than 19

OPatch failed with error code 255
-- By 许望(RHCA、OCM、VCP)
最后修改:2024 年 08 月 08 日 04 : 31 PM
如果觉得我的文章对你有用,请随意赞赏