因為.patch_storage目錄丟失,導致opatch打補丁失敗


一套新裝的ORACLE Restart環境(11.2.0.3.0),計划最新的PSU,在使用opath auto方式安裝補丁時報錯,表面上的錯誤信息提示opatch工具不滿足版本要求:

[root@dmdb01 ~]# opatch auto /u01/20996944 -ocmrf /u01/file.rsp

Executing /u01/app/11.2.0.4/grid/perl/bin/perl /u01/app/11.2.0.4/grid/OPatch/crs/patch11203.pl -patchdir /u01 -patchn 20996944 -ocmrf /u01/file.rsp -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params

 

This is the main log file: /u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2017-04-08_04-45-04.log

 

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:

/u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2017-04-08_04-45-04.report.log

 

2017-04-08 04:45:04: Starting Oracle Restart Patch Setup

Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params

The opatch minimum version check for patch /u01/20996944/17592127 failed for /u01/app/11.2.0.4/grid

The opatch minimum version check for patch /u01/20996944/20760997 failed for /u01/app/11.2.0.4/grid

Opatch version check failed for oracle home /u01/app/11.2.0.4/grid

Opatch version check failed

ERROR: update the opatch version for the failed homes and retry

 

opatch auto failed.

 

要求opatch工具的版本,發現已經是最新版本了,說明這個錯誤與opatch工具的版本無關。

[root@dmdb01 ~]# opatch version

OPatch Version: 11.2.0.3.15

 

OPatch succeeded.

[root@dmdb01 ~]#

 

在使用opatch auto打補丁時,生成了兩個日志文件,查看opatchauto2017-04-08_04-45-04.log文件的內容,發現如下信息:

OPatch failed to lock and get an Inventory Session for the given Oracle Home /u01/app/11.2.0.4/grid

Possible causes are:

No read or write permission to $ORACLE_HOME, cannot create $ORACLE_HOME/.patch_storage

No read or write permission to $ORACLE_HOME/.patch_storage

OPatch cannot proceed further because system will not be able to backup files, or read the backup area for rollback/restore.

OPatchSession cannot load inventory for the given Oracle Home /u01/app/11.2.0.4/grid. Possible causes are:

No read or write permission to ORACLE_HOME/.patch_storage

Central Inventory is locked by another OUI instance

No read permission to Central Inventory

The lock file exists in ORACLE_HOME/.patch_storage

The Oracle Home does not exist in Central Inventory

 

UtilSession failed: IPMRWServices::verifyPatchStorageDirectory() cannot read or write to /u01/app/11.2.0.4/grid/.patch_storage

 

OPatch failed with error code 73

從以上日志,基本知道opatch報錯原因了。

 

去$ORACLE_HOME 和$GRID_HOME下查看.patch_storage目錄的權限,發現$GRID_HOME下基本就不存在.patch_storage目錄,解決辦法很簡單,手動創建這個目錄即可:

[root@dmdb01 grid]# mkdir .patch_storage

[root@dmdb01 grid]# chown grid:oinstall .patch_storage/

[root@dmdb01 grid]# su - oracle

[oracle@dmdb01 ~]$ cd $ORACLE_HOME

[oracle@dmdb01 db_home1]$ mkdir .patch_storage

mkdir: cannot create directory `.patch_storage': File exists

[oracle@dmdb01 db_home1]$

 

再次安裝補丁,一切OK:

[root@dmdb01 u01]# opatch auto /u01/20996944 -ocmrf /u01/file.rsp

Executing /u01/app/11.2.0.4/grid/perl/bin/perl /u01/app/11.2.0.4/grid/OPatch/crs/patch11203.pl -patchdir /u01 -patchn 20996944 -ocmrf /u01/file.rsp -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params

 

This is the main log file: /u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2017-04-08_04-49-46.log

 

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:

/u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2017-04-08_04-49-46.report.log

 

2017-04-08 04:49:46: Starting Oracle Restart Patch Setup

Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params

 

Stopping RAC /u01/app/oracle/product/11.2.0.4/db_home1 ...

Stopped RAC /u01/app/oracle/product/11.2.0.4/db_home1 successfully

 

patch /u01/20996944/17592127/custom/server/17592127 apply successful for home /u01/app/oracle/product/11.2.0.4/db_home1

patch /u01/20996944/20760997 apply successful for home /u01/app/oracle/product/11.2.0.4/db_home1

 

Stopping CRS...

Stopped CRS successfully

 

patch /u01/20996944/17592127 apply successful for home /u01/app/11.2.0.4/grid

patch /u01/20996944/20760997 apply failed for home /u01/app/11.2.0.4/grid

 

Starting CRS...

CRS-4123: Oracle High Availability Services has been started.

 

Starting RAC /u01/app/oracle/product/11.2.0.4/db_home1 ...

Started RAC /u01/app/oracle/product/11.2.0.4/db_home1 successfully

 

opatch auto succeeded.

[root@dmdb01 u01]#

處理故障,有時還是不能被表面現象迷惑。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM