Oracle RAC 第二節點打補丁報錯 oui-patch.xml (Permission denied)

jhon_lee發表於2022-05-01

##GRID
第二節點打補丁報錯 oui-patch.xml (Permission denied)

#<GRID_HOME>/OPatch/opatchauto apply <unzipped location of patch>
OPatchauto session is initiated at Tue May 31 02:21:42 2019

System initialization log file is <GRID_HOME>/cfgtoollogs/opatchautodb/systemconfig2019-05-31_02-21-44AM.log.

Session log file is <GRID_HOME>/cfgtoollogs/opatchauto/opatchauto2019-05-31_02-21-44AM.log
.
.
.
Patch: <unzipped location of patch>
Log: <GRID_HOME>/cfgtoollogs/opatchauto/core/opatch/opatch2019-05-31_02-22-44AM_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: <Inventory_location>/ContentsXML/oui-patch.xml (Permission denied)'

After fixing the cause of failure Run opatchauto resume

 

##發現許可權不對,是RAC的一個bug,官方說是 由於二節點未使用oui程式安裝的,所以未生成這個檔案。
During 19.x Grid Infrastructure (GI) installation, the file 'oui-patch.xml' will be created under the central inventory directory on the OUI node (node where gridSetup.sh was invoked) but not on the remote nodes.


-bash-4.4# hostname;date;ls -ltr $oraInventory/ContentsXML/
<NODE 1>
Fri May 31 02:31:36 PDT 2019
total 16
-rw-rw---- 1 grid oinstall 570 May 31 00:40 inventory.xml
-rw-rw---- 1 grid oinstall 174 May 31 00:40 oui-patch.xml ---> Owned by grid 正常節點
-rw-rw---- 1 grid oinstall 292 May 31 00:43 libs.xml


-bash-4.4# hostname;date;ls -ltr $oraInventory/ContentsXML/
<NODE 2>
Fri May 31 02:30:46 PDT 2019
total 20
-rw-rw---- 1 grid oinstall 570 May 31 00:43 inventory.xml
-rw-r--r-- 1 oracle oinstall 174 May 31 02:21 oui-patch.xml  ---> Owned by oracle -->這裡應該是opatchauto執行時,先安裝DB HOME的補丁導致使用Oracle使用者生成了oui-patch.xml檔案需要修改許可權,或者從1節點複製
-rw-rw---- 1 grid oinstall 292 May 31 02:21 libs.xml
-rw-rw---- 1 grid oinstall 300 May 31 02:21 comps.xml


##官方給的解決方案是從1節點copy oui-patch.xml 檔案過來,然後重新使用opatchauto resume開始安裝補丁。
在我這裡並不好使。

緊接著有如下的問題:

##然後系統報錯:
[grid@rac02 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
Inventory load failed... LsPatchesSession::loadAndPrintInstalledPatch()
LsPatchesSession failed: Unable to create patchObject
Possible causes are:
ORACLE_HOME/inventory/oneoffs/ 32545013 is corrupted. PatchObject constructor: Input file "/u01/app/19.3.0.0/grid/inventory/oneoffs/32545013/etc/config/actions" or "/u01/app/19.3.0.0/grid/inventory/oneoffs/32545013/etc/config/inventory" does not exist.


OPatch failed with error code 2

找32545013補丁找不到。

 

##我的解決方案

1.從好的節點複製這個補丁檔案到問題節點
[grid@rac01 ~]$ cd /u01/app/19.3.0.0/grid/inventory/oneoffs/
[grid@rac01 oneoffs]$ ls -l
total 0
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29401763
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29517242
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29517247
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29585399
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:49 32545013
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:50 32576499
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:52 32579761
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:52 32584670
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:53 32585572
[grid@rac01 oneoffs]$ tar -cvf 32545013.tar 32545013
32545013/
32545013/etc/
32545013/etc/config/
32545013/etc/config/inventory.xml
32545013/etc/config/actions.xml
32545013/jlib/
[grid@rac01 oneoffs]$ scp 32545013.tar rac02:$PWD
32545013.tar


[grid@rac01 ~]$ cd /u01/app/19.3.0.0/grid/inventory/oneoffs/
[grid@rac01 oneoffs]$ ls -l
total 0
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29401763
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29517242
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29517247
drwxr-x--- 4 grid oinstall 29 Apr 18 2019 29585399
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:49 32545013
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:50 32576499
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:52 32579761
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:52 32584670
drwxr-xr-x 4 grid oinstall 29 Jul 3 09:53 32585572
[grid@rac01 oneoffs]$ tar -cvf 32545013.tar 32545013
32545013/
32545013/etc/
32545013/etc/config/
32545013/etc/config/inventory.xml
32545013/etc/config/actions.xml
32545013/jlib/
[grid@rac01 oneoffs]$ scp 32545013.tar rac02:$PWD
32545013.tar

2.再次執行發現可以 使用opatch命令查詢出來


[grid@rac02 oneoffs]$ $ORACLE_HOME/OPatch/opatch lspatches
32545013;Database Release Update : 19.11.0.0.210420 (32545013)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517247;ACFS RELEASE UPDATE 19.3.0.0.0 (29517247)
29401763;TOMCAT RELEASE UPDATE 19.0.0.0.0 (29401763)


3.此時可以 使用opatchauto回滾補丁
root@rac02 oracle]# opatchauto rollback /soft/oracle/32545008 -oh /u01/app/19.3.0.0/grid

OPatchauto session is initiated at Sat Jul 3 12:09:00 2021

System initialization log file is /u01/app/19.3.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2021-07-03_12-09-05PM.log.

浼..?ュ??.歡?.u01/app/19.3.0.0/grid/cfgtoollogs/opatchauto/opatchauto2021-07-03_12-09-11PM.log
姝や?璇.. ID 涓?NK5U

Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.3.0.0/grid
Patch applicability verified successfully on home /u01/app/19.3.0.0/grid


Executing patch validation checks on home /u01/app/19.3.0.0/grid
Patch validation checks successfully completed on home /u01/app/19.3.0.0/grid

Checking shared status of home.....

Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/19.3.0.0/grid

Prepatch operation log file location: /u01/app/grid/crsdata/rac02/crsconfig/crs_prepatch_rac02_2021-07-03_12-10-23AM.log
CRS service brought down successfully on home /u01/app/19.3.0.0/grid


Start rolling back binary patch on home /u01/app/19.3.0.0/grid

 

4.回滾完再次 opatchauto 僅給grid應用補丁 解決該問題。因為我發現db已經成功安裝補丁了,如果不放心可以將二節點全部回滾,再次重新安裝補丁。

##

總結一下:該故障做了2件事情

1.修改 $oraInventory/ContentsXML/oui-patch.xml 檔案許可權為 grid:oinstall rw-rw-r 

2.複製 1節點的補丁包到2節點對應目錄  /u01/app/19.3.0.0/grid/inventory/oneoffs/

3.回滾2節點已經安裝的補丁

4.重新安裝補丁。

 

溫馨提示,安裝完19c RAC以後就應該手工的使用grid使用者從一節點 copy  oui-patch.xml到二節點相應目錄。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26474945/viewspace-2889760/,如需轉載,請註明出處,否則將追究法律責任。

相關文章