zl程序教程

您现在的位置是:首页 >  APP

当前栏目

关于19c RU补丁报错问题的分析处理

2023-02-25 18:17:23 时间

本文演示关于19c RU补丁常见报错问题的分析处理:

1.查看补丁应用失败的原因

补丁应用失败有详细日志记录原因; 故意使用oracle用户解压补丁,然后测试是否可以opatchauto apply应用:

[root@db01rac2 media]# /u01/app/19.3.0/grid/OPatch/opatchauto apply /u01/media/ru/34130714
...
/u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_17-40-25PM_1.log
[Jan 10, 2023 5:41:03 PM] [INFO]    Patch 34160635:
                                    Copy Action: Source File "/u01/media/ru/34130714/34160635/files/bin/ocrcheck.bin" does not exists or is not readable
                                    'oracle.has.crs, 19.0.0.0.0': Cannot copy file from 'ocrcheck.bin' to '/u01/app/19.3.0/grid/bin/ocrcheck.bin'
...

发现报错,查看log说ocrcheck.bin不存在或不可读,实际查看是不可读。

2.问题解决后可继续应用补丁

解决问题后可以使用opatchauto resume继续尝试: 重新使用grid用户解压RU补丁包,然后使用root用户尝试resume补丁应用:

/u01/app/19.3.0/grid/OPatch/opatchauto resume

实际输出如下:

[root@db01rac2 media]# /u01/app/19.3.0/grid/OPatch/opatchauto resume

OPatchauto session is initiated at Tue Jan 10 17:48:40 2023
Session log file is /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/opatchauto2023-01-10_05-48-40PM.log
Resuming existing session with id CBK3

Start applying binary patch on home /u01/app/19.3.0/grid
Binary patch applied successfully on home /u01/app/19.3.0/grid


Performing postpatch operations on CRS - starting CRS service on home /u01/app/19.3.0/grid
Postpatch operation log file location: /u01/app/grid/crsdata/db01rac2/crsconfig/crs_postpatch_apply_inplace_db01rac2_2023-01-10_05-55-25PM.log
CRS service started successfully on home /u01/app/19.3.0/grid

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:db01rac2
CRS Home:/u01/app/19.3.0/grid
Version:19.0.0.0.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /u01/media/ru/34130714/33575402
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_17-49-00PM_1.log

Patch: /u01/media/ru/34130714/34133642
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_17-49-00PM_1.log

Patch: /u01/media/ru/34130714/34139601
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_17-49-00PM_1.log

Patch: /u01/media/ru/34130714/34160635
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_17-49-00PM_1.log

Patch: /u01/media/ru/34130714/34318175
Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_17-49-00PM_1.log



OPatchauto session completed at Tue Jan 10 18:00:06 2023
Time taken to complete the session 11 minutes, 27 seconds
[root@db01rac2 media]# 

3.发现DB的RU补丁未更新

检查补丁应用情况发现DB的补丁未更新 查看RU补丁发现DB的补丁未应用,这是因为DB没有安装数据库,其实在11g时就有这个问题:

[root@db01rac2 media]# su - grid
Last login: Tue Jan 10 20:04:29 CST 2023
[grid@db01rac2 ~]$ $ORACLE_HOME/OPatch/opatch lspatches;
34318175;TOMCAT RELEASE UPDATE 19.0.0.0.0 (34318175)
34160635;OCW RELEASE UPDATE 19.16.0.0.0 (34160635)
34139601;ACFS RELEASE UPDATE 19.16.0.0.0 (34139601)
34133642;Database Release Update : 19.16.0.0.220719 (34133642)
33575402;DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)

OPatch succeeded.

[root@db01rac2 media]# su - oracle
Last login: Tue Jan 10 20:04:30 CST 2023
[oracle@db01rac2 ~]$ $ORACLE_HOME/OPatch/opatch lspatches;
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517242;Database Release Update : 19.3.0.0.190416 (29517242)

OPatch succeeded.

那么在当前暂不需要安装数据库的场景,如何让DB补丁也更新呢?

解决方案两种: 一是应用补丁之前先建一个临时测试库,补丁应用时就会自动应用GI和DB软件的补丁,最后再删掉临时测试库就好。 二是GI应用完成后,再单独指定db的ORACLE_HOME进行应用:

# /u01/app/oracle/product/19.3.0/db_1/OPatch/opatchauto apply /u01/media/ru/34130714 -oh /u01/app/oracle/product/19.3.0/db_1

需要注意这里,如果你要用grid用户下的opatchauto应用db的home补丁,会报错的:

# /u01/app/19.3.0/grid/OPatch/opatchauto apply /u01/media/ru/34130714 -oh /u01/app/oracle/product/19.3.0/db_1

opatchauto must run from one of the homes specified
opatchauto returns with error code = 2

