18c rac CentOS 7.1上安装2020年10月份psu补丁,遇到 Can't locate Cwd.pm 报错。
正常情况下30分钟就能把gi、db补丁都打上了。
[root@db1 31748523]# /u01/app/18.3/grid/OPatch/opatchauto apply /soft/31748523 -oh /u01/app/18.3/grid
OPatchauto session is initiated at Wed Dec 2 21:45:49 2020
System initialization log file is /u01/app/18.3/grid/cfgtoollogs/opatchautodb/systemconfig2020-12-02_09-45-54PM.log.
会话日志文件是/u01/app/18.3/grid/cfgtoollogs/opatchauto/opatchauto2020-12-02_09-46-18PM.log
Can't locate Cwd.pm: /root/perl5/lib/perl5/Cwd.pm: (null) at /u01/app/18.3/grid/OPatch/auto/database/bin/RemoteHostExecutor.pl line 2.
BEGIN failed--compilation aborted at /u01/app/18.3/grid/OPatch/auto/database/bin/RemoteHostExecutor.pl line 2.
oracle.dbsysmodel.driver.sdk.productdriver.ProductDriverException: Unable to execute command :
Can't locate Cwd.pm: /root/perl5/lib/perl5/Cwd.pm: (null) at /u01/app/18.3/grid/OPatch/auto/database/bin/RemoteHostExecutor.pl line 2.
BEGIN failed--compilation aborted at /u01/app/18.3/grid/OPatch/auto/database/bin/RemoteHostExecutor.pl line 2.
OPatchAuto 失败。
OPatchauto session completed at Wed Dec 2 21:46:19 2020
Time taken to complete the session 0 minute, 30 seconds
opatchauto failed with error code 42
解决参考1:
[root@pw ~]# find / -name "Cwd.pm"
/usr/lib64/perl5/vendor_perl/Cwd.pm
/oracle/oracle/product/db12c/perl/lib/5.22.0/x86_64-linux-thread-multi/Cwd.pm
/oracle/12.2/product/grid12c/perl/lib/5.22.0/x86_64-linux-thread-multi/Cwd.pm
# export PERL5LIB=/oracle/12.2/product/grid12c/perl/lib/5.22.0/x86_64-linux-thread-multi/
引自:
解决参考2:
There could be a problem with the 'PERL5LIB' environment variable.
>>> dont see this error in node2 though <<<
Check the value of 'PERL5LIB' and compare against node 2.
Set the 'PERL5LIB' as appropriate so as to access the lib 'strict.pm' and ensure the 'PATH' variable is able to reach this. Note that this is found under both perl5 and GI home.
For example -
ls -l /usr/share/perl5/strict.pm
ls -l //perl/lib//strict.pm
export PERL5LIB=//perl/lib/:/usr/share/perl5/
export PATH=$PATH://perl/lib/:/usr/share/perl5/
引自:https://community.oracle.com/mosc/discussion/4339154/opatchauto-error-cant-locate-cwd-pm-root-perl5-lib-perl5-cwd-pm
安装完毕后:
[grid@db1 ~]$ opatch lspatches
31738083;TOMCAT RELEASE UPDATE 18.0.0.0.0 (31738083)
31734764;ACFS RELEASE UPDATE 18.12.0.0.0 (31734764)
31734716;OCW RELEASE UPDATE 18.12.0.0.0 (31734716)
31730250;Database Release Update : 18.12.0.0.201020 (31730250)
28655963;DBWLM RELEASE UPDATE 18.4.0.0.0 (28655963)
27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
OPatch succeeded.
[oracle@db1 ~]$ opatch lspatches
31734716;OCW RELEASE UPDATE 18.12.0.0.0 (31734716)
31730250;Database Release Update : 18.12.0.0.201020 (31730250)
27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
OPatch succeeded.
应该是路径问题,一开始看了一下的确没有这个Cwd.pm文件,创建目录,从/u01下搜了一个拷贝一个过去,还是不行。上mos上直接搜不到,百度搜了几个也不合适,还是科学上网了一下,找到上述两个方案,都是一个意思设置PERL5LIB 这个环境变量(通常是grid用户的$ORACLE_HOME/perl/lib/5.22.0/x86_64-linux-thread-multi/)再打补丁,这次差点被百度耽误了。
阅读(3845) | 评论(0) | 转发(0) |