linux - 安装 DBD::Oracle 时出错

标签 linux oracle perl cpan

我正在尝试在我的 RHEL6.1 服务器上安装 Perl 模块 DBD::Oracle。这样做时,我遵循了以下步骤:

  1. 安装以下 RPM:

    • oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
    • oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
    • oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
  2. 导出环境变量

    export ORACLE_HOME=/usr/lib/oracle/12.1/client64

    export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib

  3. 安装 DBD::Oracle

    cpan -i DBD::Oracle

这样做时,它会给出以下错误消息:

Installing on a linux, Ver#2.6
Using Oracle in /usr/lib/oracle/12.1/client64
DEFINE _SQLPLUS_RELEASE = "1201000200" (CHAR)
Oracle version 12.1.0.2 (12.1)

        Unable to locate an oracle.mk or other suitable *.mk
        file in your Oracle installation.  (I looked in
        /usr/lib/oracle/12.1/client64/rdbms/demo/demo_xe.mk /usr/lib/oracle/12.1/client64/rdbms/lib/oracle.mk /usr/lib/oracle/12.1/client64/rdbms/demo/oracle.mk /usr/lib/oracle/12.1/client64/rdbms/demo/demo_rdbms.mk /usr/lib/oracle/12.1/client64/rdbms/demo/demo_rdbms64.mk /usr/lib/oracle/12.1/client64/rdbms/lib/ins_rdbms.mk /usr/share/oracle/12.1/client64/demo.mk under /usr/lib/oracle/12.1/client64)

        The oracle.mk (or demo_rdbms.mk) file is part of the Oracle
        RDBMS product.  You need to build DBD::Oracle on a
        system which has one of these Oracle components installed.
        (Other *.mk files such as the env_*.mk files will not work.)
        Alternatively you can use Oracle Instant Client.

        In the unlikely event that a suitable *.mk file is installed
        somewhere non-standard you can specify where it is using the -m option:
                perl Makefile.PL -m /path/to/your.mk

        See the appropriate README file for your OS for more information and some alternatives.

     at Makefile.PL line 1187.
Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site]
  PYTHIAN/DBD-Oracle-1.74.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install

安装过程有什么问题?我关注了this指导。

最佳答案

安装和设置 Oracle Instant Client 后,使用没有 cpan 工具的正常构建步骤,并将 -l 选项传递给 Makefile.PL

  1. 下载tar.gz包并解压

  2. 构建它

    perl Makefile.PL -l
    make && make test
    
  3. 安装

    make install
    

关于linux - 安装 DBD::Oracle 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26200174/

相关文章:

linux - 在 Linux 中删除选定的 60 天旧文件的脚本

c++ - Linux 上 C++ 应用程序的磁盘 IO 分析器

linux - linux中的 'see read(2)'是什么意思?

sql - Oracle:如何获得所有可能的约束违规?

perl - 是否有 perl 5.005 核心模块可以将纪元秒数转换为日期时间字符串?

linux - 您可以在 Go 中运行程序的独立实例吗?

oracle - Oracle客户端安装错误-路径太长

sql - 如何通过SQL获取Oracle Connect中的最终父ID列

perl - 如何在 Perl 中以完全相同的方式对两个数组进行洗牌?

perl - 如何在运行时使用 DBIx::Class 和 Catalyst 添加关系?