打Oracle PSU時碰到的一些問題處理

lhrbest發表於2018-10-31




一.1   安裝程式錯誤   UtilSession failed: Prerequisite check "CheckPatchApplicableOnCurrentPlatform" failed.

suse11sp2:/oracle/product/11gR2/db/OPatch> ./opatch apply /oracle/product/11gR2/db/16619892/

Oracle Interim Patch Installer version 11.2.0.3.4

Copyright (c) 2012, Oracle Corporation.   All rights reserved.

Oracle Home            : /oracle/product/11gR2/db

Central Inventory : /oracle/oraInventory

      from                    : /oracle/product/11gR2/db/oraInst.loc

OPatch version       : 11.2.0.3.4

OUI version            : 11.2.0.3.0

Log file location : /oracle/product/11gR2/db/cfgtoollogs/

opatch/opatch2013-07-22_18-22-06PM_1.log

Verifying environment and performing prerequisite checks...

Prerequisite check "CheckPatchApplicableOnCurrentPlatform" failed.

The details are:

Patch ( 13343438 ) is not applicable on current platform.

Platform ID needed is : 226

Platform IDs supported by patch are: 209 211 Patch ( 13696216 ) is not applicable on current platform.

Platform ID needed is : 226

Platform IDs supported by patch are: 209 Patch ( 13923374 ) is not applicable on   current platform.

Platform ID needed is : 226

Platform IDs supported by patch are: 209 Patch ( 14275605 ) is not applicable on   current platform.

Platform ID needed is : 226

Platform IDs supported by patch are: 209 Patch ( 14727310 ) is not applicable on   current platform.

Platform ID needed is : 226

Platform IDs supported by patch are: 209 Patch ( 16056266 ) is not applicable on   current platform.

Platform ID needed is : 226

Platform IDs supported by patch are: 209 Patch ( 16619892 ) is not applicable on   current platform.

Platform ID needed is : 226

Platform IDs supported by patch are: 209

UtilSession failed: Prerequisite check "CheckPatchApplicableOnCurrentPlatform" failed.

Log file location: /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-22-06PM_1.log

 

 

OPatch failed with error code 73

suse11sp2:/oracle/product/11gR2/db/OPatch>

 

 

仔細檢視,發現下載的軟體壓縮包是 ibm system z 系列的,應該是 oracle 網站開啟得太慢,預設是這個版本,需要下拉選單再次選擇 linux -x86-64 對應的軟體,結果我動作太快,出錯了。

檢檢視看 PSU 應用的結果 , 未成功 :

suse11sp2:/oracle/product/11gR2/db/OPatch> ./opatch version

OPatch Version: 11.2.0.3.4

 

 

OPatch succeeded.

suse11sp2:/oracle/product/11gR2/db/OPatch> ./opatch lspatches

There are no Interim patches installed in this Oracle Home.

 

 

一.2   OPatch failed with error code 73

suse11sp2:/oracle/soft> /oracle/product/11gR2/db/OPatch/opatch apply /oracle/soft/16619892/

Oracle Interim Patch Installer version 11.2.0.3.4

Copyright (c) 2012, Oracle Corporation.   All rights reserved.

Oracle Home            : /oracle/product/11gR2/db

Central Inventory : /oracle/oraInventory

      from                    : /oracle/product/11gR2/db/oraInst.loc

OPatch version       : 11.2.0.3.4

OUI version            : 11.2.0.3.0

Log file location : /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-40-42PM_1.log

 

Verifying environment and performing prerequisite checks...

Prerequisite check "CheckActiveFilesAndExecutables" failed.

The details are:

 

Following executables are active :

/oracle/product/11gR2/db/lib/libclntsh.so.11.1

UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.

Log file location: /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-40-42PM_1.log

 

 

OPatch failed with error code 73

 

不使用自動模式,手工執行,一樣報錯:

suse11sp2:/oracle/soft> /oracle/product/11gR2/db/OPatch/opatch napply -oh $ORACLE_HOME -local /oracle/soft/16619892/

Oracle Interim Patch Installer version 11.2.0.3.4

Copyright (c) 2012, Oracle Corporation.   All rights reserved.

Oracle Home            : /oracle/product/11gR2/db

