Perl DBD::Oracle Module installation

后端 未结 4 498
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 02:30

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

Here is what I have done so far:

  • Platform: RHEL 5.8 64 bit
  • I
4条回答
  •  隐瞒了意图╮
    2020-11-30 03:15

    Here's what I did on CentOS 7.2 using yum packages and CPAN. This assumes you're using Oracle version 12.1 but I would imagine most versions will work this way.

    Install Oracle Instant Client

    yum install oracle-instantclient12.1-basic-12.1.0.2.0-1 oracle-instantclient12.1-devel-12.1.0.2.0-1 oracle-instantclient12.1-sqlplus-12.1.0.2.0-1
    

    Copy demo make files

    The install expects the *.mk file to be in /usr/share/oracle/12.1/client64 but the yum package install puts them in /usr/share/oracle/12.1/client64/demo.

    sudo cp /usr/share/oracle/12.1/client64/demo/* /usr/share/oracle/12.1/client64
    

    Modify .bashrc

    Add the following lines to your ~/.bashrc

    export ORACLE_HOME=/usr/lib/oracle/12.1/client64
    export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
    export PATH=$ORACLE_HOME:$PATH
    

    Now source the file

    source ~/.bashrc
    

    Update CPAN and DBI

    Update CPAN and DBI to the latest

    cpan> install CPAN
    cpan> reload cpan
    cpan> install DBI
    

    Install DBD::Oracle

    cpan> install DBD::Oracle
    

提交回复
热议问题