博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
执行perl xttdriver.pl报错Can't locate Getopt/Long.pm in @INC
阅读量:7208 次
发布时间:2019-06-29

本文共 4766 字,大约阅读时间需要 15 分钟。

环境:AIX 6.1 + Oracle 10.2.0.4

现象:在做xtts测试时,源环境使用Oracle自带的perl执行xttdriver.pl报错如下:

$ $ORACLE_HOME/perl/bin/perl xttdriver.plCan't locate Getopt/Long.pm in @INC (@INC contains: /project/aix5l64/main/APACHE/perl/bin/AIX/Opt/lib/5.8.3/aix-thread-multi /project/aix5l64/main/APACHE/perl/bin/AIX/Opt/lib/5.8.3 /project/aix5l64/main/APACHE/perl/bin/AIX/Opt/lib/site_perl/5.8.3/aix-thread-multi /project/aix5l64/main/APACHE/perl/bin/AIX/Opt/lib/site_perl/5.8.3 /project/aix5l64/main/APACHE/perl/bin/AIX/Opt/lib/site_perl .) at xttdriver.pl line 126.BEGIN failed--compilation aborted at xttdriver.pl line 126.

而在目标环境Linux6.8 + Oracle 11.2.0.4 就正常,起初我没多想这个问题,以为是10g的自带perl版本过低不支持,第一轮测试使用了系统自带perl可执行。

但在后续测试中发现系统自带的perl在执行过程中也是有很多类似错误,虽然最终完成,但担心有其他隐患,和有经验的同事进一步沟通,得知之前成功的xtts项目都是采用oracle自带的perl,某些版本报这个错误是需要额外设置环境变量。

具体依据下面的MOS文档,需要设置PER5LIB环境变量:

  • perl xttdriver.pl fails: Can't locate Getopt/Long.pm in @INC (文档 ID 1912400.1)

临时设置PERL5LIB环境变量:

$ export PERL5LIB=$ORACLE_HOME/perl/lib

再次使用Oracle自带的perl执行xttdriver.pl不再报之前的错误,这里测试没加参数,就正常列出了xttdriver.pl的使用方法:

$ $ORACLE_HOME/perl/bin/perl xttdriver.pl============================================================trace file is /tmp/Nov15_Thu_16_29_45_413//Nov15_Thu_16_29_45_413_.log=============================================================--------------------------------------------------------------------Parsing properties----------------------------------------------------------------------------------------------------------------------------------------Done parsing properties----------------------------------------------------------------------------------------------------------------------------------------Checking properties----------------------------------------------------------------------------------------------------------------------------------------Done checking properties--------------------------------------------------------------------   This program prepares, backsup and rollsforward tablespaces   for cross-platform transportable tablespaces.    usage: xttdriver.pl                  {[--backup|-b] || [--bkpincr|-B] || [--bkpexport/E]                   [--resincrdmp|M]                   [--fixnewdf|W]                   [--convert/-c] || [--generate|-e] || [--incremental|-i] ||                   [[--prepare|-p] || [--getfile|-G]] ||                   [--restore|R] || [--recover|X]                   [--rollforward|-r [--rolltbs|-T 
] || [--determinescn|-s] || [--orasid/O] || [--orahome|-o]] [--help|-h]} Additional options ------------------ [--debug|d] [--clearerrorfile|-C] [--xttdir|Dir
] [-F/--propfile] [-I/--propdir] -b : For 12c and above, generate transportable backups -B : For 12c and above, generate level 1 transportable backups -c : conversion of datafiles -M : create the dump file from the generated backup -e : generate impdp script: export over new link -i : incremental backup -p : prepare -G : get datafiles from source database using get_file, should not be used together with -p -r : roll forward datafiles -s : new from_scn values into xttplan.txt -R : For 12c restore the datafiles from the backups -X : For 12c recover the datafiles from the backups -T : roll forward specific tablespace(s) -h : this (help) message (Default) -d : provides more debug information, also rman is called with debug option so that tracing is better. -L : delete the ERROR FILE and proceed with the execution -D : Instead of defining environement variable, user can pass tmpdir through xttdir -O : Use this option to pass ORACLE_SID to override the environment variable -o : Use this option to pass ORACLE_HOME to override the environment variable -I : Use this option to mention the location from where the script will pick the properties file etc -F : Use this option to mention the location from where the script will pick the properties file. -W : Will try to reconstruct files on the destination after new datafiles have been added example: xttdriver.pl -p xttdriver.pl -i xttdriver.pl -r xttdriver.pl -s$

既然如此,后续还是建议使用oracle自带的perl进行测试。

2018-11-18修正说明:最终发现这个不算是问题,因为实际上源端我使用系统自带的perl也并没有任何报错,实际报错是目标端perl在进行增量恢复时有报错,具体是"Can't locate strict.pm in @INC...",虽然看起来和上文很像,但模块名称有区别,而从MOS文档Migrate database to Exadata with DBMS_FILE_TRANSFER (文档 ID 1902618.1)中可以看到这个错误实际是可以忽略的,原话是:
It is safe to ignore the "Can't locate strict.pm in @INC..." messages. We believe those are the result of the Perl pragma 'use strict' in the asmcmdcore.

转载地址:http://xlrum.baihongyu.com/

你可能感兴趣的文章
SpringMVC请求处理流程
查看>>
路由器发展编年史 完结篇
查看>>
餐馆个性化推荐应用
查看>>
Spring+Struts+Hibernate 简介(转)
查看>>
微服务架构优缺点
查看>>
史上最快、最强大的 Gradle 5.0 发布,新特性全解!
查看>>
开发要不要自己做测试?怎么做?
查看>>
10亿次机器翻译,2018天猫双11大量启用AI员工
查看>>
小米6的“小问题” 其实是小米的大麻烦
查看>>
联想AI战略凶猛推进 多设备,跨平台精准实现智能生活
查看>>
乐视网称贾跃亭旗下资产世茂工三拍卖与上市公司无关
查看>>
专访网秦创始人林宇:我曾每天戴20公斤手铐 生不如死
查看>>
英国内政部启动遣返程序 数百非法入境者或遭驱逐
查看>>
当云海遇上日出光晕 安徽黄山风景美如画境
查看>>
「每天一道面试题」sleep方法和wait方法有什么区别?
查看>>
蒙牛与达沃斯建立战略合作伙伴关系助推乳业全球化
查看>>
“宫里过大年”数字沉浸体验展开幕 门神居然会动?
查看>>
最新版中国综合地层时间框架正式发布
查看>>
Python与人工智能间有什么关系?
查看>>
超窄边框主打游戏? 16英寸MacBook概念设计
查看>>