Central Inventory : /oracle/oraInventory

      from                    : /oracle/product/11gR2/db/oraInst.loc

OPatch version       : 11.2.0.3.4

OUI version            : 11.2.0.3.0

Log file location : /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-42-08PM_1.log

Verifying environment and performing prerequisite checks...

Prerequisite check "CheckActiveFilesAndExecutables" failed.

The details are:

Following executables are active :

/oracle/product/11gR2/db/lib/libclntsh.so.11.1

UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.

Log file location: /oracle/product/11gR2/db/cfgtoollogs/opatch/opatch2013-07-22_18-42-08PM_1.log

OPatch failed with error code 73

上網 goole ,關鍵詞為 “ OPatch failed with error code 73” , 很快就查到解決辦法,明確了其實就是因為有使用者程式佔用了檔案 libclntsh.so.11

suse11sp2:/oracle/soft>

suse11sp2:/oracle/soft>

suse11sp2:/oracle/soft> /sbin/fuser /oracle/product/11gR2/db/lib/libclntsh.so.11.1

/oracle/product/11gR2/db/lib/libclntsh.so.11.1:   5473m

suse11sp2:/oracle/soft> ps -ef | grep 5473

oracle       5473   5399   0 14:45 pts/2       00:00:00 sqlplus    as sysdba

oracle       7780   6617   0 18:47 pts/3       00:00:00 grep 5473

suse11sp2:/oracle/soft> kill -9   5473

suse11sp2:/oracle/soft> /sbin/fuser /oracle/product/11gR2/db/lib/libclntsh.so.11.1

suse11sp2:/oracle/soft>

 

 

一.3   PATCH 鎖住無法繼續安裝補丁

 

報錯現象 :

------------------------------------------------------------------------------------------------------------------------------

Oracle Home       : /oracle/app/11.2.0/grid

Central Inventory : /oracle/app/oraInventory

   from           : /oracle/app/11.2.0/grid/oraInst.loc

OPatch version    : 11.2.0.3.0

OUI version       : 11.2.0.3.0

Log file location : /oracle/app/11.2.0/grid/cfgtoollogs/opatch/opatch2013-09-05_19-24-55PM_1.log

OPatchSession cannot load inventory for the given Oracle Home /oracle/app/11.2.0/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: Lock file left by a different patch, OPatch will not try re-using the lock file.

Log file location: /oracle/app/11.2.0/grid/cfgtoollogs/opatch/opatch2013-09-05_19-24-55PM_1.log

------------------------------------------------------------------------------------------------------------------------------

處理方法 :

cd  /oracle/app/11.2.0/grid/.patch_storage ;rm patch_locked

 

一.4   G I PSU5 補丁遇到拷貝檔案失敗案例 1

 

報錯現象 :

-------------------------------------------------------------------------------------------------------------------------------

The following actions have failed:

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libclsra11.so' to '/oracle/app/11.2.0/grid/lib/libclsra11.so'...

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libdbcfg11.so' to '/oracle/app/11.2.0/grid/lib/libdbcfg11.so'...

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libeons.so' to '/oracle/app/11.2.0/grid/lib/libeons.so'...

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libeonsserver.so' to '/oracle/app/11.2.0/grid/lib/libeonsserver.so'...

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libgns11.so' to '/oracle/app/11.2.0/grid/lib/libgns11.so'...

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libhasgen11.so' to '/oracle/app/11.2.0/grid/lib/libhasgen11.so'...

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libocr11.so' to '/oracle/app/11.2.0/grid/lib/libocr11.so'...

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libocrb11.so' to '/oracle/app/11.2.0/grid/lib/libocrb11.so'...

Copy failed from '/oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libocrutl11.so' to '/oracle/app/11.2.0/grid/lib/libocrutl11.so'...

…… (y/n)

------------------------------------------------------------------------------------------------------------------------------------------------------

處理方法 :

su - grid

mv   /oracle/app/11.2.0/grid/lib/libclsra11.so      /oracle/app/11.2.0/grid/lib/libclsra11.so.1    

mv   /oracle/app/11.2.0/grid/lib/libdbcfg11.so      /oracle/app/11.2.0/grid/lib/libdbcfg11.so.1    

mv   /oracle/app/11.2.0/grid/lib/libeons.so         /oracle/app/11.2.0/grid/lib/libeons.so.1       

