Perl DBD::Oracle 模块安装

Perl DBD::Oracle Module installation(Perl DBD::Oracle 模块安装)
本文介绍了Perl DBD::Oracle 模块安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以指导我如何安装 Perl DBD::Oracle 模块吗?

Could someone guide me how to install the Perl DBD::Oracle module?

这是我目前所做的:

  • 平台:RHEL 5.8 64 位
  • 已安装 Perl DBI 包
  • 为 Linux 64 位安装了 Oracle Instant 客户端(即时客户端的基础 + sdk + sqlplus 组件
  • 已设置正确的$ORACLE_HOME$LD_LIBRARY_PATH
  • 然后当我执行 perl Makefile.pl 时它失败并出现以下错误:

  • Platform: RHEL 5.8 64 bit
  • Installed Perl DBI package
  • Installed Oracle Instant client for Linux 64 bit (basi + sdk + sqlplus component for the instant client
  • Have set the correct $ORACLE_HOME and $LD_LIBRARY_PATH
  • Then when I do perl Makefile.pl it fails with the following error:

I'm having trouble finding your Oracle version number... trying harder

WARNING: I could not determine Oracle client version so I'll just
default to version 8.0.0.0. Some features of DBD::Oracle may not work.
Oracle version based logic in Makefile.PL may produce erroneous results.
You can use "perl Makefile.PL -V X.Y.Z" to specify a your client version.

Oracle version 8.0.0.0 (8.0)
DBD::Oracle no longer supports Oracle client versions before 9.2
 Try a version before 1.25 for 9 and 1.18 for 8! at Makefile.PL line 271.

  • 即时客户端版本:11.1.0

  • The instant client version: 11.1.0

    如果您已经成功安装了 Oracle 即时客户端,那么能否请您告诉我我缺少什么?

    If you have installed successfully with the Oracle instant client, then could you please let me know what am I missing?

    是否可以在不使用 Oracle 即时客户端的情况下安装 DBD::Oracle?

    Is it possible to install DBD::Oracle without using the Oracle instant client?

    推荐答案

    • 如果缺少 ExtUtils-MakeMaker 模块则安装 (sudo yum install perl-ExtUtils-MakeMaker)
    • 安装 Perl DBI 模块 ($ yum install perl-DBI)
    • 为 Oracle 即时客户端手动安装以下三个 RPM(来自 适用于 Linux x86-64 的 Instant Client 下载.以 v11.2.0.3.0-1 为例:根据实际版本调整以下命令.)

      • Install if missing ExtUtils-MakeMaker module (sudo yum install perl-ExtUtils-MakeMaker)
      • Install Perl DBI module ($ yum install perl-DBI)
      • Manually install below three RPMs for Oracle instant client (from Instant Client Downloads for Linux x86-64. The example is for v11.2.0.3.0-1: adapt the commands below to the actual version.)

        oracle-instantclient11.2-basic-11.2.0.3.0-1
        oracle-instantclient11.2-devel-11.2.0.3.0-1
        oracle-instantclient11.2-sqlplus-11.2.0.3.0-1
        

      • 我使用的是 64 位 Linux 机器,因此请相应地选择您的 RPM 文件名.像 sudo yum -y install oracle-instantclient*rpm 应该做的)

        I am using 64 bit Linux box, so select your RPM filenames accordingly. Something like sudo yum -y install oracle-instantclient*rpm should do)

        • 设置以下变量:

        • set below variables:

        export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
        export ORACLE_HOME=/usr/lib/oracle/11.2/client64
        

        MacOS 用户需要:

        MacOS users will need:

        DYLD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/
        

        同时将 ORACLE_HOME 添加到您的 PATH 变量中.

        Also add ORACLE_HOME to your PATH variable.

        从 CPAN

        解压模块并按给定顺序运行以下命令:

        untar the module and run below commands in given sequence:

        perl Makefile.PL
        make
        sudo make install
        

        如果您收到关于缺少 gcc 的投诉,您可以(暂时)安装它然后将其删除.

        In case you get complaints about missing gcc you can (temporarily) install it and then remove it.

        完成!!!

        我遇到的问题是由错误的 LD_LIBRARY_PATH 引起的.我已将其设置为 /usr/lib/oracle/11.2/client64 而正确的值是 /usr/lib/oracle/11.2/client64/lib.

        Issues I had faced were due to the wrong LD_LIBRARY_PATH. I had set it to /usr/lib/oracle/11.2/client64 whereas the correct value is /usr/lib/oracle/11.2/client64/lib.

        当然,这对像我这样的新手来说是一次很好的学习.

        Certainly, this was a great learning for a newbie like me.

        这篇关于Perl DBD::Oracle 模块安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

    本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!
  • 相关文档推荐

    SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
    MyBatis support for multiple databases(MyBatis支持多个数据库)
    Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
    SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
    How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
    Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)