说明必须要用Oracle自己的opatchauto,这也是为啥总是在解压OPatch时,解压到各节点grid和oracle的目录原因,说不定啥场景就要用的到。 最后应用完成后查询成功:

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:db01rac1
RAC Home:/u01/app/oracle/product/19.3.0/db_1
Version:19.0.0.0.0
Summary:

==Following patches were SKIPPED:

Patch: /u01/media/ru/34130714/34139601
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /u01/media/ru/34130714/33575402
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /u01/media/ru/34130714/34318175
Reason: This patch is not applicable to this specified target type - "rac_database"


==Following patches were SUCCESSFULLY applied:

Patch: /u01/media/ru/34130714/34133642
Log: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_21-12-52PM_1.log

Patch: /u01/media/ru/34130714/34160635
Log: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_21-12-52PM_1.log



OPatchauto session completed at Tue Jan 10 21:19:41 2023
Time taken to complete the session 8 minutes, 43 seconds
[root@db01rac1 ~]# su - oracle
Last login: Tue Jan 10 21:19:40 CST 2023
[oracle@db01rac1 ~]$ $ORACLE_HOME/OPatch/opatch lspatches;
34160635;OCW RELEASE UPDATE 19.16.0.0.0 (34160635)
34133642;Database Release Update : 19.16.0.0.220719 (34133642)

OPatch succeeded.

4.opatchauto应用DB补丁报错解决

下面看opatchauto应用DB补丁报错的情况,opatchauto报错信息:

[root@db01rac2 media]# /u01/app/oracle/product/19.3.0/db_1/OPatch/opatchauto apply /u01/media/ru/34130714 -oh /u01/app/oracle/product/19.3.0/db_1

OPatchauto session is initiated at Tue Jan 10 21:20:19 2023

System initialization log file is /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchautodb/systemconfig2023-01-10_09-20-28PM.log.

Session log file is /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/opatchauto2023-01-10_09-20-51PM.log
The id for this session is 2SXU

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19.3.0/db_1
Patch applicability verification failed on home /u01/app/oracle/product/19.3.0/db_1