mv   /oracle/app/11.2.0/grid/lib/libeonsserver.so   /oracle/app/11.2.0/grid/lib/libeonsserver.so.1

mv   /oracle/app/11.2.0/grid/lib/libgns11.so        /oracle/app/11.2.0/grid/lib/libgns11.so.1      

mv   /oracle/app/11.2.0/grid/lib/libhasgen11.so     /oracle/app/11.2.0/grid/lib/libhasgen11.so.1   

mv   /oracle/app/11.2.0/grid/lib/libocr11.so        /oracle/app/11.2.0/grid/lib/libocr11.so.1      

mv   /oracle/app/11.2.0/grid/lib/libocrb11.so       /oracle/app/11.2.0/grid/lib/libocrb11.so.1     

mv   /oracle/app/11.2.0/grid/lib/libocrutl11.so     /oracle/app/11.2.0/grid/lib/libocrutl11.so.1   

-------

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libclsra11.so     /oracle/app/11.2.0/grid/lib/libclsra11.so   

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libdbcfg11.so     /oracle/app/11.2.0/grid/lib/libdbcfg11.so   

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libeons.so        /oracle/app/11.2.0/grid/lib/libeons.so      

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libeonsserver.so  /oracle/app/11.2.0/grid/lib/libeonsserver.so

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libgns11.so       /oracle/app/11.2.0/grid/lib/libgns11.so     

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libhasgen11.so    /oracle/app/11.2.0/grid/lib/libhasgen11.so  

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libocr11.so       /oracle/app/11.2.0/grid/lib/libocr11.so     

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libocrb11.so      /oracle/app/11.2.0/grid/lib/libocrb11.so    

cp /oracle/app/11.2.0/grid/.patch_storage/13919095_Jul_4_2012_11_10_31/files/lib/libocrutl11.so    /oracle/app/11.2.0/grid/lib/libocrutl11.so  

然後再輸入 y 回車

 

一.5   GI PSU5 補丁遇到拷貝檔案失敗案例 2

 

報錯現象 :

--------------------------------------------------------------------------------------------------------------------------------

Patching component oracle.crs, 11.2.0.3.0...

 

Copy failed from '/softtmp/15876003/files/lib/libclsra11.so' to '/oracle/app/11.2.0/grid/lib/libclsra11.so'...  

Please verify all applications associated with the Oracle Home '/oracle/app/11.2.0/grid' are shut down. If this is AIX, please perform solution documented in Note 739963.1 on https://myoraclesupport.oracle.com.

 

Do you want to retry copying the file? [y|n]

 

-----------------------------------------------------------------------------------------------------------------

處理方法 :

su  gird

mv /oracle/app/11.2.0/grid/lib/libclsra11.so    /oracle/app/11.2.0/grid/lib/libclsra11.so .bak

cp /softtmp/15876003/files/lib/libclsra11.so    /oracle/app/11.2.0/grid/lib/libclsra11.so

然後再輸入 y 回車

 

(1)  root 使用者跑 $ORACLE_HOME/crs/install/rootcrs.pl –patch 失敗無法正常啟動 CRS

 

處理方法 :

重啟 LPAR, #shutdown –Fr, 等待 CRS 正常啟動

 

一.6   CRS-1153: There was an error setting Oracle Clusterware to rolling patch mode.


 

錯誤資訊:

HQsPSL-SSMS-R01:/oracle/app/12.1.0/grid/crs/install # rootcrs.pl -prepatch

Using configuration parameter file: /oracle/app/12.1.0/grid/crs/install/crsconfig_params

Oracle Clusterware active version on the cluster is [12.1.0.2.0]. The cluster upgrade state is [ROLLING PATCH]. The cluster active patch level is [0].

PROC-28: Oracle Cluster Registry already in current version

CRS-1153: There was an error setting Oracle Clusterware to rolling patch mode.

CRS-4000: Command Start failed, or completed with errors.

2016/11/23 18:45:40 CLSRSC-430: Failed to start rolling patch mode

 

Died at crspatch.pm line 783.

HQsPSL-SSMS-R01:/oracle/app/12.1.0/grid/crs/install #

 

根據 MOS:

CAUSE

 

