Problem Applying Patch using OPatch - "Can't locate DBI.pm in @INC..."
Applies to:
Portal - Version: 10.1.4.0.0 - Release: 10gR3
Information in this document applies to any platform.
Symptoms
An error is seen applying patch using OPatch on a Linux environment
....
Executing the Apply pre-patch script (/u01/app/oracle/OraHome_1/4919270/4919270/custom/scripts/pre)...
Can't locate DBI.pm in @INC (@INC contains: /u01/app/oracle/OraHome_1/perl/lib/site_perl/5.6.1/IA64.ARCHREV_0 /u01/app/oracle/OraHome_1/perl/lib/5.6.1/i686-linux /u01/app/oracle/OraHome_1/perl/lib/5.6.1 /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/5.6.1/i686-linux /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/5.6.1 /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/site_perl/5.6.1/i686-linux /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/site_perl/5.6.1 /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/site_perl .) at opatchutils.pm line 47.
BEGIN failed--compilation aborted at opatchutils.pm line 47.
Compilation failed in require at opatch.pl line 65.
BEGIN failed--compilation aborted at opatch.pl line 65.
PERL5LIB=/u01/app/oracle/OraHome_1/perl/lib/5.6.1:/u01/app/oracle/OraHome_1/4919270/4919270/custom/scripts/perl_modules; export PERL5LIB
/u01/app/oracle/OraHome_1/perl/bin/perl /u01/app/oracle/OraHome_1/4919270/4919270/custom/scripts/pre.pl -apply 4919270 -s portal -p XXXXXXXX -c myserver.mydomain.com:1521:orcl.myserver.mydomain.com
Cause
Caused by a problem version of ptlpatch.csh
This extract from ptlpatch.csh is incorrect for a Linux installation
#setenv PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/${OS}:${ORACLE_HOME}/perl/lib/5.6.1;
setenv PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/IA64.ARCHREV_0:${ORACLE_HOME}/perl/lib/5.6.1;
The correct version of ptlpatch.csh should have
setenv PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/${OS}:${ORACLE_HOME}/perl/lib/5.6.1;
It is possible that this incorrect version of ptlpatch.csh was mistakenly installed from a patch. This version of ptlpatch.csh is only applicable to HP Unix installations.
Solution
Either
a) re-install the correct version of ptlpatch.csh if it was backed up prior to being overwritten
b) edit the ptlpatch.csh
Replace
setenv PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/IA64.ARCHREV_0:${ORACLE_HOME}/perl/lib/5.6.1;
with
setenv PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/${OS}:${ORACLE_HOME}/perl/lib/5.6.1;
c) Use the workaround of creating a link to make the version of ptlpatch.csh work OK.
cd /perl/lib/site_perl/5.6.1/
ln -s i686-linux IA64.ARCHREV_0
应用补丁使用OPatch问题——在@INC...中找不到数据库索引
应用:
Portal - Version: 10.1.4.0.0 - Release: 10gR3
本文档的信息可以应用到任何平台
症状
有错误申请补丁在Linux环境下使用OPatch
执行补丁脚本
(/u01/app/oracle/OraHome_1/4919270/4919270/custom/scripts/pre)...
找不到数据库索引@INC (@INC contains: /u01/app/oracle/OraHome_1/perl/lib/site_perl/5.6.1/IA64.ARCHREV_0 /u01/app/oracle/OraHome_1/perl/lib/5.6.1/i686-linux /u01/app/oracle/OraHome_1/perl/lib/5.6.1 /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/5.6.1/i686-linux /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/5.6.1 /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/site_perl/5.6.1/i686-linux /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/site_perl/5.6.1 /project/ias904/src/src_021106/pdc_perl/bin/Linux/Opt/lib/site_perl .) at opatchutils.pm line 47.
BEGIN failed--compilation aborted at opatchutils.pm line 47.
Compilation failed in require at opatch.pl line 65.
BEGIN failed--compilation aborted at opatch.pl line 65.
PERL5LIB=/u01/app/oracle/OraHome_1/perl/lib/5.6.1:/u01/app/oracle/OraHome_1/4919270/4919270/custom/scripts/perl_modules; export PERL5LIB
/u01/app/oracle/OraHome_1/perl/bin/perl /u01/app/oracle/OraHome_1/4919270/4919270/custom/scripts/pre.pl -apply 4919270 -s portal -p XXXXXXXX -c myserver.mydomain.com:1521:orcl.myserver.mydomain.com
原因
ptlpatch.csh版本问题所引起的
从ptlpatch.csh 摘录的文件对于Linux 系统安装来说是不正确的
#setenv PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/${OS}:${ORACLE_HOME}/perl/lib/5.6.1;
setenv PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/IA64.ARCHREV_0:${ORACLE_HOME}/perl/lib/5.6.1;
正确的ptlpatch.csh版本 应该有设置环境变量PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/${OS}:${ORACLE_HOME}/perl/lib/5.6.1;
错误的ptlpatch.csh 版本可能会错误的安装. ptlpatch.csh版本 只适用于 HP Unix 系统的安装
解决方案
a)如果在被覆盖之前有备份的话,重新安装正确 ptlpatch.csh 版本
b) 编辑 ptlpatch.csh代替设置环境变量PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/IA64.ARCHREV_0:${ORACLE_HOME}/perl/lib/5.6.1;
with
setenv PERL5LIB ${ORACLE_HOME}/perl/lib/site_perl/5.6.1/${OS}:${ORACLE_HOME}/perl/lib/5.6.1;
c) 使用工作区创建一个连接来使ptlpatch.csh 版本正常工作
cd /perl/lib/site_perl/5.6.1/
ln -s i686-linux IA64.ARCHREV_0