ITPub博客

首页 > 数据库 > Oracle > 基于19c RAC的 RU补丁自动升级 标准化文档

基于19c RAC的 RU补丁自动升级 标准化文档

原创 Oracle 作者:sjw1933 时间:2023-03-02 17:22:36 0 删除 编辑

一 RU补丁自动升级

自动RU补丁升级会牵扯到 关库关集群, 无需人为关库关集群,请注意

若建完实例后自动打补丁不需要将SQL文件加载到数据库中

1.1  上传并解压补丁包并赋权

上传

p30899722_190000_Linux-x86-64.zip

p6880880_190000_Linux-x86-64

 

解压,赋权

unzip p30899722_190000_Linux-x86-64.zip

chmod 775 -R 30899722

1.2  确认已经安装的补丁包与此补丁包是否冲突

Grid:

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30869156

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30894985

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30869304

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30898856

Oracle:

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30869156  

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30894985

检测成功

1.3  检查opatch版本

(2个节点的oracle、grid都要更新opatch)(本文补丁打至30899722,opatch版本最低需求为12.2.0.1.19)

opatch version

1.4  更新opatch

1,2 节点分别执行:

oracle:

cd $ORACLE_HOME 

mv OPatch OPatch.bak

unzip  p6880880_190000_Linux-x86-64 -d  $ORACLE_HOME

 

解压grid会碰到$ORACLE_HOME属组问题,用root解压好,更改成grid属组

grid:

cd $ORACLE_HOME 

mv OPatch OPatch.bak

unzip  p6880880_190000_Linux-x86-64 -d  $ORACLE_HOME

 

1.5  查看

opatch lspatches

 

1.6 RU 自动补丁升级

[root@rac1 OPatch]# ./opatchauto apply /oracle/soft/30899722

[root@rac2 OPatch]# ./opatchauto apply /oracle/soft/30899722

 

1.7  查看补丁

1.8  自动补丁错误汇总

节点一成功

节点二失败:

错误一:

Start applying binary patch on home /oracle/grid/crs_1

Failed while applying binary patches on home /oracle/grid/crs_1

Execution of [OPatchAutoBinaryAction] patch action failed, check log for more details. Failures:

Patch Target : rac2->/oracle/grid/crs_1 Type[crs]