The issue happens if the cluster is already in rolling patch mode, it's due to unpublished bug:

 

BUG 19499021 - 12.1.0.2.1GIPSU: OPATCHAUTO HIT CLSRSC-430: FAILED TO START ROLLING PATCH MODE

 

SOLUTION

 

The fix is included in 12.1.0.2 GI PSU1, the workaround is to stop rolling patch and re-run opatchauto:

 

# crsctl stop rollingpatch

 

解決:

HQsPSL-SSMS-R01:~ # /oracle/app/12.1.0/grid/bin/crsctl stop rollingpatch  

CRS-1169: The cluster is consistent and the cluster active patch level is [0].

CRS-4000: Command Stop failed, or completed with errors.

HQsPSL-SSMS-R01:~ #

HQsPSL-SSMS-R01:~ # oerr crs 1169

1169, 0, "The cluster is consistent and the cluster active patch level is [%u]."

// *Cause: The cluster has already completed the rolling patch procedure.

// *Action: None.

HQsPSL-SSMS-R01:~ #

 

重新執行 /oracle/app/12.1.0/grid/crs/install/rootcrs.pl -prepatch 命令打 PUS 補丁即可。

一.7   ERROR: Unable to run lspatches

2018-10-30 14:49:43: Starting Clusterware Patch Setup

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

ERROR: Unable to run lspatches on /u01/app/oracle/product/11.2.0/dbhome_1

 

解決: db 軟體的 opatch 不是最新版本,請升級到最新版本。

 

一.8   OPatch failed with error code 106

報錯:

OPatch cannot locate your -invPtrLoc '/u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc'

OPatch failed with error code 106

 

解決:

cp /etc/oraInst.loc /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc

 

 

一.9   ERROR: This patch is not applicable to GI home.

1、 grid oracle $ORACLE_HOME/.patch_storage 目錄進行賦權,否則可能會報錯:

ERROR: This patch is not applicable to GI home.

解決:

分別對 oracle grid 使用者的目錄進行賦權:

chmod -R 777 $ORACLE_HOME/.patch_storage

ll -d $ORACLE_HOME/.patch_storage

 

[root@raclhr-11gR2-N2 OPatch]# ll -d $ORACLE_HOME/.patch_storage

drwxrwxrwx 2 grid oinstall 4096 Oct 30 15:54 /u01/app/11.2.0/grid/.patch_storage

 

[oracle@raclhr-11gR2-N2 ~]$ ll -d $ORACLE_HOME/.patch_storage

drwxrwxrwx 9 oracle oinstall 4096 Oct 30 16:06 /u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage

 

 

一.10   Error : The opatch Applicable check failed.  The patch /soft/psu5/15876003 is not applicable to /u01/app/11.2.0/grid

 

2018-10-30 17:10:09: Running as user grid: /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /soft/psu5/15876003 -oh /u01/app/11.2.0/grid

2018-10-30 17:10:09: s_run_as_user2: Running /bin/su grid -c ' /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /soft/psu5/15876003 -oh /u01/app/11.2.0/grid '

2018-10-30 17:10:11: Removing file /tmp/fileDJwCRK

2018-10-30 17:10:11: Successfully removed file: /tmp/fileDJwCRK

2018-10-30 17:10:11: /bin/su successfully executed

 

2018-10-30 17:10:11: Error : The opatch Applicable check failed.  The patch /soft/psu5/15876003 is not applicable to /u01/app/11.2.0/grid

2018-10-30 17:10:11: Status of Applicable  check  for /u01/app/11.2.0/grid is 1

2018-10-30 17:10:11: Error:Patch Applicable check failed for /u01/app/11.2.0/grid

 

解決:單獨執行報錯:

[root@raclhr-11gR2-N2 bin]# su - grid

[grid@raclhr-11gR2-N2 ~]$ /u01/app/11.2.0/grid/OPatch/opatch prereq CheckApplicable -ph /soft/psu5/15876003 -oh /u01/app/11.2.0/grid

Oracle Interim Patch Installer version 11.2.0.3.19

Copyright (c) 2018, Oracle Corporation.  All rights reserved.

 

PREREQ session

 

Oracle Home       : /u01/app/11.2.0/grid

Central Inventory : /u01/app/oraInventory

   from           : /u01/app/11.2.0/grid/oraInst.loc