Execution of [OPatchAutoBinaryAction] patch action failed, check log for more details. Failures:
Patch Target : db01rac2->/u01/app/oracle/product/19.3.0/db_1 Type[rac]
Details: [
---------------------------Patching Failed---------------------------------
Command execution failed during patching in home: /u01/app/oracle/product/19.3.0/db_1, host: db01rac2.
Command failed:  /u01/app/oracle/product/19.3.0/db_1/OPatch/opatchauto  apply /u01/media/ru/34130714 -oh /u01/app/oracle/product/19.3.0/db_1 -target_type rac_database -binary -invPtrLoc /u01/app/oracle/product/19.3.0/db_1/oraInst.loc -jre /u01/app/oracle/product/19.3.0/db_1/OPatch/jre -persistresult /u01/app/oracle/product/19.3.0/db_1/opatchautocfg/db/sessioninfo/sessionresult_analyze_db01rac2_rac_2.ser -analyze -online -prepare_home
Command failure output: 
==Following patches FAILED in analysis for apply:

Patch: /u01/media/ru/34130714/34160635
Log: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_21-21-11PM_1.log
Reason: Failed during Analysis: /u01/media/ru/34130714/34160635 is not applicable to the oracle home /u01/app/oracle/product/19.3.0/db_1

Patch: /u01/media/ru/34130714/34133642
Log: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_21-21-11PM_1.log
Reason: Failed during Analysis: /u01/media/ru/34130714/34133642 is not applicable to the oracle home /u01/app/oracle/product/19.3.0/db_1 

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 Tue Jan 10 21:21:22 2023
Time taken to complete the session 1 minute, 4 seconds

 opatchauto failed with error code 42
[root@db01rac2 media]# 

查看日志:

Possible causes are:
   ORACLE_HOME/inventory/oneoffs/34133642 is corrupted. 
   PatchObject constructor: Input file "/u01/app/oracle/product/19.3.0/db_1/inventory/oneoffs/34133642/etc/config/actions" or "/u01/app/oracle/product/19.3.0/db_1/inventory/oneoffs/34133642/etc/config/inventory" does not exist.

这里确认确实节点2现在没有这个34133642的目录,但是查看已成功应用补丁的节点1是有的。 在想要不要copy过来,是否可行? 另外从ru的补丁介质中也有这两个文件,但是md5比对,和节点1的还不一样,主要是actions.xml不一样。 还是查下MOS吧,果然找到:

  • OPatch lsinventory or Apply New Patch With Opatch apply Fails With Error "Unable to create patchObject" Inventory Corrupted (Doc ID 2792549.1)

提到还是从成功应用补丁的节点拷贝这个目录:

  1. Execute opatch lsinventory in node1 in which patch was applied successfully to verify patch is there (32545013)
  2. If patch was applied successfully, you will need to take a backup of "ORACLE_HOME/inventory/oneoffs/32545013" and then copy the directory from node1 to node2.
  3. Try running opatch lsinventory again.
  4. If, inventory is showing details and patch applied, proceed with Post-Installation Instructions.

既然有了官方依据,那就从节点1拷贝报错缺少的34133642目录到节点2,然后再尝试应用补丁:

[oracle@db01rac1 oneoffs]$ scp -r 34133642 db01rac2:/u01/app/oracle/product/19.3.0/db_1/inventory/oneoffs
inventory.xml                                                                                                        100%  904KB  77.5MB/s   00:00    
actions.xml                                                                                                          100% 6950KB 107.8MB/s   00:00    

节点2确认拷贝成功,尝试应用补丁:

[oracle@db01rac2 oneoffs]$ pwd
/u01/app/oracle/product/19.3.0/db_1/inventory/oneoffs
[oracle@db01rac2 oneoffs]$ cls
-bash: cls: command not found
[oracle@db01rac2 oneoffs]$ ls
29517242  29585399  34133642
[oracle@db01rac2 oneoffs]$ ls -lrth
total 0
drwxr-x--- 4 oracle oinstall 29 Jan 10 09:43 29517242
drwxr-x--- 4 oracle oinstall 29 Jan 10 09:43 29585399
drwxr-xr-x 4 oracle oinstall 29 Jan 10 21:43 34133642
[oracle@db01rac2 oneoffs]$ exit
logout
[root@db01rac2 config]# /u01/app/oracle/product/19.3.0/db_1/OPatch/opatchauto apply /u01/media/ru/34130714 -oh /u01/app/oracle/product/19.3.0/db_1

OPatchauto session is initiated at Tue Jan 10 21:43:53 2023

System initialization log file is /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchautodb/systemconfig2023-01-10_09-43-58PM.log.

Session log file is /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/opatchauto2023-01-10_09-44-19PM.log
The id for this session is TPIG

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19.3.0/db_1
Patch applicability verified successfully on home /u01/app/oracle/product/19.3.0/db_1


Executing patch validation checks on home /u01/app/oracle/product/19.3.0/db_1
Patch validation checks successfully completed on home /u01/app/oracle/product/19.3.0/db_1


Verifying SQL patch applicability on home /u01/app/oracle/product/19.3.0/db_1
No sqlpatch prereq operations are required on the local node for this home
No step execution required.........
 

Preparing to bring down database service on home /u01/app/oracle/product/19.3.0/db_1
No step execution required.........
 

Performing prepatch operation on home /u01/app/oracle/product/19.3.0/db_1
Prepatch operation completed successfully on home /u01/app/oracle/product/19.3.0/db_1


Start applying binary patch on home /u01/app/oracle/product/19.3.0/db_1
Binary patch applied successfully on home /u01/app/oracle/product/19.3.0/db_1


Performing postpatch operation on home /u01/app/oracle/product/19.3.0/db_1
Postpatch operation completed successfully on home /u01/app/oracle/product/19.3.0/db_1


Preparing home /u01/app/oracle/product/19.3.0/db_1 after database service restarted
No step execution required.........
 

Trying to apply SQL patch on home /u01/app/oracle/product/19.3.0/db_1
No sqlpatch operations are required on the local node for this home
SQL patch applied successfully on home /u01/app/oracle/product/19.3.0/db_1

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:db01rac2
RAC Home:/u01/app/oracle/product/19.3.0/db_1
Version:19.0.0.0.0
Summary:

==Following patches were SKIPPED:

Patch: /u01/media/ru/34130714/34139601
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /u01/media/ru/34130714/33575402
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /u01/media/ru/34130714/34318175
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /u01/media/ru/34130714/34133642
Log: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_21-44-38PM_1.log
Reason: /u01/media/ru/34130714/34133642 is not required to be applied to oracle home /u01/app/oracle/product/19.3.0/db_1


==Following patches were SUCCESSFULLY applied:

Patch: /u01/media/ru/34130714/34160635
Log: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2023-01-10_21-45-49PM_1.log



OPatchauto session completed at Tue Jan 10 21:46:52 2023
Time taken to complete the session 3 minutes, 0 second

咦,34133642没成功?还是已经成功了?看下日志:

[Jan 10, 2023 9:45:24 PM] [INFO]    Prereq "checkForIdenticalPatchInOracleHome" failed.
[Jan 10, 2023 9:45:24 PM] [INFO]    The details are:

                                    The following patch(es) are identical patches with patches installed in the Oracle Home.
                                     [ 34133642]
                                    You have already installed same patch(es) with same UPI(s) or same version(s).

日志说之前已经安装成功了,再通过opatch检查下,实际果然安装都成功了:

[oracle@db01rac2 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
34160635;OCW RELEASE UPDATE 19.16.0.0.0 (34160635)
34133642;Database Release Update : 19.16.0.0.220719 (34133642)

OPatch succeeded.

嗯,基本RU补丁应用也就这样了,不报错很简单,即使遇到报错,通常解决起来难度也不大。