Details: [

---------------------------Patching Failed---------------------------------

Command execution failed during patching in home: /oracle/grid/crs_1, host: rac2.

Command failed:  /oracle/grid/crs_1/OPatch/opatchauto  apply /oracle/soft/30899722 -oh /oracle/grid/crs_1 -target_type cluster -binary -invPtrLoc /oracle/grid/crs_1/oraInst.loc -jre /oracle/grid/crs_1/OPatch/jre -persistresult /oracle/grid/crs_1/opatchautocfg/db/sessioninfo/sessionresult_rac2_crs_1.ser -analyzedresult /oracle/grid/crs_1/opatchautocfg/db/sessioninfo/sessionresult_analyze_rac2_crs_1.ser

Command failure output: 

==Following patches FAILED in apply:

Patch: /oracle/soft/30899722/30869156

Log: /oracle/grid/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2020-06-28_01-27-06AM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: ApplySession failed in system modification phase... 'ApplySession::apply failed: java.io.IOException: oracle.sysman.oui.patch.PatchException: java.io.FileNotFoundException: /oracle/oraInventory/ContentsXML/oui-patch.xml (Permission denied)' 

After fixing the cause of failure Run opatchauto resume

OPATCHAUTO-68061: The orchestration engine failed.

OPATCHAUTO-68061: The orchestration engine failed with return code 1

OPATCHAUTO-68061: Check the log for more details.

OPatchAuto failed.

OPatchauto session completed at Sun Jun 28 01:36:27 2020

Time taken to complete the session 31 minutes, 32 seconds

 opatchauto failed with error code 42

 

solution :观察节点1与节点2 /oracle/oraInventory/ContentsXML/oui-patch.xml权限差异,并将节点二修改成与节点一一致。

 

  错误二:resume

[root@rac2 OPatch]# ./opatchauto resume

Start applying binary patch on home /oracle/grid/crs_1

Failed while applying binary patches on home /oracle/grid/crs_1

Execution of [OPatchAutoBinaryAction] patch action failed, check log for more details. Failures:

Patch Target : rac2->/oracle/grid/crs_1 Type[crs]

Details: [

---------------------------Patching Failed---------------------------------

Command execution failed during patching in home: /oracle/grid/crs_1, host: rac2.

Command failed:  /oracle/grid/crs_1/OPatch/opatchauto  apply /oracle/soft/30899722 -oh /oracle/grid/crs_1 -targerid/crs_1/OPatch/jre -persistresult /oracle/grid/crs_1/opatchautocfg/db/sessioninfo/sessionresult_rac2_crs_1.seranalyze_rac2_crs_1.ser

Command failure output: 

==Following patches FAILED in apply:

Patch: /oracle/soft/30899722/30869156

Log: 

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Unable to create patchObject

Possible causes are:

   ORACLE_HOME/inventory/oneoffs/30869156 is corrupted. PatchObject constructor: Input file "/oracle/grid/crs_1//oneoffs/30869156/etc/config/inventory" does not exist. 

After fixing the cause of failure Run opatchauto resume

]

OPATCHAUTO-68061: The orchestration engine failed.

OPATCHAUTO-68061: The orchestration engine failed with return code 1

OPATCHAUTO-68061: Check the log for more details.

OPatchAuto failed.

OPatchauto session completed at Sun Jun 28 10:44:27 2020

Time taken to complete the session 0 minute, 50 seconds

 opatchauto failed with error code 42

  

根据MOS2286025.1 solution:

从节点1拷贝

[grid@rac1 oneoffs]$  scp -r 30869156/  rac2:/oracle/grid/crs_1/inventory/oneoffs/

在节点2再次resume

[grid@rac2 OPatch]$  ./opatchauto resume

OPatchauto session is initiated at Sun Jun 28 11:10:27 2020

Session log file is /oracle/grid/crs_1/cfgtoollogs/opatchauto/opatchauto2020-06-28_11-10-28AM.log

Resuming existing session with id V8YC

OPATCHAUTO-68116: Failed to save patch session.

OPATCHAUTO-68116: Failed to save patch session file /oracle/grid/crs_1/opatchautocfg/db/sessioninfo/V8YC.json

OPATCHAUTO-68116: Check log for more information.

OPatchAuto failed.

OPatchauto session completed at Sun Jun 28 11:10:37 2020

Time taken to complete the session 0 minute, 11 seconds

 opatchauto failed with error code 42

 

再次执行一次错误消失:

[root@rac2 OPatch]#   ./opatchauto resume

OPatchauto session is initiated at Sun Jun 28 17:28:56 2020

Session log file is /oracle/grid/crs_1/cfgtoollogs/opatchauto/opatchauto2020-06-28_05-28-56PM.log

Resuming existing session with id V8YC

Start applying binary patch on home /oracle/grid/crs_1

Binary patch applied successfully on home /oracle/grid/crs_1

Checking shared status of home.....

Starting CRS service on home /oracle/grid/crs_1

CRS service started successfully on home /oracle/grid/crs_1

Preparing home /oracle/app/product/19.3.0/db_1 after database service restarted

No step execution required.........

Trying to apply SQL patch on home /oracle/app/product/19.3.0/db_1

SQL patch applied successfully on home /oracle/app/product/19.3.0/db_1

OPatchAuto successful.

 

1.9  编译无效对象(若在建好实例之后打补丁需要这步)

cd $ORACLE_HOME/rdbms/admin

sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> @utlrp.sql

 

 

1.10  升级rman

需要2遍确认

$ rman catalog username/password@alias

RMAN> UPGRADE CATALOG;

RMAN> UPGRADE CATALOG;

RMAN> EXIT;


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23825935/viewspace-2937914/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
11年数据库行业经验,Oracle ACE、PG ACE、OCM、IBM Certified DBA、MySQL OCP、PolarDB技术专家、KCP、PCTP、PCSD、达梦师资认证、PolarDB开源社区技术顾问、ITPUB认证专家、某高校外聘教师

注册时间:2019-05-05

  • 博文量
    295
  • 访问量
    300808