OPatch version    : 11.2.0.3.19

OUI version       : 11.2.0.3.0

Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2018-10-30_17-16-03PM_1.log

 

Invoking prereq "checkapplicable"

 

ZOP-46: The patch(es) are not applicable on the Oracle Home because some patch actions are not applicable. All required components, however, are installed.

 

Prereq "checkApplicable" for patch 15876003 failed.

 

The details are:

 

Patch 15876003:

Copy Action: Destination File "/u01/app/11.2.0/grid/bin/appvipcfg" is not writeable.

'oracle.crs, 11.2.0.3.0': Cannot copy file from 'appvipcfg' to '/u01/app/11.2.0/grid/bin/appvipcfg'

Copy Action: Destination File "/u01/app/11.2.0/grid/bin/clscfg.bin" is not writeable.

'oracle.crs, 11.2.0.3.0': Cannot copy file from 'clscfg.bin' to '/u01/app/11.2.0/grid/bin/clscfg.bin'

.............

Copy Action: Destination File "/u01/app/11.2.0/grid/lib/acfssinglefsmount.pl" is not writeable.

'oracle.usm, 11.2.0.3.0': Cannot copy file from 'acfssinglefsmount.pl' to '/u01/app/11.2.0/grid/lib/acfssinglefsmount.pl'

Copy Action: Destination File "/u01/app/11.2.0/grid/lib/acfstoolsdriver.sh" is not writeable.

'oracle.usm, 11.2.0.3.0': Cannot copy file from 'acfstoolsdriver.sh' to '/u01/app/11.2.0/grid/lib/acfstoolsdriver.sh'

 

 

OPatch succeeded.

 

GRID_HOME 的許可權有問題:

chown -R grid:oinstall /u01/app/grid

chown -R grid:oinstall /u01/app/11.2.0

PSU 安裝 完成之後再恢復許可權 或以下恢復許可權的命令不用執行,因為 opatch PSU 的過程中會自動的恢復 $GRID_HOME 的許可權

<GRID_HOME>/crs/install/rootcrs.pl -unlock

<GRID_HOME>/crs/install/rootcrs.pl -patch

$GRID_HOME/crs/install/rootcrs.pl -init

 

 




About Me

........................................................................................................................

● 本文作者:小麥苗,部分內容整理自網路,若有侵權請聯絡小麥苗刪除

● 本文在itpub( http://blog.itpub.net/26736162 )、部落格園( http://www.cnblogs.com/lhrbest )和個人weixin公眾號( xiaomaimiaolhr )上有同步更新

● 本文itpub地址: http://blog.itpub.net/26736162

● 本文部落格園地址: http://www.cnblogs.com/lhrbest

● 本文pdf版、個人簡介及小麥苗雲盤地址: http://blog.itpub.net/26736162/viewspace-1624453/

● 資料庫筆試面試題庫及解答: http://blog.itpub.net/26736162/viewspace-2134706/

● DBA寶典今日頭條號地址: http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826

........................................................................................................................

● QQ群號: 230161599 (滿) 、618766405

● weixin群:可加我weixin,我拉大家進群,非誠勿擾

● 聯絡我請加QQ好友 646634621 ,註明新增緣由

● 於 2018-10-01 06:00 ~ 2018-10-31 24:00 在魔都完成

● 最新修改時間:2018-10-01 06:00 ~ 2018-10-31 24:00

● 文章內容來源於小麥苗的學習筆記,部分整理自網路,若有侵權或不當之處還請諒解

● 版權所有,歡迎分享本文,轉載請保留出處

........................................................................................................................

小麥苗的微店 https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

小麥苗出版的資料庫類叢書 http://blog.itpub.net/26736162/viewspace-2142121/

小麥苗OCP、OCM、高可用網路班 http://blog.itpub.net/26736162/viewspace-2148098/

小麥苗騰訊課堂主頁 https://lhr.ke.qq.com/

........................................................................................................................

使用 weixin客戶端 掃描下面的二維碼來關注小麥苗的weixin公眾號( xiaomaimiaolhr )及QQ群(DBA寶典)、新增小麥苗weixin, 學習最實用的資料庫技術。

........................................................................................................................

歡迎與我聯絡

 

 



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

相關文章